@availity/mui-spaces 0.3.20 → 0.3.22
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 +7 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -2
- package/dist/index.mjs +8 -2
- package/package.json +1 -1
- package/src/lib/Spaces.stories.tsx +0 -1
- package/src/lib/Spaces.test.tsx +7 -11
- package/src/lib/SpacesAgreement.stories.tsx +2 -2
- package/src/lib/SpacesAgreement.test.tsx +2 -2
- package/src/lib/SpacesDisclaimer.stories.tsx +2 -2
- package/src/lib/SpacesDisclaimer.test.tsx +2 -2
- package/src/lib/SpacesGhostText.stories.tsx +1 -1
- package/src/lib/SpacesGhostText.test.tsx +1 -1
- package/src/lib/SpacesImage.stories.tsx +4 -4
- package/src/lib/SpacesImage.test.tsx +1 -1
- package/src/lib/SpacesLink/SpacesLink.test.tsx +14 -28
- package/src/lib/SpacesLink/linkHandlers.tsx +5 -2
- package/src/lib/modals/DisclaimerModal.test.tsx +0 -2
- package/src/lib/modals/MultiPayerModal.test.tsx +2 -2
- package/src/lib/spaces-data.test.tsx +0 -1
- package/src/lib/spaces-data.tsx +6 -1
- package/src/lib/spaces-types.tsx +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.3.22](https://github.com/Availity/element/compare/@availity/mui-spaces@0.3.21...@availity/mui-spaces@0.3.22) (2024-09-24)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `@availity/mock` updated to version `0.3.21`
|
|
10
|
+
## [0.3.21](https://github.com/Availity/element/compare/@availity/mui-spaces@0.3.20...@availity/mui-spaces@0.3.21) (2024-09-24)
|
|
11
|
+
|
|
5
12
|
## [0.3.20](https://github.com/Availity/element/compare/@availity/mui-spaces@0.3.19...@availity/mui-spaces@0.3.20) (2024-09-20)
|
|
6
13
|
|
|
7
14
|
### Dependency Updates
|
package/dist/index.d.mts
CHANGED
|
@@ -187,8 +187,8 @@ type SpacesProps = {
|
|
|
187
187
|
/** Override the default variables used in the thanos query. Default: { types: [PAYERSPACE] }.
|
|
188
188
|
* If the spaces provider should contain configurations of a type other than PAYERSPACE, you must override this prop */
|
|
189
189
|
variables?: object;
|
|
190
|
-
/** The Client ID obtained from APIConnect.
|
|
191
|
-
clientId
|
|
190
|
+
/** The Client ID obtained from APIConnect. */
|
|
191
|
+
clientId?: string;
|
|
192
192
|
/** Children can be a react child or render prop. */
|
|
193
193
|
children?: React.ReactNode | ((props: any | undefined) => React.ReactNode);
|
|
194
194
|
/** Array of payerIds the Spaces provider should fetch the spaces for.
|
package/dist/index.d.ts
CHANGED
|
@@ -187,8 +187,8 @@ type SpacesProps = {
|
|
|
187
187
|
/** Override the default variables used in the thanos query. Default: { types: [PAYERSPACE] }.
|
|
188
188
|
* If the spaces provider should contain configurations of a type other than PAYERSPACE, you must override this prop */
|
|
189
189
|
variables?: object;
|
|
190
|
-
/** The Client ID obtained from APIConnect.
|
|
191
|
-
clientId
|
|
190
|
+
/** The Client ID obtained from APIConnect. */
|
|
191
|
+
clientId?: string;
|
|
192
192
|
/** Children can be a react child or render prop. */
|
|
193
193
|
children?: React.ReactNode | ((props: any | undefined) => React.ReactNode);
|
|
194
194
|
/** Array of payerIds the Spaces provider should fetch the spaces for.
|
package/dist/index.js
CHANGED
|
@@ -119,6 +119,10 @@ var spacesReducer = (state, action) => {
|
|
|
119
119
|
return actions[type](state, action);
|
|
120
120
|
};
|
|
121
121
|
var fetchSpaces = (_0) => __async(void 0, [_0], function* ({ query, clientId, variables }) {
|
|
122
|
+
const headers = {};
|
|
123
|
+
if (clientId) {
|
|
124
|
+
headers["X-Client-ID"] = clientId;
|
|
125
|
+
}
|
|
122
126
|
const {
|
|
123
127
|
data: {
|
|
124
128
|
data: { configurationPagination }
|
|
@@ -128,7 +132,7 @@ var fetchSpaces = (_0) => __async(void 0, [_0], function* ({ query, clientId, va
|
|
|
128
132
|
query,
|
|
129
133
|
variables: __spreadValues({}, variables)
|
|
130
134
|
},
|
|
131
|
-
{ headers: {
|
|
135
|
+
{ headers: __spreadValues({}, headers) }
|
|
132
136
|
);
|
|
133
137
|
const {
|
|
134
138
|
pageInfo: { currentPage, hasNextPage },
|
|
@@ -788,10 +792,12 @@ var openLinkWithSso = (_0, _1) => __async(void 0, [_0, _1], function* (space, {
|
|
|
788
792
|
if (space.meta && space.meta.ssoId) {
|
|
789
793
|
const options = ((_a = space.link) == null ? void 0 : _a.target) ? { target: getTarget(space.link.target) } : void 0;
|
|
790
794
|
const attributes = __spreadValues({
|
|
791
|
-
X_Client_ID: clientId,
|
|
792
795
|
X_XSRF_TOKEN: document.cookie.replace(/(?:(?:^|.*;\s*)XSRF-TOKEN\s*=\s*([^;]*).*$)|^.*$/, "$1"),
|
|
793
796
|
spaceId: payerSpaceId
|
|
794
797
|
}, ssoParams);
|
|
798
|
+
if (clientId) {
|
|
799
|
+
attributes.X_Client_ID = clientId;
|
|
800
|
+
}
|
|
795
801
|
try {
|
|
796
802
|
if (akaname)
|
|
797
803
|
yield updateTopApps(space, akaname);
|
package/dist/index.mjs
CHANGED
|
@@ -77,6 +77,10 @@ var spacesReducer = (state, action) => {
|
|
|
77
77
|
return actions[type](state, action);
|
|
78
78
|
};
|
|
79
79
|
var fetchSpaces = (_0) => __async(void 0, [_0], function* ({ query, clientId, variables }) {
|
|
80
|
+
const headers = {};
|
|
81
|
+
if (clientId) {
|
|
82
|
+
headers["X-Client-ID"] = clientId;
|
|
83
|
+
}
|
|
80
84
|
const {
|
|
81
85
|
data: {
|
|
82
86
|
data: { configurationPagination }
|
|
@@ -86,7 +90,7 @@ var fetchSpaces = (_0) => __async(void 0, [_0], function* ({ query, clientId, va
|
|
|
86
90
|
query,
|
|
87
91
|
variables: __spreadValues({}, variables)
|
|
88
92
|
},
|
|
89
|
-
{ headers: {
|
|
93
|
+
{ headers: __spreadValues({}, headers) }
|
|
90
94
|
);
|
|
91
95
|
const {
|
|
92
96
|
pageInfo: { currentPage, hasNextPage },
|
|
@@ -746,10 +750,12 @@ var openLinkWithSso = (_0, _1) => __async(void 0, [_0, _1], function* (space, {
|
|
|
746
750
|
if (space.meta && space.meta.ssoId) {
|
|
747
751
|
const options = ((_a = space.link) == null ? void 0 : _a.target) ? { target: getTarget(space.link.target) } : void 0;
|
|
748
752
|
const attributes = __spreadValues({
|
|
749
|
-
X_Client_ID: clientId,
|
|
750
753
|
X_XSRF_TOKEN: document.cookie.replace(/(?:(?:^|.*;\s*)XSRF-TOKEN\s*=\s*([^;]*).*$)|^.*$/, "$1"),
|
|
751
754
|
spaceId: payerSpaceId
|
|
752
755
|
}, ssoParams);
|
|
756
|
+
if (clientId) {
|
|
757
|
+
attributes.X_Client_ID = clientId;
|
|
758
|
+
}
|
|
753
759
|
try {
|
|
754
760
|
if (akaname)
|
|
755
761
|
yield updateTopApps(space, akaname);
|
package/package.json
CHANGED
package/src/lib/Spaces.test.tsx
CHANGED
|
@@ -43,11 +43,7 @@ describe('Spaces', () => {
|
|
|
43
43
|
const [spaceIds, setSpaceIds] = useState(['1', '3']);
|
|
44
44
|
return (
|
|
45
45
|
<QueryClientProvider client={queryClient}>
|
|
46
|
-
<Spaces
|
|
47
|
-
spaceIds={spaceIds}
|
|
48
|
-
spaces={[{ id: '3', configurationId: '3', type: 'space', name: 'Space 3' }]}
|
|
49
|
-
clientId="my-client-id"
|
|
50
|
-
>
|
|
46
|
+
<Spaces spaceIds={spaceIds} spaces={[{ id: '3', configurationId: '3', type: 'space', name: 'Space 3' }]}>
|
|
51
47
|
<SpaceComponent spaceId="1" />
|
|
52
48
|
<SpaceComponent spaceId="2" />
|
|
53
49
|
<SpaceComponent spaceId="3" />
|
|
@@ -109,7 +105,7 @@ it('toggles whether the spaces provider is loading', async () => {
|
|
|
109
105
|
|
|
110
106
|
return (
|
|
111
107
|
<QueryClientProvider client={queryClient}>
|
|
112
|
-
<Spaces spaceIds={spaceId}
|
|
108
|
+
<Spaces spaceIds={spaceId}>
|
|
113
109
|
<SpaceComponent spaceId={spaceId[0]} />
|
|
114
110
|
|
|
115
111
|
<button type="button" id="add-spaceid-btn" onClick={() => setSpaceId(['2'])}>
|
|
@@ -152,7 +148,7 @@ describe('useSpaces', () => {
|
|
|
152
148
|
const queryClient = new QueryClient();
|
|
153
149
|
const { container } = render(
|
|
154
150
|
<QueryClientProvider client={queryClient}>
|
|
155
|
-
<Spaces spaceIds={['1', '2', '3']}
|
|
151
|
+
<Spaces spaceIds={['1', '2', '3']}>
|
|
156
152
|
<SpacesComponent />
|
|
157
153
|
<SpacesComponent ids={['2', '3']} />
|
|
158
154
|
</Spaces>
|
|
@@ -172,7 +168,7 @@ describe('useSpaces', () => {
|
|
|
172
168
|
const queryClient = new QueryClient();
|
|
173
169
|
const { getByText } = render(
|
|
174
170
|
<QueryClientProvider client={queryClient}>
|
|
175
|
-
<Spaces spaceIds={['11', '22', '33']}
|
|
171
|
+
<Spaces spaceIds={['11', '22', '33']}>
|
|
176
172
|
<SpacesComponent />
|
|
177
173
|
<SpacesComponent ids={['22', '33']} />
|
|
178
174
|
</Spaces>
|
|
@@ -190,7 +186,7 @@ describe('useSpaces', () => {
|
|
|
190
186
|
const queryClient = new QueryClient();
|
|
191
187
|
const { getByText } = render(
|
|
192
188
|
<QueryClientProvider client={queryClient}>
|
|
193
|
-
<Spaces payerIds={['a', 'b', 'c']}
|
|
189
|
+
<Spaces payerIds={['a', 'b', 'c']}>
|
|
194
190
|
<SpacesComponent ids={['b']} />
|
|
195
191
|
<SpacesComponent ids={['c']} />
|
|
196
192
|
</Spaces>
|
|
@@ -220,7 +216,7 @@ describe('useSpaces', () => {
|
|
|
220
216
|
|
|
221
217
|
const { container } = render(
|
|
222
218
|
<QueryClientProvider client={queryClient}>
|
|
223
|
-
<Spaces spaceIds={['1', '2']}
|
|
219
|
+
<Spaces spaceIds={['1', '2']}>
|
|
224
220
|
<SpacesComponent />
|
|
225
221
|
</Spaces>
|
|
226
222
|
</QueryClientProvider>
|
|
@@ -251,7 +247,7 @@ it('returns first payer space with when no spaceId passed', async () => {
|
|
|
251
247
|
|
|
252
248
|
const { container, getByText } = render(
|
|
253
249
|
<QueryClientProvider client={queryClient}>
|
|
254
|
-
<Spaces spaceIds={['1']}
|
|
250
|
+
<Spaces spaceIds={['1']}>
|
|
255
251
|
<SpaceComponent />
|
|
256
252
|
</Spaces>
|
|
257
253
|
</QueryClientProvider>
|
|
@@ -24,7 +24,7 @@ const queryClient = new QueryClient();
|
|
|
24
24
|
export const _SpacesAgreement: StoryObj<typeof SpacesAgreement> = {
|
|
25
25
|
render: (args: SpacesAgreementProps) => (
|
|
26
26
|
<QueryClientProvider client={queryClient}>
|
|
27
|
-
<Spaces
|
|
27
|
+
<Spaces spaceIds={['agreement']}>
|
|
28
28
|
<SpacesAgreement {...args} />
|
|
29
29
|
</Spaces>
|
|
30
30
|
</QueryClientProvider>
|
|
@@ -37,7 +37,7 @@ export const _SpacesAgreement: StoryObj<typeof SpacesAgreement> = {
|
|
|
37
37
|
export const _SpacesAgreementMarkdown: StoryObj<typeof SpacesAgreement> = {
|
|
38
38
|
render: (args: SpacesAgreementProps) => (
|
|
39
39
|
<QueryClientProvider client={queryClient}>
|
|
40
|
-
<Spaces
|
|
40
|
+
<Spaces spaceIds={['agreementMarkdown']}>
|
|
41
41
|
<SpacesAgreement {...args} />
|
|
42
42
|
</Spaces>
|
|
43
43
|
</QueryClientProvider>
|
|
@@ -22,7 +22,7 @@ describe('SpacesAgreement', () => {
|
|
|
22
22
|
|
|
23
23
|
const { getByText } = render(
|
|
24
24
|
<QueryClientProvider client={queryClient}>
|
|
25
|
-
<Spaces spaceIds={['agreement']}
|
|
25
|
+
<Spaces spaceIds={['agreement']}>
|
|
26
26
|
<SpacesAgreement spaceId="agreement" />
|
|
27
27
|
</Spaces>
|
|
28
28
|
</QueryClientProvider>
|
|
@@ -39,7 +39,7 @@ describe('SpacesAgreement', () => {
|
|
|
39
39
|
|
|
40
40
|
const { getByText } = render(
|
|
41
41
|
<QueryClientProvider client={queryClient}>
|
|
42
|
-
<Spaces spaceIds={['agreementMarkdown']}
|
|
42
|
+
<Spaces spaceIds={['agreementMarkdown']}>
|
|
43
43
|
<SpacesAgreement spaceId="agreementMarkdown" markdown />
|
|
44
44
|
</Spaces>
|
|
45
45
|
</QueryClientProvider>
|
|
@@ -24,7 +24,7 @@ const queryClient = new QueryClient();
|
|
|
24
24
|
export const _SpacesDisclaimer: StoryObj<typeof SpacesDisclaimer> = {
|
|
25
25
|
render: (args: SpacesDisclaimerProps) => (
|
|
26
26
|
<QueryClientProvider client={queryClient}>
|
|
27
|
-
<Spaces
|
|
27
|
+
<Spaces spaceIds={['disclaimer']}>
|
|
28
28
|
<SpacesDisclaimer {...args} />
|
|
29
29
|
</Spaces>
|
|
30
30
|
</QueryClientProvider>
|
|
@@ -37,7 +37,7 @@ export const _SpacesDisclaimer: StoryObj<typeof SpacesDisclaimer> = {
|
|
|
37
37
|
export const _SpacesDisclaimerMarkdown: StoryObj<typeof SpacesDisclaimer> = {
|
|
38
38
|
render: (args: SpacesDisclaimerProps) => (
|
|
39
39
|
<QueryClientProvider client={queryClient}>
|
|
40
|
-
<Spaces
|
|
40
|
+
<Spaces spaceIds={['disclaimerMarkdown']}>
|
|
41
41
|
<SpacesDisclaimer {...args} />
|
|
42
42
|
</Spaces>
|
|
43
43
|
</QueryClientProvider>
|
|
@@ -22,7 +22,7 @@ describe('SpacesDisclaimer', () => {
|
|
|
22
22
|
|
|
23
23
|
const { getByText } = render(
|
|
24
24
|
<QueryClientProvider client={queryClient}>
|
|
25
|
-
<Spaces spaceIds={['disclaimer']}
|
|
25
|
+
<Spaces spaceIds={['disclaimer']}>
|
|
26
26
|
<SpacesDisclaimer spaceId="disclaimer" />
|
|
27
27
|
</Spaces>
|
|
28
28
|
</QueryClientProvider>
|
|
@@ -39,7 +39,7 @@ describe('SpacesDisclaimer', () => {
|
|
|
39
39
|
|
|
40
40
|
const { getByText } = render(
|
|
41
41
|
<QueryClientProvider client={queryClient}>
|
|
42
|
-
<Spaces spaceIds={['disclaimerMarkdown']}
|
|
42
|
+
<Spaces spaceIds={['disclaimerMarkdown']}>
|
|
43
43
|
<SpacesDisclaimer spaceId="disclaimerMarkdown" markdown />
|
|
44
44
|
</Spaces>
|
|
45
45
|
</QueryClientProvider>
|
|
@@ -24,7 +24,7 @@ const queryClient = new QueryClient();
|
|
|
24
24
|
export const _SpacesGhostText: StoryObj<typeof SpacesGhostText> = {
|
|
25
25
|
render: (args: SpacesGhostTextProps) => (
|
|
26
26
|
<QueryClientProvider client={queryClient}>
|
|
27
|
-
<Spaces
|
|
27
|
+
<Spaces spaceIds={['ghosted']}>
|
|
28
28
|
<SpacesGhostText {...args} />
|
|
29
29
|
</Spaces>
|
|
30
30
|
</QueryClientProvider>
|
|
@@ -22,7 +22,7 @@ describe('SpacesGhostText', () => {
|
|
|
22
22
|
|
|
23
23
|
const { getByText } = render(
|
|
24
24
|
<QueryClientProvider client={queryClient}>
|
|
25
|
-
<Spaces spaceIds={['ghosted']}
|
|
25
|
+
<Spaces spaceIds={['ghosted']}>
|
|
26
26
|
<SpacesGhostText spaceId="ghosted" />
|
|
27
27
|
</Spaces>
|
|
28
28
|
</QueryClientProvider>
|
|
@@ -24,7 +24,7 @@ const queryClient = new QueryClient();
|
|
|
24
24
|
export const _SpacesImage: StoryObj<typeof SpacesImage> = {
|
|
25
25
|
render: (args: SpacesImageProps) => (
|
|
26
26
|
<QueryClientProvider client={queryClient}>
|
|
27
|
-
<Spaces
|
|
27
|
+
<Spaces spaceIds={['11', '22', '33']}>
|
|
28
28
|
<SpacesImage {...args} />
|
|
29
29
|
</Spaces>
|
|
30
30
|
</QueryClientProvider>
|
|
@@ -37,7 +37,7 @@ export const _SpacesImage: StoryObj<typeof SpacesImage> = {
|
|
|
37
37
|
export const _SpacesLogo: StoryObj<typeof SpacesImage> = {
|
|
38
38
|
render: (args: SpacesImageProps) => (
|
|
39
39
|
<QueryClientProvider client={queryClient}>
|
|
40
|
-
<Spaces
|
|
40
|
+
<Spaces spaceIds={['11', '22', '33']}>
|
|
41
41
|
<SpacesImage {...args} />
|
|
42
42
|
</Spaces>
|
|
43
43
|
</QueryClientProvider>
|
|
@@ -51,7 +51,7 @@ export const _SpacesLogo: StoryObj<typeof SpacesImage> = {
|
|
|
51
51
|
export const _SpacesTile: StoryObj<typeof SpacesImage> = {
|
|
52
52
|
render: (args: SpacesImageProps) => (
|
|
53
53
|
<QueryClientProvider client={queryClient}>
|
|
54
|
-
<Spaces
|
|
54
|
+
<Spaces spaceIds={['11', '22', '33']}>
|
|
55
55
|
<SpacesImage {...args} />
|
|
56
56
|
</Spaces>
|
|
57
57
|
</QueryClientProvider>
|
|
@@ -65,7 +65,7 @@ export const _SpacesTile: StoryObj<typeof SpacesImage> = {
|
|
|
65
65
|
export const _SpacesBillboard: StoryObj<typeof SpacesImage> = {
|
|
66
66
|
render: (args: SpacesImageProps) => (
|
|
67
67
|
<QueryClientProvider client={queryClient}>
|
|
68
|
-
<Spaces
|
|
68
|
+
<Spaces spaceIds={['11', '22', '33']}>
|
|
69
69
|
<SpacesImage {...args} />
|
|
70
70
|
</Spaces>
|
|
71
71
|
</QueryClientProvider>
|
|
@@ -30,7 +30,7 @@ describe('SpacesImage', () => {
|
|
|
30
30
|
|
|
31
31
|
const { getByRole } = render(
|
|
32
32
|
<QueryClientProvider client={queryClient}>
|
|
33
|
-
<Spaces spaceIds={['11', '22', '33']}
|
|
33
|
+
<Spaces spaceIds={['11', '22', '33']}>
|
|
34
34
|
<SpacesImage spaceId="33" />
|
|
35
35
|
</Spaces>
|
|
36
36
|
</QueryClientProvider>
|
|
@@ -27,7 +27,7 @@ describe('SpacesLink', () => {
|
|
|
27
27
|
const queryClient = new QueryClient();
|
|
28
28
|
const { container } = render(
|
|
29
29
|
<QueryClientProvider client={queryClient}>
|
|
30
|
-
<Spaces
|
|
30
|
+
<Spaces spaces={[space]}>
|
|
31
31
|
<SpacesLink
|
|
32
32
|
id="application-link-1"
|
|
33
33
|
titleTag="h5"
|
|
@@ -35,7 +35,6 @@ describe('SpacesLink', () => {
|
|
|
35
35
|
linkAttributes={{
|
|
36
36
|
spaceId: '1',
|
|
37
37
|
}}
|
|
38
|
-
clientId="my-client-id"
|
|
39
38
|
variant="card"
|
|
40
39
|
title={space.link.text}
|
|
41
40
|
description
|
|
@@ -80,7 +79,7 @@ describe('SpacesLink', () => {
|
|
|
80
79
|
const queryClient = new QueryClient();
|
|
81
80
|
const { container } = render(
|
|
82
81
|
<QueryClientProvider client={queryClient}>
|
|
83
|
-
<Spaces
|
|
82
|
+
<Spaces spaces={[space]}>
|
|
84
83
|
<SpacesLink
|
|
85
84
|
id="application-link-2"
|
|
86
85
|
titleTag="h5"
|
|
@@ -89,7 +88,6 @@ describe('SpacesLink', () => {
|
|
|
89
88
|
linkAttributes={{
|
|
90
89
|
spaceId: '2',
|
|
91
90
|
}}
|
|
92
|
-
clientId="my-client-id"
|
|
93
91
|
title={space.link.text}
|
|
94
92
|
/>
|
|
95
93
|
</Spaces>
|
|
@@ -117,14 +115,13 @@ describe('SpacesLink', () => {
|
|
|
117
115
|
const queryClient = new QueryClient();
|
|
118
116
|
const { container } = render(
|
|
119
117
|
<QueryClientProvider client={queryClient}>
|
|
120
|
-
<Spaces
|
|
118
|
+
<Spaces spaces={[space]}>
|
|
121
119
|
<SpacesLink
|
|
122
120
|
id="application-link-3"
|
|
123
121
|
space={space}
|
|
124
122
|
linkAttributes={{
|
|
125
123
|
spaceId: '3',
|
|
126
124
|
}}
|
|
127
|
-
clientId="my-client-id"
|
|
128
125
|
title={space.link.text}
|
|
129
126
|
/>
|
|
130
127
|
</Spaces>
|
|
@@ -152,7 +149,7 @@ describe('SpacesLink', () => {
|
|
|
152
149
|
const queryClient = new QueryClient();
|
|
153
150
|
const { container } = render(
|
|
154
151
|
<QueryClientProvider client={queryClient}>
|
|
155
|
-
<Spaces
|
|
152
|
+
<Spaces spaces={[space]}>
|
|
156
153
|
<SpacesLink
|
|
157
154
|
id="application-link-3"
|
|
158
155
|
titleClassName="custom_class"
|
|
@@ -160,7 +157,6 @@ describe('SpacesLink', () => {
|
|
|
160
157
|
linkAttributes={{
|
|
161
158
|
spaceId: '3',
|
|
162
159
|
}}
|
|
163
|
-
clientId="my-client-id"
|
|
164
160
|
title={space.link.text}
|
|
165
161
|
/>
|
|
166
162
|
</Spaces>
|
|
@@ -189,14 +185,13 @@ describe('SpacesLink', () => {
|
|
|
189
185
|
const queryClient = new QueryClient();
|
|
190
186
|
const { container } = render(
|
|
191
187
|
<QueryClientProvider client={queryClient}>
|
|
192
|
-
<Spaces
|
|
188
|
+
<Spaces spaces={[space]}>
|
|
193
189
|
<SpacesLink
|
|
194
190
|
id="navigation-link-7"
|
|
195
191
|
space={space}
|
|
196
192
|
linkAttributes={{
|
|
197
193
|
spaceId: '7',
|
|
198
194
|
}}
|
|
199
|
-
clientId="my-client-id"
|
|
200
195
|
title={space.link.text}
|
|
201
196
|
showNew
|
|
202
197
|
/>
|
|
@@ -227,14 +222,13 @@ describe('SpacesLink', () => {
|
|
|
227
222
|
const queryClient = new QueryClient();
|
|
228
223
|
const { container } = render(
|
|
229
224
|
<QueryClientProvider client={queryClient}>
|
|
230
|
-
<Spaces
|
|
225
|
+
<Spaces spaces={[space]}>
|
|
231
226
|
<SpacesLink
|
|
232
227
|
id="navigation-link-8"
|
|
233
228
|
space={space}
|
|
234
229
|
linkAttributes={{
|
|
235
230
|
spaceId: '8',
|
|
236
231
|
}}
|
|
237
|
-
clientId="my-client-id"
|
|
238
232
|
title={space.link.text}
|
|
239
233
|
showDate
|
|
240
234
|
/>
|
|
@@ -265,14 +259,13 @@ describe('SpacesLink', () => {
|
|
|
265
259
|
const queryClient = new QueryClient();
|
|
266
260
|
const { container } = render(
|
|
267
261
|
<QueryClientProvider client={queryClient}>
|
|
268
|
-
<Spaces
|
|
262
|
+
<Spaces spaces={[space]}>
|
|
269
263
|
<SpacesLink
|
|
270
264
|
id="navigation-link-9"
|
|
271
265
|
space={space}
|
|
272
266
|
linkAttributes={{
|
|
273
267
|
spaceId: '9',
|
|
274
268
|
}}
|
|
275
|
-
clientId="my-client-id"
|
|
276
269
|
title={space.link.text}
|
|
277
270
|
analytics={{
|
|
278
271
|
'data-av-analytics-application-id': space.configurationId,
|
|
@@ -314,14 +307,13 @@ describe('SpacesLink', () => {
|
|
|
314
307
|
const queryClient = new QueryClient();
|
|
315
308
|
const { container } = render(
|
|
316
309
|
<QueryClientProvider client={queryClient}>
|
|
317
|
-
<Spaces
|
|
310
|
+
<Spaces spaces={[space]}>
|
|
318
311
|
<SpacesLink
|
|
319
312
|
id="navigation-link-10"
|
|
320
313
|
space={space}
|
|
321
314
|
linkAttributes={{
|
|
322
315
|
spaceId: '10',
|
|
323
316
|
}}
|
|
324
|
-
clientId="my-client-id"
|
|
325
317
|
title={space.link.text}
|
|
326
318
|
>
|
|
327
319
|
{children}
|
|
@@ -352,7 +344,7 @@ describe('SpacesLink', () => {
|
|
|
352
344
|
const queryClient = new QueryClient();
|
|
353
345
|
const { container } = render(
|
|
354
346
|
<QueryClientProvider client={queryClient}>
|
|
355
|
-
<Spaces
|
|
347
|
+
<Spaces spaces={[space]}>
|
|
356
348
|
<SpacesLink
|
|
357
349
|
id="application-link-11"
|
|
358
350
|
space={space}
|
|
@@ -360,7 +352,6 @@ describe('SpacesLink', () => {
|
|
|
360
352
|
spaceId: '11',
|
|
361
353
|
}}
|
|
362
354
|
role="listitem"
|
|
363
|
-
clientId="my-client-id"
|
|
364
355
|
title={space.link.text}
|
|
365
356
|
/>
|
|
366
357
|
</Spaces>
|
|
@@ -387,7 +378,7 @@ describe('SpacesLink', () => {
|
|
|
387
378
|
const queryClient = new QueryClient();
|
|
388
379
|
const { container } = render(
|
|
389
380
|
<QueryClientProvider client={queryClient}>
|
|
390
|
-
<Spaces
|
|
381
|
+
<Spaces spaces={[space]}>
|
|
391
382
|
<SpacesLink
|
|
392
383
|
id="application-link-12"
|
|
393
384
|
space={space}
|
|
@@ -395,7 +386,6 @@ describe('SpacesLink', () => {
|
|
|
395
386
|
spaceId: '12',
|
|
396
387
|
}}
|
|
397
388
|
role="listitem"
|
|
398
|
-
clientId="my-client-id"
|
|
399
389
|
title={space.link.text}
|
|
400
390
|
/>
|
|
401
391
|
</Spaces>
|
|
@@ -424,7 +414,7 @@ describe('SpacesLink', () => {
|
|
|
424
414
|
const queryClient = new QueryClient();
|
|
425
415
|
const { container } = render(
|
|
426
416
|
<QueryClientProvider client={queryClient}>
|
|
427
|
-
<Spaces
|
|
417
|
+
<Spaces spaces={[space]}>
|
|
428
418
|
<SpacesLink
|
|
429
419
|
id="application-link-13"
|
|
430
420
|
space={space}
|
|
@@ -432,7 +422,6 @@ describe('SpacesLink', () => {
|
|
|
432
422
|
spaceId: '13',
|
|
433
423
|
}}
|
|
434
424
|
role="listitem"
|
|
435
|
-
clientId="my-client-id"
|
|
436
425
|
title={space.link.text}
|
|
437
426
|
/>
|
|
438
427
|
</Spaces>
|
|
@@ -461,7 +450,7 @@ describe('SpacesLink', () => {
|
|
|
461
450
|
const queryClient = new QueryClient();
|
|
462
451
|
const { container } = render(
|
|
463
452
|
<QueryClientProvider client={queryClient}>
|
|
464
|
-
<Spaces
|
|
453
|
+
<Spaces spaces={[space]}>
|
|
465
454
|
<SpacesLink
|
|
466
455
|
id="application-link-14"
|
|
467
456
|
space={space}
|
|
@@ -469,7 +458,6 @@ describe('SpacesLink', () => {
|
|
|
469
458
|
spaceId: '14',
|
|
470
459
|
}}
|
|
471
460
|
role="listitem"
|
|
472
|
-
clientId="my-client-id"
|
|
473
461
|
title={space.link.text}
|
|
474
462
|
/>
|
|
475
463
|
</Spaces>
|
|
@@ -497,7 +485,7 @@ describe('SpacesLink', () => {
|
|
|
497
485
|
const queryClient = new QueryClient();
|
|
498
486
|
const { container } = render(
|
|
499
487
|
<QueryClientProvider client={queryClient}>
|
|
500
|
-
<Spaces
|
|
488
|
+
<Spaces spaces={[space]}>
|
|
501
489
|
<SpacesLink
|
|
502
490
|
id="application-link-14"
|
|
503
491
|
space={space}
|
|
@@ -505,7 +493,6 @@ describe('SpacesLink', () => {
|
|
|
505
493
|
spaceId: '14',
|
|
506
494
|
}}
|
|
507
495
|
role="listitem"
|
|
508
|
-
clientId="my-client-id"
|
|
509
496
|
title={space.link.text}
|
|
510
497
|
/>
|
|
511
498
|
</Spaces>
|
|
@@ -535,7 +522,7 @@ describe('SpacesLink', () => {
|
|
|
535
522
|
const queryClient = new QueryClient();
|
|
536
523
|
const { container } = render(
|
|
537
524
|
<QueryClientProvider client={queryClient}>
|
|
538
|
-
<Spaces
|
|
525
|
+
<Spaces spaces={[space]}>
|
|
539
526
|
<SpacesLink
|
|
540
527
|
id="application-link-14"
|
|
541
528
|
icon={FileIcon}
|
|
@@ -544,7 +531,6 @@ describe('SpacesLink', () => {
|
|
|
544
531
|
spaceId: '14',
|
|
545
532
|
}}
|
|
546
533
|
role="listitem"
|
|
547
|
-
clientId="my-client-id"
|
|
548
534
|
title={space.link.text}
|
|
549
535
|
/>
|
|
550
536
|
</Spaces>
|
|
@@ -24,13 +24,16 @@ export const openLinkWithSso: OpenLinkWithSso = async (space, { akaname, clientI
|
|
|
24
24
|
if (space.meta && space.meta.ssoId) {
|
|
25
25
|
const options = space.link?.target ? { target: getTarget(space.link.target) } : undefined;
|
|
26
26
|
|
|
27
|
-
const attributes = {
|
|
28
|
-
X_Client_ID: clientId,
|
|
27
|
+
const attributes: Record<string, string> = {
|
|
29
28
|
X_XSRF_TOKEN: document.cookie.replace(/(?:(?:^|.*;\s*)XSRF-TOKEN\s*=\s*([^;]*).*$)|^.*$/, '$1'),
|
|
30
29
|
spaceId: payerSpaceId,
|
|
31
30
|
...ssoParams,
|
|
32
31
|
};
|
|
33
32
|
|
|
33
|
+
if (clientId) {
|
|
34
|
+
attributes.X_Client_ID = clientId;
|
|
35
|
+
}
|
|
36
|
+
|
|
34
37
|
try {
|
|
35
38
|
if (akaname) await updateTopApps(space, akaname);
|
|
36
39
|
await nativeForm(space.meta.ssoId, attributes, options, space.type);
|
|
@@ -39,8 +39,8 @@ const MultiPayerModal = () => {
|
|
|
39
39
|
const queryClient = new QueryClient();
|
|
40
40
|
return (
|
|
41
41
|
<QueryClientProvider client={queryClient}>
|
|
42
|
-
<Spaces spaces={[space, parentSpace2, parentSpace3]}
|
|
43
|
-
<SpacesLink spaceId="multipayermodal"
|
|
42
|
+
<Spaces spaces={[space, parentSpace2, parentSpace3]}>
|
|
43
|
+
<SpacesLink spaceId="multipayermodal" />
|
|
44
44
|
</Spaces>
|
|
45
45
|
</QueryClientProvider>
|
|
46
46
|
);
|
package/src/lib/spaces-data.tsx
CHANGED
|
@@ -29,6 +29,11 @@ export const spacesReducer = (state: SpacesContextType, action: SpacesReducerAct
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export const fetchSpaces = async ({ query, clientId, variables }: FetchSpacesProps) => {
|
|
32
|
+
const headers: Record<string, string> = {};
|
|
33
|
+
|
|
34
|
+
if (clientId) {
|
|
35
|
+
headers['X-Client-ID'] = clientId;
|
|
36
|
+
}
|
|
32
37
|
// eslint-disable-next-line no-useless-catch
|
|
33
38
|
const {
|
|
34
39
|
data: {
|
|
@@ -39,7 +44,7 @@ export const fetchSpaces = async ({ query, clientId, variables }: FetchSpacesPro
|
|
|
39
44
|
query,
|
|
40
45
|
variables: { ...variables },
|
|
41
46
|
},
|
|
42
|
-
{ headers: {
|
|
47
|
+
{ headers: { ...headers } }
|
|
43
48
|
);
|
|
44
49
|
|
|
45
50
|
const {
|
package/src/lib/spaces-types.tsx
CHANGED
|
@@ -62,8 +62,8 @@ export type Space = {
|
|
|
62
62
|
export type FetchSpacesProps = {
|
|
63
63
|
/** The query sent to the avWebQL endpoint. */
|
|
64
64
|
query: string;
|
|
65
|
-
/** The Client ID obtained from APIConnect.
|
|
66
|
-
clientId
|
|
65
|
+
/** The Client ID obtained from APIConnect. */
|
|
66
|
+
clientId?: string;
|
|
67
67
|
/** The variables sent to the avWebQL endpoint. */
|
|
68
68
|
variables?: object;
|
|
69
69
|
/** The page sent to the avWebQL endpoint. */
|
|
@@ -73,8 +73,8 @@ export type FetchSpacesProps = {
|
|
|
73
73
|
export type FetchAllSpacesProps = {
|
|
74
74
|
/** The query sent to the avWebQL endpoint. */
|
|
75
75
|
query: string;
|
|
76
|
-
/** The Client ID obtained from APIConnect.
|
|
77
|
-
clientId
|
|
76
|
+
/** The Client ID obtained from APIConnect. */
|
|
77
|
+
clientId?: string;
|
|
78
78
|
/** The variables sent to the avWebQL endpoint. */
|
|
79
79
|
variables?: Record<string, any>;
|
|
80
80
|
/** Array of spaces to be passed into the Spaces provider. */
|
|
@@ -118,8 +118,8 @@ export type SpacesProps = {
|
|
|
118
118
|
/** Override the default variables used in the thanos query. Default: { types: [PAYERSPACE] }.
|
|
119
119
|
* If the spaces provider should contain configurations of a type other than PAYERSPACE, you must override this prop */
|
|
120
120
|
variables?: object;
|
|
121
|
-
/** The Client ID obtained from APIConnect.
|
|
122
|
-
clientId
|
|
121
|
+
/** The Client ID obtained from APIConnect. */
|
|
122
|
+
clientId?: string;
|
|
123
123
|
/** Children can be a react child or render prop. */
|
|
124
124
|
children?: React.ReactNode | ((props: any | undefined) => React.ReactNode);
|
|
125
125
|
/** Array of payerIds the Spaces provider should fetch the spaces for.
|