@servicetitan/mpa-components 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/lib/components/brands/brand-card/brand-card.d.ts +4 -0
- package/lib/components/brands/brand-card/brand-card.d.ts.map +1 -0
- package/lib/components/brands/brand-card/brand-card.js +61 -0
- package/lib/components/brands/brand-card/brand-card.js.map +1 -0
- package/lib/components/brands/cards-grid/cards-grid.d.ts +6 -0
- package/lib/components/brands/cards-grid/cards-grid.d.ts.map +1 -0
- package/lib/components/brands/cards-grid/cards-grid.js +8 -0
- package/lib/components/brands/cards-grid/cards-grid.js.map +1 -0
- package/lib/components/brands/index.d.ts +2 -0
- package/lib/components/brands/index.d.ts.map +1 -0
- package/lib/components/brands/index.js +2 -0
- package/lib/components/brands/index.js.map +1 -0
- package/lib/components/brands/styles.module.less +73 -0
- package/lib/enums/brands.d.ts +21 -0
- package/lib/enums/brands.d.ts.map +1 -0
- package/lib/enums/brands.js +2 -0
- package/lib/enums/brands.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +15 -11
- package/src/components/brands/brand-card/brand-card.tsx +245 -0
- package/src/components/brands/cards-grid/cards-grid.tsx +16 -0
- package/src/components/brands/index.ts +1 -0
- package/src/components/brands/styles.module.less +73 -0
- package/src/components/brands/styles.module.less.d.ts +11 -0
- package/src/enums/brands.ts +23 -0
- package/src/index.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.11.0](https://github.com/servicetitan/marketing/compare/@servicetitan/mpa-components@1.10.0...@servicetitan/mpa-components@1.11.0) (2025-04-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @servicetitan/mpa-components
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [1.10.0](https://github.com/servicetitan/marketing/compare/@servicetitan/mpa-components@1.9.0...@servicetitan/mpa-components@1.10.0) (2024-09-18)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @servicetitan/mpa-components
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand-card.d.ts","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/brand-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAC;AAiB9C,OAAO,EAAe,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMpE,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA4GxC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
import { Link } from 'react-router-dom';
|
|
4
|
+
import { ActionMenu, BodyText, Button, Card, Headline, Icon, Stack, Tag, Tooltip, } from '@servicetitan/design-system';
|
|
5
|
+
import { DomainValidationStatus } from '@servicetitan/marketing-services-api/dist/settings/brand.mrk.api';
|
|
6
|
+
import { tokens } from '@servicetitan/tokens/core';
|
|
7
|
+
import * as Styles from '../styles.module.less';
|
|
8
|
+
const BRAND_NAME_PLACEHOLDER = 'Assign Brand Name';
|
|
9
|
+
export const BrandCard = ({ actions, domainValidationStatus, email, isDefault, isShared, logo, name, }) => {
|
|
10
|
+
const [isOpen, setOpen] = useState(false);
|
|
11
|
+
const actionsButtonSection = useMemo(() => {
|
|
12
|
+
if (!Array.isArray(actions)) {
|
|
13
|
+
return (_jsx(SingleActionButtonSection, { action: actions, domainValidationStatus: domainValidationStatus }));
|
|
14
|
+
}
|
|
15
|
+
const trigger = (_jsxs(Button, { outline: true, size: "small", onClick: () => setOpen(true), children: ["Actions ", _jsx(Icon, { name: "keyboard_arrow_down", size: 16 })] }));
|
|
16
|
+
return (_jsx(ActionMenu, { trigger: trigger, open: isOpen, onClickOutside: () => setOpen(false), direction: "bl", children: actions.map(action => {
|
|
17
|
+
if (action.href) {
|
|
18
|
+
return (_jsx(Link, { to: action.href, children: _jsx(ActionMenu.Item, { disabled: action.disabled, children: _jsx(BodyText, { subdued: action.disabled, children: action.name }) }, action.name) }, action.name));
|
|
19
|
+
}
|
|
20
|
+
const actionClick = () => {
|
|
21
|
+
setOpen(false);
|
|
22
|
+
if (action.action) {
|
|
23
|
+
action.action();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return (_jsx(ActionMenu.Item, { disabled: action.disabled, onClick: actionClick, children: _jsx(BodyText, { subdued: action.disabled, children: action.name }) }, action.name));
|
|
27
|
+
}) }));
|
|
28
|
+
}, [isOpen, setOpen, actions, domainValidationStatus]);
|
|
29
|
+
const nameToShow = name || BRAND_NAME_PLACEHOLDER;
|
|
30
|
+
return (_jsx(Card, { className: Styles.brandCard, status: domainValidationStatus === DomainValidationStatus.Error ? 'error' : 'default', children: _jsxs(Stack, { direction: "row", spacing: 2, className: Styles.cardContent, children: [_jsx(Stack.Item, { fill: true, children: _jsxs(Stack, { direction: "column", children: [logo && nameToShow !== 'Corporate Brand 2' ? (_jsx("img", { className: Styles.brandImg, src: logo, alt: name })) : (_jsx("div", { className: Styles.brandImgPlaceholder, children: _jsx(Icon, { name: "image", className: "c-neutral-90", size: 24 }) })), _jsxs(Stack, { direction: "column", className: "m-t-3", children: [_jsx(Headline, { el: "p", subdued: !name, className: "t-truncate-i m-0", title: nameToShow, children: nameToShow }), email && (_jsx(BodyText, { subdued: true, title: email, className: "t-truncate-i", children: email }))] })] }) }), _jsxs(Stack, { direction: "column", children: [actionsButtonSection, _jsx(CardTags, { isDefault: isDefault, isShared: isShared })] })] }) }));
|
|
31
|
+
};
|
|
32
|
+
const CardTags = ({ isDefault, isShared }) => {
|
|
33
|
+
if (!isDefault && !isShared) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return (_jsxs(Stack, { direction: "column", alignItems: "flex-end", className: Styles.tags, children: [isShared && (_jsx(Tag, { className: Styles.corporateTag, color: "info", subtle: true, compact: true, children: "Corporate HQ" })), isDefault && (_jsx(Tag, { className: Styles.defaultTag, compact: true, children: "Default" }))] }));
|
|
37
|
+
};
|
|
38
|
+
const SingleActionButtonSection = ({ domainValidationStatus, action }) => {
|
|
39
|
+
const validationStatusIcon = useMemo(() => {
|
|
40
|
+
return _jsx(ValidationStatusIcon, { status: domainValidationStatus });
|
|
41
|
+
}, [domainValidationStatus]);
|
|
42
|
+
if (domainValidationStatus === DomainValidationStatus.Pending) {
|
|
43
|
+
return (_jsxs(Stack, { spacing: 1, alignItems: "center", children: [_jsx(BodyText, { size: "small", children: "Validation In Process" }), validationStatusIcon] }));
|
|
44
|
+
}
|
|
45
|
+
return (_jsxs(Stack, { spacing: 2, alignItems: "center", children: [validationStatusIcon, action.isConfigured && (_jsx(Icon, { name: "check_circle", color: tokens.colorGreen500, size: 24 })), action.inProgress ? (_jsx(InProgressButton, { action: action })) : (_jsx(StandardButton, { action: action }))] }));
|
|
46
|
+
};
|
|
47
|
+
const StandardButton = ({ action }) => (_jsx(Tooltip, { text: action.disabled ? action.tooltipMessage : '', children: action.href ? (_jsx(Link, { to: action.href, children: _jsx(Button, { size: "small", primary: true, outline: true, disabled: action.disabled, children: action.name }) })) : (_jsx(Button, { size: "small", primary: true, onClick: action.action, outline: true, disabled: action.disabled, children: action.name })) }));
|
|
48
|
+
const InProgressButton = ({ action }) => (_jsx(Tooltip, { text: action.disabled ? action.tooltipMessage : '', children: action.href ? (_jsx(Link, { to: action.href, children: _jsxs(Button, { size: "small", primary: true, text: true, className: "m-0 p-1", children: [_jsx(BodyText, { size: "small", className: "m-r-half", children: "Registration In Progress" }), _jsx(Icon, { name: "hourglass_full", color: tokens.colorBlue, size: 16 })] }) })) : (_jsxs(Button, { size: "small", primary: true, text: true, className: "m-0 p-1", onClick: action.action, children: [_jsx(BodyText, { size: "small", className: "m-r-1", children: "Registration In Progress" }), _jsx(Icon, { name: "hourglass_full", color: tokens.colorBlue, size: 16 })] })) }));
|
|
49
|
+
const ValidationStatusIcon = ({ status }) => {
|
|
50
|
+
switch (status) {
|
|
51
|
+
case DomainValidationStatus.Error:
|
|
52
|
+
return (_jsx(Tooltip, { direction: "t", text: "Error is detected in processing the Sender Domain validation. Please check and try again.", className: "cursor-pointer", children: _jsx(Icon, { name: "warning", color: tokens.colorRed500, size: 24 }) }));
|
|
53
|
+
case DomainValidationStatus.Validated:
|
|
54
|
+
return _jsx(Icon, { name: "check_circle", color: tokens.colorGreen500, size: 24 });
|
|
55
|
+
case DomainValidationStatus.Pending:
|
|
56
|
+
return _jsx(Icon, { name: "hourglass_full", color: tokens.colorBlue500, size: 24 });
|
|
57
|
+
default:
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=brand-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand-card.js","sourceRoot":"","sources":["../../../../src/components/brands/brand-card/brand-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EACH,UAAU,EACV,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,GAAG,EACH,OAAO,GACV,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kEAAkE,CAAC;AAC1G,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAInD,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,MAAM,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,MAAM,EAAE,CAAC;QACb,KAAK,sBAAsB,CAAC,KAAK;YAC7B,OAAO,CACH,KAAC,OAAO,IACJ,SAAS,EAAC,GAAG,EACb,IAAI,EAAC,2FAA2F,EAChG,SAAS,EAAC,gBAAgB,YAE1B,KAAC,IAAI,IAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAE,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,GAAI,GACtD,CACb,CAAC;QACN,KAAK,sBAAsB,CAAC,SAAS;YACjC,OAAO,KAAC,IAAI,IAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,EAAE,GAAI,CAAC;QAC/E,KAAK,sBAAsB,CAAC,OAAO;YAC/B,OAAO,KAAC,IAAI,IAAC,IAAI,EAAC,gBAAgB,EAAC,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,EAAE,GAAI,CAAC;QAChF;YACI,OAAO,IAAI,CAAC;IACpB,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cards-grid.d.ts","sourceRoot":"","sources":["../../../../src/components/brands/cards-grid/cards-grid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAK3B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC;IAAE,MAAM,EAAE,cAAc,EAAE,CAAA;CAAE,CAMtD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Grid } from '@servicetitan/anvil2';
|
|
3
|
+
import { BrandCard } from '../brand-card/brand-card';
|
|
4
|
+
import * as Styles from '../styles.module.less';
|
|
5
|
+
export const CardsGrid = ({ brands }) => (_jsx(Grid, { className: Styles.grid, gap: "6", children: brands.map(brand => {
|
|
6
|
+
return _jsx(BrandCard, { ...brand }, brand.id);
|
|
7
|
+
}) }));
|
|
8
|
+
//# sourceMappingURL=cards-grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cards-grid.js","sourceRoot":"","sources":["../../../../src/components/brands/cards-grid/cards-grid.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,MAAM,CAAC,MAAM,SAAS,GAAqC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACvE,KAAC,IAAI,IAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,GAAG,EAAC,GAAG,YAChC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAChB,OAAO,KAAC,SAAS,OAAoB,KAAK,IAAnB,KAAK,CAAC,EAAE,CAAe,CAAC;IACnD,CAAC,CAAC,GACC,CACV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/brands/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/brands/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@import (reference) '@servicetitan/tokens/dist/tokens.less';
|
|
2
|
+
|
|
3
|
+
@action-menu-item-padding: 12px;
|
|
4
|
+
@card-min-width: 330px;
|
|
5
|
+
@card-max-width: 700px;
|
|
6
|
+
@max-number-of-cards: 3;
|
|
7
|
+
|
|
8
|
+
.delete-tooltip {
|
|
9
|
+
min-width: 327px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.grid {
|
|
13
|
+
grid-template-columns: repeat(auto-fill, minmax(@card-min-width, 1fr));
|
|
14
|
+
max-width: calc(@card-max-width * @max-number-of-cards + @spacing-3 * 2);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@media (min-width: 1120px) {
|
|
18
|
+
.grid {
|
|
19
|
+
grid-template-columns: repeat(@max-number-of-cards - 1, 1fr);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@media (min-width: 1620px) {
|
|
24
|
+
.grid {
|
|
25
|
+
grid-template-columns: repeat(@max-number-of-cards, 1fr);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.brand-card {
|
|
30
|
+
height: 200px;
|
|
31
|
+
min-width: @card-min-width;
|
|
32
|
+
max-width: @card-max-width;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
background: inherit !important;
|
|
35
|
+
|
|
36
|
+
:global(.CardSection) {
|
|
37
|
+
height: 150px;
|
|
38
|
+
background-color: @color-white;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.card-content {
|
|
43
|
+
height: 139px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.brand-img {
|
|
47
|
+
width: @spacing-6;
|
|
48
|
+
height: @spacing-6;
|
|
49
|
+
min-width: @spacing-6;
|
|
50
|
+
min-height: @spacing-6;
|
|
51
|
+
border-radius: @border-radius-circular;
|
|
52
|
+
border: solid 1px @color-neutral-60;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.brand-img-placeholder {
|
|
56
|
+
.brand-img();
|
|
57
|
+
background-color: @color-neutral-60;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.tags {
|
|
61
|
+
height: 41px;
|
|
62
|
+
margin-bottom: 2px;
|
|
63
|
+
margin-top: auto;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.default-tag {
|
|
67
|
+
width: 53px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.corporate-tag {
|
|
71
|
+
min-width: 86px;
|
|
72
|
+
margin-bottom: @spacing-half;
|
|
73
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DomainValidationStatus } from '@servicetitan/marketing-services-api/dist/settings/brand.mrk.api';
|
|
2
|
+
export interface BrandAction {
|
|
3
|
+
name: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
tooltipMessage?: string;
|
|
6
|
+
inProgress?: boolean;
|
|
7
|
+
isConfigured?: boolean;
|
|
8
|
+
href?: string;
|
|
9
|
+
action?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface BrandCardProps {
|
|
12
|
+
id: string;
|
|
13
|
+
actions: BrandAction | BrandAction[];
|
|
14
|
+
logo?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
isDefault: boolean;
|
|
17
|
+
email?: string;
|
|
18
|
+
domainValidationStatus?: DomainValidationStatus;
|
|
19
|
+
isShared: boolean;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=brands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brands.d.ts","sourceRoot":"","sources":["../../src/enums/brands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kEAAkE,CAAC;AAE1G,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAChD,QAAQ,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../src/enums/brands.ts"],"names":[],"mappings":""}
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,26 +3,30 @@
|
|
|
3
3
|
"repository": {
|
|
4
4
|
"url": "https://github.com/servicetitan/marketing"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.11.0",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "./lib/index.js",
|
|
9
9
|
"typings": "./lib/index.d.ts",
|
|
10
10
|
"peerDependencies": {
|
|
11
|
-
"@servicetitan/
|
|
12
|
-
"@servicetitan/
|
|
13
|
-
"@servicetitan/
|
|
14
|
-
"@servicetitan/form
|
|
15
|
-
"@servicetitan/
|
|
11
|
+
"@servicetitan/anvil2": "^1.23.1",
|
|
12
|
+
"@servicetitan/confirm": "~28.5.1",
|
|
13
|
+
"@servicetitan/design-system": "~14.5.1",
|
|
14
|
+
"@servicetitan/form": "~28.5.1",
|
|
15
|
+
"@servicetitan/form-state": "~28.5.1",
|
|
16
|
+
"@servicetitan/marketing-services-api": "^3.29.0",
|
|
17
|
+
"@servicetitan/react-ioc": "~28.4.0",
|
|
16
18
|
"@servicetitan/tokens": "~12.2.1",
|
|
17
|
-
"formstate": "
|
|
18
|
-
"mobx": "6.
|
|
19
|
+
"formstate": "2.0.0",
|
|
20
|
+
"mobx": "6.13.5",
|
|
19
21
|
"mobx-react": "9.0.2",
|
|
20
22
|
"moment": "~2.29.1",
|
|
21
|
-
"react": "~18.3.1"
|
|
23
|
+
"react": "~18.3.1",
|
|
24
|
+
"react-router-dom": "~5.3.0"
|
|
22
25
|
},
|
|
23
26
|
"devDependencies": {
|
|
24
27
|
"@testing-library/react": "^14.0.0",
|
|
25
|
-
"@types/history": "4.7.9"
|
|
28
|
+
"@types/history": "4.7.9",
|
|
29
|
+
"@types/react-router-dom": "~5.3.3"
|
|
26
30
|
},
|
|
27
31
|
"publishConfig": {
|
|
28
32
|
"access": "restricted"
|
|
@@ -30,5 +34,5 @@
|
|
|
30
34
|
"cli": {
|
|
31
35
|
"webpack": false
|
|
32
36
|
},
|
|
33
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "cd109a383e221446aaa2fed378646ad14bd07a90"
|
|
34
38
|
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { FC, useMemo, useState } from 'react';
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
ActionMenu,
|
|
6
|
+
BodyText,
|
|
7
|
+
Button,
|
|
8
|
+
Card,
|
|
9
|
+
Headline,
|
|
10
|
+
Icon,
|
|
11
|
+
Stack,
|
|
12
|
+
Tag,
|
|
13
|
+
Tooltip,
|
|
14
|
+
} from '@servicetitan/design-system';
|
|
15
|
+
import { DomainValidationStatus } from '@servicetitan/marketing-services-api/dist/settings/brand.mrk.api';
|
|
16
|
+
import { tokens } from '@servicetitan/tokens/core';
|
|
17
|
+
|
|
18
|
+
import { BrandAction, BrandCardProps } from '../../../enums/brands';
|
|
19
|
+
|
|
20
|
+
import * as Styles from '../styles.module.less';
|
|
21
|
+
|
|
22
|
+
const BRAND_NAME_PLACEHOLDER = 'Assign Brand Name';
|
|
23
|
+
|
|
24
|
+
export const BrandCard: FC<BrandCardProps> = ({
|
|
25
|
+
actions,
|
|
26
|
+
domainValidationStatus,
|
|
27
|
+
email,
|
|
28
|
+
isDefault,
|
|
29
|
+
isShared,
|
|
30
|
+
logo,
|
|
31
|
+
name,
|
|
32
|
+
}) => {
|
|
33
|
+
const [isOpen, setOpen] = useState(false);
|
|
34
|
+
|
|
35
|
+
const actionsButtonSection = useMemo(() => {
|
|
36
|
+
if (!Array.isArray(actions)) {
|
|
37
|
+
return (
|
|
38
|
+
<SingleActionButtonSection
|
|
39
|
+
action={actions}
|
|
40
|
+
domainValidationStatus={domainValidationStatus}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const trigger = (
|
|
46
|
+
<Button outline size="small" onClick={() => setOpen(true)}>
|
|
47
|
+
Actions <Icon name="keyboard_arrow_down" size={16} />
|
|
48
|
+
</Button>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<ActionMenu
|
|
53
|
+
trigger={trigger}
|
|
54
|
+
open={isOpen}
|
|
55
|
+
onClickOutside={() => setOpen(false)}
|
|
56
|
+
direction="bl"
|
|
57
|
+
>
|
|
58
|
+
{actions.map(action => {
|
|
59
|
+
if (action.href) {
|
|
60
|
+
return (
|
|
61
|
+
<Link to={action.href} key={action.name}>
|
|
62
|
+
<ActionMenu.Item key={action.name} disabled={action.disabled}>
|
|
63
|
+
<BodyText subdued={action.disabled}>{action.name}</BodyText>
|
|
64
|
+
</ActionMenu.Item>
|
|
65
|
+
</Link>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const actionClick = () => {
|
|
70
|
+
setOpen(false);
|
|
71
|
+
if (action.action) {
|
|
72
|
+
action.action();
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<ActionMenu.Item
|
|
78
|
+
disabled={action.disabled}
|
|
79
|
+
key={action.name}
|
|
80
|
+
onClick={actionClick}
|
|
81
|
+
>
|
|
82
|
+
<BodyText subdued={action.disabled}>{action.name}</BodyText>
|
|
83
|
+
</ActionMenu.Item>
|
|
84
|
+
);
|
|
85
|
+
})}
|
|
86
|
+
</ActionMenu>
|
|
87
|
+
);
|
|
88
|
+
}, [isOpen, setOpen, actions, domainValidationStatus]);
|
|
89
|
+
|
|
90
|
+
const nameToShow = name || BRAND_NAME_PLACEHOLDER;
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<Card
|
|
94
|
+
className={Styles.brandCard}
|
|
95
|
+
status={domainValidationStatus === DomainValidationStatus.Error ? 'error' : 'default'}
|
|
96
|
+
>
|
|
97
|
+
<Stack direction="row" spacing={2} className={Styles.cardContent}>
|
|
98
|
+
<Stack.Item fill>
|
|
99
|
+
<Stack direction="column">
|
|
100
|
+
{logo && nameToShow !== 'Corporate Brand 2' ? (
|
|
101
|
+
<img className={Styles.brandImg} src={logo} alt={name} />
|
|
102
|
+
) : (
|
|
103
|
+
<div className={Styles.brandImgPlaceholder}>
|
|
104
|
+
<Icon name="image" className="c-neutral-90" size={24} />
|
|
105
|
+
</div>
|
|
106
|
+
)}
|
|
107
|
+
|
|
108
|
+
<Stack direction="column" className="m-t-3">
|
|
109
|
+
<Headline
|
|
110
|
+
el="p"
|
|
111
|
+
subdued={!name}
|
|
112
|
+
className="t-truncate-i m-0"
|
|
113
|
+
title={nameToShow}
|
|
114
|
+
>
|
|
115
|
+
{nameToShow}
|
|
116
|
+
</Headline>
|
|
117
|
+
{email && (
|
|
118
|
+
<BodyText subdued title={email} className="t-truncate-i">
|
|
119
|
+
{email}
|
|
120
|
+
</BodyText>
|
|
121
|
+
)}
|
|
122
|
+
</Stack>
|
|
123
|
+
</Stack>
|
|
124
|
+
</Stack.Item>
|
|
125
|
+
<Stack direction="column">
|
|
126
|
+
{actionsButtonSection}
|
|
127
|
+
<CardTags isDefault={isDefault} isShared={isShared} />
|
|
128
|
+
</Stack>
|
|
129
|
+
</Stack>
|
|
130
|
+
</Card>
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const CardTags: FC<{ isDefault: boolean; isShared: boolean }> = ({ isDefault, isShared }) => {
|
|
135
|
+
if (!isDefault && !isShared) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<Stack direction="column" alignItems="flex-end" className={Styles.tags}>
|
|
141
|
+
{isShared && (
|
|
142
|
+
<Tag className={Styles.corporateTag} color="info" subtle compact>
|
|
143
|
+
Corporate HQ
|
|
144
|
+
</Tag>
|
|
145
|
+
)}
|
|
146
|
+
{isDefault && (
|
|
147
|
+
<Tag className={Styles.defaultTag} compact>
|
|
148
|
+
Default
|
|
149
|
+
</Tag>
|
|
150
|
+
)}
|
|
151
|
+
</Stack>
|
|
152
|
+
);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const SingleActionButtonSection: FC<{
|
|
156
|
+
action: BrandAction;
|
|
157
|
+
domainValidationStatus?: DomainValidationStatus;
|
|
158
|
+
}> = ({ domainValidationStatus, action }) => {
|
|
159
|
+
const validationStatusIcon = useMemo(() => {
|
|
160
|
+
return <ValidationStatusIcon status={domainValidationStatus} />;
|
|
161
|
+
}, [domainValidationStatus]);
|
|
162
|
+
|
|
163
|
+
if (domainValidationStatus === DomainValidationStatus.Pending) {
|
|
164
|
+
return (
|
|
165
|
+
<Stack spacing={1} alignItems="center">
|
|
166
|
+
<BodyText size="small">Validation In Process</BodyText>
|
|
167
|
+
{validationStatusIcon}
|
|
168
|
+
</Stack>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return (
|
|
173
|
+
<Stack spacing={2} alignItems="center">
|
|
174
|
+
{validationStatusIcon}
|
|
175
|
+
{action.isConfigured && (
|
|
176
|
+
<Icon name="check_circle" color={tokens.colorGreen500} size={24} />
|
|
177
|
+
)}
|
|
178
|
+
|
|
179
|
+
{action.inProgress ? (
|
|
180
|
+
<InProgressButton action={action} />
|
|
181
|
+
) : (
|
|
182
|
+
<StandardButton action={action} />
|
|
183
|
+
)}
|
|
184
|
+
</Stack>
|
|
185
|
+
);
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const StandardButton: FC<{ action: BrandAction }> = ({ action }) => (
|
|
189
|
+
<Tooltip text={action.disabled ? action.tooltipMessage : ''}>
|
|
190
|
+
{action.href ? (
|
|
191
|
+
<Link to={action.href}>
|
|
192
|
+
<Button size="small" primary outline disabled={action.disabled}>
|
|
193
|
+
{action.name}
|
|
194
|
+
</Button>
|
|
195
|
+
</Link>
|
|
196
|
+
) : (
|
|
197
|
+
<Button size="small" primary onClick={action.action} outline disabled={action.disabled}>
|
|
198
|
+
{action.name}
|
|
199
|
+
</Button>
|
|
200
|
+
)}
|
|
201
|
+
</Tooltip>
|
|
202
|
+
);
|
|
203
|
+
|
|
204
|
+
const InProgressButton: FC<{ action: BrandAction }> = ({ action }) => (
|
|
205
|
+
<Tooltip text={action.disabled ? action.tooltipMessage : ''}>
|
|
206
|
+
{action.href ? (
|
|
207
|
+
<Link to={action.href}>
|
|
208
|
+
<Button size="small" primary text className="m-0 p-1">
|
|
209
|
+
<BodyText size="small" className="m-r-half">
|
|
210
|
+
Registration In Progress
|
|
211
|
+
</BodyText>
|
|
212
|
+
<Icon name="hourglass_full" color={tokens.colorBlue} size={16} />
|
|
213
|
+
</Button>
|
|
214
|
+
</Link>
|
|
215
|
+
) : (
|
|
216
|
+
<Button size="small" primary text className="m-0 p-1" onClick={action.action}>
|
|
217
|
+
<BodyText size="small" className="m-r-1">
|
|
218
|
+
Registration In Progress
|
|
219
|
+
</BodyText>
|
|
220
|
+
<Icon name="hourglass_full" color={tokens.colorBlue} size={16} />
|
|
221
|
+
</Button>
|
|
222
|
+
)}
|
|
223
|
+
</Tooltip>
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
const ValidationStatusIcon: FC<{ status?: DomainValidationStatus }> = ({ status }) => {
|
|
227
|
+
switch (status) {
|
|
228
|
+
case DomainValidationStatus.Error:
|
|
229
|
+
return (
|
|
230
|
+
<Tooltip
|
|
231
|
+
direction="t"
|
|
232
|
+
text="Error is detected in processing the Sender Domain validation. Please check and try again."
|
|
233
|
+
className="cursor-pointer"
|
|
234
|
+
>
|
|
235
|
+
<Icon name="warning" color={tokens.colorRed500} size={24} />
|
|
236
|
+
</Tooltip>
|
|
237
|
+
);
|
|
238
|
+
case DomainValidationStatus.Validated:
|
|
239
|
+
return <Icon name="check_circle" color={tokens.colorGreen500} size={24} />;
|
|
240
|
+
case DomainValidationStatus.Pending:
|
|
241
|
+
return <Icon name="hourglass_full" color={tokens.colorBlue500} size={24} />;
|
|
242
|
+
default:
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Grid } from '@servicetitan/anvil2';
|
|
4
|
+
|
|
5
|
+
import { BrandCard } from '../brand-card/brand-card';
|
|
6
|
+
import { BrandCardProps } from '../../../enums/brands';
|
|
7
|
+
|
|
8
|
+
import * as Styles from '../styles.module.less';
|
|
9
|
+
|
|
10
|
+
export const CardsGrid: FC<{ brands: BrandCardProps[] }> = ({ brands }) => (
|
|
11
|
+
<Grid className={Styles.grid} gap="6">
|
|
12
|
+
{brands.map(brand => {
|
|
13
|
+
return <BrandCard key={brand.id} {...brand} />;
|
|
14
|
+
})}
|
|
15
|
+
</Grid>
|
|
16
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './cards-grid/cards-grid';
|