• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender-server / 10423

11 Nov 2025 04:53PM UTC coverage: 74.435% (-0.1%) from 74.562%
10423

push

gitlab-ci

web-flow
Merge pull request #1071 from mendersoftware/dependabot/npm_and_yarn/frontend/main/development-dependencies-92732187be

3868 of 5393 branches covered (71.72%)

Branch coverage included in aggregate %.

5 of 5 new or added lines in 2 files covered. (100.0%)

176 existing lines in 95 files now uncovered.

64605 of 86597 relevant lines covered (74.6%)

7.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.0
/frontend/src/js/components/settings/QuoteRequestForm.tsx
1
// Copyright 2021 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14
import { useState } from 'react';
15

16
import { Button, FormControl, FormHelperText, TextField } from '@mui/material';
17

18
import { ADDONS, PLANS } from '@northern.tech/store/constants';
19

20
const quoteRequest = {
1✔
21
  default: {
22
    title: 'Request a change to your plan',
23
    note: `If you have any questions regarding plan pricing or device limits, leave us a message and we'll respond as soon as we can.`
24
  },
25
  trial: {
26
    title: '2. Request a quote from our team',
27
    note: `If you have any notes about your requirements or device fleet size, leave a message and we'll respond as soon as we can`
28
  },
29
  enterprise: {
30
    title: 'Request a quote from our team',
31
    note: `If you have any notes about your requirements or device fleet size, leave a message and we'll respond as soon as we can`
32
  }
33
};
34

35
export const QuoteRequestForm = ({ addOns, currentPlan, isTrial, onSendMessage, updatedPlan }) => {
1✔
36
  const [message, setMessage] = useState('');
1✔
37

38
  const isEnterpriseUpgrade = updatedPlan === 'enterprise';
1✔
39
  const isUpgrade = Object.keys(PLANS).indexOf(updatedPlan) > Object.keys(PLANS).indexOf(currentPlan);
1✔
40
  const request = isEnterpriseUpgrade ? quoteRequest.enterprise : quoteRequest.default;
1!
41
  let { title } = request;
1✔
42
  title = isTrial ? `2. ${title}` : title;
1!
43
  return (
1✔
44
    <div className="flexbox column margin-bottom-large">
45
      <h3 className="margin-top-large">{title}</h3>
46
      {isEnterpriseUpgrade ? 'You are requesting a quote for the following subscription:' : 'You are requesting the following changes:'}
1!
47
      <div>
48
        <p>
49
          Plan: {isUpgrade ? 'Upgrade to ' : ''}
1!
50
          <b>{PLANS[updatedPlan].name}</b>
51
          {!isTrial && !!addOns.length && (
2!
52
            <span>
53
              <br />
54
              Add-ons: {addOns.map(addon => ADDONS[addon.name].title).join(', ')}
×
55
            </span>
56
          )}
57
        </p>
58
      </div>
59
      <FormControl style={{ marginBottom: 30, marginTop: 0 }}>
60
        <FormHelperText>Your message</FormHelperText>
UNCOV
61
        <TextField fullWidth multiline placeholder={request.note} value={message} onChange={e => setMessage(e.target.value)} />
×
62
      </FormControl>
63
      <p>
64
        {isTrial || isEnterpriseUpgrade
3!
65
          ? `After we receive your request, we'll be in touch to discuss your needs and provide a quote.`
66
          : `We'll send you a confirmation of any changes to your subscription.`}
67
      </p>
68
      <Button
69
        className="margin-top margin-bottom"
70
        color="secondary"
71
        disabled={!(message || (!isTrial && addOns.length))}
3✔
UNCOV
72
        onClick={() => onSendMessage(message)}
×
73
        style={{ alignSelf: 'flex-start' }}
74
        variant="contained"
75
      >
76
        Submit request
77
      </Button>
78
    </div>
79
  );
80
};
81

82
export default QuoteRequestForm;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc