@stack-spot/portal-components 2.24.1 → 2.24.3
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 +15 -0
- package/dist/components/error/ErrorFeedback.js +31 -31
- package/dist/components/error/ErrorFeedback.js.map +1 -1
- package/dist/utils/cookie.d.ts.map +1 -1
- package/dist/utils/cookie.js +7 -3
- package/dist/utils/cookie.js.map +1 -1
- package/package.json +1 -1
- package/src/components/error/ErrorFeedback.tsx +31 -31
- package/src/utils/cookie.ts +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.24.3](https://github.com/stack-spot/portal-commons/compare/portal-components@v2.24.2...portal-components@v2.24.3) (2025-07-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* adjusts error messages in Ai ([#1274](https://github.com/stack-spot/portal-commons/issues/1274)) ([09aad8b](https://github.com/stack-spot/portal-commons/commit/09aad8b3cf8538d14455203be201beec03716d51))
|
|
9
|
+
|
|
10
|
+
## [2.24.2](https://github.com/stack-spot/portal-commons/compare/portal-components@v2.24.1...portal-components@v2.24.2) (2025-07-22)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* Adds Secure attribute to cookies for HTTPS ([#1114](https://github.com/stack-spot/portal-commons/issues/1114)) ([18e06fb](https://github.com/stack-spot/portal-commons/commit/18e06fbe08b1c89e2d554295627298c4723c99c6))
|
|
16
|
+
* reviewing error messages in ai ([#1270](https://github.com/stack-spot/portal-commons/issues/1270)) ([5de8012](https://github.com/stack-spot/portal-commons/commit/5de8012538c22f0fd061233154619afcd4b589a5))
|
|
17
|
+
|
|
3
18
|
## [2.24.1](https://github.com/stack-spot/portal-commons/compare/portal-components@v2.24.0...portal-components@v2.24.1) (2025-06-16)
|
|
4
19
|
|
|
5
20
|
|
|
@@ -67,48 +67,48 @@ export const ErrorFeedback = ({ code = 0, message, debug, title, body, image, ac
|
|
|
67
67
|
function renderBody() {
|
|
68
68
|
return typeof body === 'string' ? _jsx(Text, { appearance: "body1", colorScheme: "inverse", className: "description", children: body }) : body;
|
|
69
69
|
}
|
|
70
|
-
return (_jsx(FeedbackBox, { style: style, className: className, children: _jsxs("div", { className: listToClass(['content', direction]), children: [_jsx("div", { className: "image", children: image ?? imageMap[code] ?? _jsx(ServerError, { style: imageStyle }) }), _jsxs("div", { className: "text-content", children: [_jsx(LinkBox, { href: "/", className: "logo", children: _jsx(Logo, { style: { width: '130px', height: '30px' } }) }), _jsxs(Text, { appearance: "h4", mt: 5, colorScheme: "inverse", className: "title", children: [(code && !title) ? `${code}. ` : '', _jsx(Text, { appearance: "h4", as: "span", colorScheme: "light.700", children: title ?? t[`${code}.title`] })] }), body ? renderBody() : (_jsxs(_Fragment, { children: [_jsx(Text, { appearance: "body1", mt: 5, colorScheme: "inverse", className: "description", children: description ?? t[`${code}.description`] }), _jsx(Text, { appearance: "body1", colorScheme: "light.700", className: "help", children: help ?? t[`${code}.help`] })] })), shouldShowButtons && (_jsxs("div", { className: "buttons", children: [action && (_jsx(Button, { colorScheme: "inverse", onClick: action.onClick, children: action.label })), debug && message && (_jsx(Button, { appearance: "outlined", colorScheme: "inverse", onClick: () => setShowDetails(v => !v), children: showDetails ? t.hideDetails : t.showDetails }))] })), showDetails && (_jsx("div", { className: "details", children: _jsx(Text, { appearance: "microtext1", children: message }) }))] })] }) }));
|
|
70
|
+
return (_jsx(FeedbackBox, { style: style, className: className, children: _jsxs("div", { className: listToClass(['content', direction]), children: [_jsx("div", { className: "image", children: image ?? imageMap[code] ?? _jsx(ServerError, { style: imageStyle }) }), _jsxs("div", { className: "text-content", children: [_jsx(LinkBox, { href: "/", className: "logo", children: _jsx(Logo, { style: { width: '130px', height: '30px' } }) }), _jsxs(Text, { appearance: "h4", mt: 5, colorScheme: "inverse", className: "title", children: [(code && !title) ? `${t.errorLabel} ${code}. ` : '', _jsx(Text, { appearance: "h4", as: "span", colorScheme: "light.700", children: title ?? t[`${code}.title`] })] }), body ? renderBody() : (_jsxs(_Fragment, { children: [_jsx(Text, { appearance: "body1", mt: 5, colorScheme: "inverse", className: "description", children: description ?? t[`${code}.description`] }), _jsx(Text, { appearance: "body1", colorScheme: "light.700", className: "help", children: help ?? t[`${code}.help`] })] })), shouldShowButtons && (_jsxs("div", { className: "buttons", children: [action && (_jsx(Button, { colorScheme: "inverse", onClick: action.onClick, children: action.label })), debug && message && (_jsx(Button, { appearance: "outlined", colorScheme: "inverse", onClick: () => setShowDetails(v => !v), children: showDetails ? t.hideDetails : t.showDetails }))] })), showDetails && (_jsx("div", { className: "details", children: _jsx(Text, { appearance: "microtext1", children: message }) }))] })] }) }));
|
|
71
71
|
};
|
|
72
72
|
const dictionary = {
|
|
73
73
|
en: {
|
|
74
74
|
altLogo: 'Logo Stackspot',
|
|
75
|
-
'0.title': '
|
|
76
|
-
'0.description': '
|
|
77
|
-
'0.help': '
|
|
78
|
-
'401.title': '
|
|
79
|
-
'401.description': '
|
|
80
|
-
'401.help': 'Check
|
|
81
|
-
'403.title': '
|
|
82
|
-
'403.
|
|
83
|
-
'
|
|
84
|
-
'404.
|
|
85
|
-
'404.
|
|
86
|
-
'
|
|
87
|
-
'500.
|
|
88
|
-
'500.
|
|
89
|
-
'500.help': 'Please try again after a few minutes.',
|
|
75
|
+
'0.title': 'Something didn’t go as expected',
|
|
76
|
+
'0.description': 'This can happen from time to time.',
|
|
77
|
+
'0.help': 'Try refreshing the page. If it still doesn’t work, reach out. We’re here to help.',
|
|
78
|
+
'401.title': 'You need a valid credential',
|
|
79
|
+
'401.description': 'We couldn’t verify your credentials.',
|
|
80
|
+
'401.help': 'Check the link or log in with a different account to continue.',
|
|
81
|
+
'403.title': 'Access restricted to your organization',
|
|
82
|
+
'403.help': 'Log in with an account from your organization or request access from your Account Holder.',
|
|
83
|
+
'404.title': 'This resource is no longer available',
|
|
84
|
+
'404.description': 'It may have been moved or removed.',
|
|
85
|
+
'404.help': 'You can try again or ask your organization’s Account Holder for a new link.',
|
|
86
|
+
'500.title': 'We\'re making some adjustments',
|
|
87
|
+
'500.description': 'Something unexpected happened on our side. It might just be a momentary glitch.',
|
|
88
|
+
'500.help': 'Try refreshing later to pick up where you left off.',
|
|
90
89
|
showDetails: 'Show Details',
|
|
91
90
|
hideDetails: 'Hide Details',
|
|
91
|
+
errorLabel: 'Error',
|
|
92
92
|
},
|
|
93
93
|
pt: {
|
|
94
94
|
altLogo: 'Logo Stackspot',
|
|
95
|
-
'0.title': '
|
|
96
|
-
'0.description': '
|
|
97
|
-
'0.help': '
|
|
98
|
-
'401.title': '
|
|
99
|
-
'401.description': '
|
|
100
|
-
'401.help': 'Verifique
|
|
101
|
-
'403.title': 'Acesso
|
|
102
|
-
'403.
|
|
103
|
-
'
|
|
104
|
-
'404.
|
|
105
|
-
'404.
|
|
106
|
-
'
|
|
107
|
-
'500.
|
|
108
|
-
'500.
|
|
109
|
-
'500.help': 'Tente novamente após alguns minutos.',
|
|
95
|
+
'0.title': 'Algo saiu diferente do esperado',
|
|
96
|
+
'0.description': 'Isso pode acontecer de vez em quando.',
|
|
97
|
+
'0.help': 'Tente recarregar a página. Se ainda não funcionar, chama a gente. Estamos por aqui para ajudar.',
|
|
98
|
+
'401.title': 'Você precisa de uma credencial válida',
|
|
99
|
+
'401.description': 'Não conseguimos confirmar suas credenciais.',
|
|
100
|
+
'401.help': 'Verifique o link ou faça login com outra conta para continuar.',
|
|
101
|
+
'403.title': 'Acesso exclusivo da sua organização',
|
|
102
|
+
'403.help': 'Faça login com uma conta da sua organização ou peça acesso ao Account Holder.',
|
|
103
|
+
'404.title': 'Este recurso não está mais disponível',
|
|
104
|
+
'404.description': 'Ele pode ter sido movido ou removido.',
|
|
105
|
+
'404.help': 'Você pode tentar de novo ou pedir um novo link ao Account Holder da sua organização.',
|
|
106
|
+
'500.title': 'Estamos ajustando o sistema',
|
|
107
|
+
'500.description': 'Algo inesperado aconteceu do nosso lado. Pode ser só por alguns instantes.',
|
|
108
|
+
'500.help': 'Tente recarregar mais tarde para continuar de onde parou.',
|
|
110
109
|
showDetails: 'Ver Detalhes',
|
|
111
110
|
hideDetails: 'Esconder Detalhes',
|
|
111
|
+
errorLabel: 'Erro',
|
|
112
112
|
},
|
|
113
113
|
};
|
|
114
114
|
//# sourceMappingURL=ErrorFeedback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorFeedback.js","sourceRoot":"","sources":["../../../src/components/error/ErrorFeedback.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,MAAM,UAAU,GAAwB;IACtC,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,OAAO;CAChB,CAAA;AAED,MAAM,QAAQ,GAAuC;IACnD,GAAG,EAAE,KAAC,eAAe,IAAC,KAAK,EAAE,UAAU,GAAI;IAC3C,GAAG,EAAE,KAAC,SAAS,IAAC,KAAK,EAAE,UAAU,GAAI;IACrC,GAAG,EAAE,KAAC,QAAQ,IAAC,KAAK,E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W,EAAE,uCAAuC;QACpD,iBAAiB,EAAE,6CAA6C;QAChE,UAAU,EAAE,gEAAgE;QAC5E,WAAW,EAAE,qCAAqC;QAClD,UAAU,EAAE,+EAA+E;QAC3F,WAAW,EAAE,uCAAuC;QACpD,iBAAiB,EAAE,uCAAuC;QAC1D,UAAU,EAAE,sFAAsF;QAClG,WAAW,EAAE,6BAA6B;QAC1C,iBAAiB,EAAE,4EAA4E;QAC/F,UAAU,EAAE,2DAA2D;QACvE,WAAW,EAAE,cAAc;QAC3B,WAAW,EAAE,mBAAmB;QAChC,UAAU,EAAE,MAAM;KACnB;CACmB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../../src/utils/cookie.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../../src/utils/cookie.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,QAQ/C;AAED;;;GAGG;AACH,wBAAgB,eAAe,WAG9B;AAED;;;GAGG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAO/D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,QAGlG;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,QAGvC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,sBAEpC"}
|
package/dist/utils/cookie.js
CHANGED
|
@@ -10,6 +10,10 @@ export function setupCookies(domainRegex) {
|
|
|
10
10
|
const portalUrl = new URL(location.href);
|
|
11
11
|
cookieDomain = domainRegex.exec(portalUrl.host)?.[0] ?? '';
|
|
12
12
|
cookieAttributes = { domain: cookieDomain, SameSite: 'Strict' };
|
|
13
|
+
// Add Secure attribute if using HTTPS
|
|
14
|
+
if (portalUrl.protocol === 'https:') {
|
|
15
|
+
cookieAttributes['Secure'] = '';
|
|
16
|
+
}
|
|
13
17
|
}
|
|
14
18
|
/**
|
|
15
19
|
* Retrieves the current domain used for cookies. To change the domain, use `setupCookies(domainRegex)`.
|
|
@@ -42,7 +46,7 @@ export function getCookies() {
|
|
|
42
46
|
export function setCookie(key, value, customAttributes = {}) {
|
|
43
47
|
if (isEmpty(cookieAttributes))
|
|
44
48
|
setupCookies(DEFAULT_DOMAIN_REGEX);
|
|
45
|
-
document.cookie = `${key}=${value}
|
|
49
|
+
document.cookie = `${key}=${value};${objectToCookieString({ ...cookieAttributes, ...customAttributes })}`;
|
|
46
50
|
}
|
|
47
51
|
/**
|
|
48
52
|
* Removes a cookie.
|
|
@@ -51,7 +55,7 @@ export function setCookie(key, value, customAttributes = {}) {
|
|
|
51
55
|
export function removeCookie(key) {
|
|
52
56
|
if (isEmpty(cookieAttributes))
|
|
53
57
|
setupCookies(DEFAULT_DOMAIN_REGEX);
|
|
54
|
-
document.cookie = `${key}
|
|
58
|
+
document.cookie = `${key}=;${objectToCookieString({ ...cookieAttributes, expires: 'Thu, 01 Jan 1970 00:00:00 GMT' })}`;
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
57
61
|
* Retrieves the value of a cookie given its key/name.
|
|
@@ -61,5 +65,5 @@ export function removeCookie(key) {
|
|
|
61
65
|
export function getCookie(key) {
|
|
62
66
|
return getCookies()[key];
|
|
63
67
|
}
|
|
64
|
-
const objectToCookieString = (object) => Object.entries(object).reduce((prev,
|
|
68
|
+
const objectToCookieString = (object) => Object.entries(object).reduce((prev, [k, v]) => `${prev} ${k}${v !== '' ? `=${v}` : ''};`, '').trim();
|
|
65
69
|
//# sourceMappingURL=cookie.js.map
|
package/dist/utils/cookie.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookie.js","sourceRoot":"","sources":["../../src/utils/cookie.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEhC,MAAM,oBAAoB,GAAG,IAAI,MAAM,CAAC,6CAA6C,CAAC,CAAA;AACtF,IAAI,YAAY,GAAG,EAAE,CAAA;AACrB,IAAI,gBAAgB,GAA2B,EAAE,CAAA;AAEjD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,WAAmB;IAC9C,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACxC,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IAC1D,gBAAgB,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"cookie.js","sourceRoot":"","sources":["../../src/utils/cookie.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEhC,MAAM,oBAAoB,GAAG,IAAI,MAAM,CAAC,6CAA6C,CAAC,CAAA;AACtF,IAAI,YAAY,GAAG,EAAE,CAAA;AACrB,IAAI,gBAAgB,GAA2B,EAAE,CAAA;AAEjD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,WAAmB;IAC9C,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACxC,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IAC1D,gBAAgB,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;IAC/D,sCAAsC;IACtC,I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AG,KAAK,oBAAoB,CAAC,EAAE,GAAG,gBAAgB,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC,EAAE,CAAA;AACxH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,UAAU,EAAE,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AAED,MAAM,oBAAoB,GAAG,CAAC,MAA8B,EAAU,EAAE,CACtE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -130,7 +130,7 @@ export const ErrorFeedback = (
|
|
|
130
130
|
<Logo style={{ width: '130px', height: '30px' }} />
|
|
131
131
|
</LinkBox>
|
|
132
132
|
<Text appearance="h4" mt={5} colorScheme="inverse" className="title">
|
|
133
|
-
{(code && !title) ? `${code}. ` : ''}
|
|
133
|
+
{(code && !title) ? `${t.errorLabel} ${code}. ` : ''}
|
|
134
134
|
<Text appearance="h4" as="span" colorScheme="light.700">
|
|
135
135
|
{title ?? t[`${code}.title`]}
|
|
136
136
|
</Text>
|
|
@@ -174,43 +174,43 @@ export const ErrorFeedback = (
|
|
|
174
174
|
const dictionary = {
|
|
175
175
|
en: {
|
|
176
176
|
altLogo: 'Logo Stackspot',
|
|
177
|
-
'0.title': '
|
|
178
|
-
'0.description': '
|
|
179
|
-
'0.help': '
|
|
180
|
-
'401.title': '
|
|
181
|
-
'401.description': '
|
|
182
|
-
'401.help': 'Check
|
|
183
|
-
'403.title': '
|
|
184
|
-
'403.
|
|
185
|
-
'
|
|
186
|
-
'404.
|
|
187
|
-
'404.
|
|
188
|
-
'
|
|
189
|
-
'500.title': 'Server error',
|
|
177
|
+
'0.title': 'Something didn’t go as expected',
|
|
178
|
+
'0.description': 'This can happen from time to time.',
|
|
179
|
+
'0.help': 'Try refreshing the page. If it still doesn’t work, reach out. We’re here to help.',
|
|
180
|
+
'401.title': 'You need a valid credential',
|
|
181
|
+
'401.description': 'We couldn’t verify your credentials.',
|
|
182
|
+
'401.help': 'Check the link or log in with a different account to continue.',
|
|
183
|
+
'403.title': 'Access restricted to your organization',
|
|
184
|
+
'403.help': 'Log in with an account from your organization or request access from your Account Holder.',
|
|
185
|
+
'404.title': 'This resource is no longer available',
|
|
186
|
+
'404.description': 'It may have been moved or removed.',
|
|
187
|
+
'404.help': 'You can try again or ask your organization’s Account Holder for a new link.',
|
|
188
|
+
'500.title': 'We\'re making some adjustments',
|
|
190
189
|
'500.description':
|
|
191
|
-
|
|
192
|
-
'500.help': '
|
|
190
|
+
'Something unexpected happened on our side. It might just be a momentary glitch.',
|
|
191
|
+
'500.help': 'Try refreshing later to pick up where you left off.',
|
|
193
192
|
showDetails: 'Show Details',
|
|
194
193
|
hideDetails: 'Hide Details',
|
|
194
|
+
errorLabel: 'Error',
|
|
195
195
|
},
|
|
196
196
|
pt: {
|
|
197
197
|
altLogo: 'Logo Stackspot',
|
|
198
|
-
'0.title': '
|
|
199
|
-
'0.description': '
|
|
200
|
-
'0.help': '
|
|
201
|
-
'401.title': '
|
|
202
|
-
'401.description': '
|
|
203
|
-
'401.help': 'Verifique
|
|
204
|
-
'403.title': 'Acesso
|
|
205
|
-
'403.
|
|
206
|
-
'
|
|
207
|
-
'404.
|
|
208
|
-
'404.
|
|
209
|
-
'
|
|
210
|
-
'500.
|
|
211
|
-
'500.
|
|
212
|
-
'500.help': 'Tente novamente após alguns minutos.',
|
|
198
|
+
'0.title': 'Algo saiu diferente do esperado',
|
|
199
|
+
'0.description': 'Isso pode acontecer de vez em quando.',
|
|
200
|
+
'0.help': 'Tente recarregar a página. Se ainda não funcionar, chama a gente. Estamos por aqui para ajudar.',
|
|
201
|
+
'401.title': 'Você precisa de uma credencial válida',
|
|
202
|
+
'401.description': 'Não conseguimos confirmar suas credenciais.',
|
|
203
|
+
'401.help': 'Verifique o link ou faça login com outra conta para continuar.',
|
|
204
|
+
'403.title': 'Acesso exclusivo da sua organização',
|
|
205
|
+
'403.help': 'Faça login com uma conta da sua organização ou peça acesso ao Account Holder.',
|
|
206
|
+
'404.title': 'Este recurso não está mais disponível',
|
|
207
|
+
'404.description': 'Ele pode ter sido movido ou removido.',
|
|
208
|
+
'404.help': 'Você pode tentar de novo ou pedir um novo link ao Account Holder da sua organização.',
|
|
209
|
+
'500.title': 'Estamos ajustando o sistema',
|
|
210
|
+
'500.description': 'Algo inesperado aconteceu do nosso lado. Pode ser só por alguns instantes.',
|
|
211
|
+
'500.help': 'Tente recarregar mais tarde para continuar de onde parou.',
|
|
213
212
|
showDetails: 'Ver Detalhes',
|
|
214
213
|
hideDetails: 'Esconder Detalhes',
|
|
214
|
+
errorLabel: 'Erro',
|
|
215
215
|
},
|
|
216
216
|
} satisfies Dictionary
|
package/src/utils/cookie.ts
CHANGED
|
@@ -12,6 +12,10 @@ export function setupCookies(domainRegex: RegExp) {
|
|
|
12
12
|
const portalUrl = new URL(location.href)
|
|
13
13
|
cookieDomain = domainRegex.exec(portalUrl.host)?.[0] ?? ''
|
|
14
14
|
cookieAttributes = { domain: cookieDomain, SameSite: 'Strict' }
|
|
15
|
+
// Add Secure attribute if using HTTPS
|
|
16
|
+
if (portalUrl.protocol === 'https:') {
|
|
17
|
+
cookieAttributes['Secure'] = ''
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
/**
|
|
@@ -44,7 +48,7 @@ export function getCookies(): Record<string, string | undefined> {
|
|
|
44
48
|
*/
|
|
45
49
|
export function setCookie(key: string, value: string, customAttributes: Record<string, string> = {}) {
|
|
46
50
|
if (isEmpty(cookieAttributes)) setupCookies(DEFAULT_DOMAIN_REGEX)
|
|
47
|
-
document.cookie = `${key}=${value}
|
|
51
|
+
document.cookie = `${key}=${value};${objectToCookieString({ ...cookieAttributes, ...customAttributes })}`
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
/**
|
|
@@ -53,7 +57,7 @@ export function setCookie(key: string, value: string, customAttributes: Record<s
|
|
|
53
57
|
*/
|
|
54
58
|
export function removeCookie(key: string) {
|
|
55
59
|
if (isEmpty(cookieAttributes)) setupCookies(DEFAULT_DOMAIN_REGEX)
|
|
56
|
-
document.cookie = `${key}
|
|
60
|
+
document.cookie = `${key}=;${objectToCookieString({ ...cookieAttributes, expires: 'Thu, 01 Jan 1970 00:00:00 GMT' })}`
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
/**
|
|
@@ -65,4 +69,5 @@ export function getCookie(key: string) {
|
|
|
65
69
|
return getCookies()[key]
|
|
66
70
|
}
|
|
67
71
|
|
|
68
|
-
const objectToCookieString = (object: Record<string, string>): string =>
|
|
72
|
+
const objectToCookieString = (object: Record<string, string>): string =>
|
|
73
|
+
Object.entries(object).reduce((prev, [k, v]) => `${prev} ${k}${v !== '' ? `=${v}` : ''};`, '').trim()
|