@imposium-hub/components 2.6.0-1 → 2.6.0-2
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/dist/cjs/Util.d.ts +1 -1
- package/dist/cjs/Util.js +33 -20
- package/dist/cjs/Util.js.map +1 -1
- package/dist/cjs/components/app-wrapper/AppWrapper.d.ts +3 -1
- package/dist/cjs/components/app-wrapper/AppWrapper.js +8 -2
- package/dist/cjs/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/cjs/components/header/Header.d.ts +1 -0
- package/dist/cjs/components/header/Header.js +1 -3
- package/dist/cjs/components/header/Header.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/redux/actions/access.js +44 -37
- package/dist/cjs/redux/actions/access.js.map +1 -1
- package/dist/cjs/services/API.d.ts +4 -0
- package/dist/cjs/services/API.js.map +1 -1
- package/dist/cjs/utils/pendo.d.ts +2 -24
- package/dist/cjs/utils/pendo.js +4 -27
- package/dist/cjs/utils/pendo.js.map +1 -1
- package/dist/esm/Util.d.ts +1 -1
- package/dist/esm/Util.js +10 -19
- package/dist/esm/Util.js.map +1 -1
- package/dist/esm/components/app-wrapper/AppWrapper.d.ts +3 -1
- package/dist/esm/components/app-wrapper/AppWrapper.js +8 -2
- package/dist/esm/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/esm/components/header/Header.d.ts +1 -0
- package/dist/esm/components/header/Header.js +1 -3
- package/dist/esm/components/header/Header.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/redux/actions/access.js +63 -56
- package/dist/esm/redux/actions/access.js.map +1 -1
- package/dist/esm/services/API.d.ts +4 -0
- package/dist/esm/services/API.js.map +1 -1
- package/dist/esm/utils/pendo.d.ts +2 -24
- package/dist/esm/utils/pendo.js +4 -27
- package/dist/esm/utils/pendo.js.map +1 -1
- package/package.json +8 -7
- package/src/Util.ts +10 -16
- package/src/components/app-wrapper/AppWrapper.tsx +13 -1
- package/src/components/header/Header.tsx +3 -3
- package/src/index.ts +3 -3
- package/src/redux/actions/access.ts +64 -72
- package/src/services/API.ts +4 -0
- package/src/utils/pendo.ts +5 -28
|
@@ -1,33 +1,31 @@
|
|
|
1
|
+
import { getOrgIdFromStory } from '../../Util';
|
|
2
|
+
|
|
1
3
|
export const storyAdded = (storyId: string, storyName: string): any => {
|
|
2
4
|
return (dispatch, getStore) => {
|
|
3
|
-
const {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
name: storyName
|
|
22
|
-
}
|
|
23
|
-
].sort((a, b) => a.name.localeCompare(b.name))
|
|
24
|
-
};
|
|
25
|
-
}
|
|
5
|
+
const { access } = getStore();
|
|
6
|
+
const orgId = getOrgIdFromStory(storyId, access);
|
|
7
|
+
if (orgId) {
|
|
8
|
+
const accessData: any = {
|
|
9
|
+
...access,
|
|
10
|
+
organizations: access.organizations.map((o: any) => {
|
|
11
|
+
if (o.id === orgId) {
|
|
12
|
+
return {
|
|
13
|
+
...o,
|
|
14
|
+
stories: [
|
|
15
|
+
...o.stories,
|
|
16
|
+
{
|
|
17
|
+
id: storyId,
|
|
18
|
+
name: storyName
|
|
19
|
+
}
|
|
20
|
+
].sort((a, b) => a.name.localeCompare(b.name))
|
|
21
|
+
};
|
|
22
|
+
}
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
return o;
|
|
25
|
+
})
|
|
26
|
+
};
|
|
27
|
+
dispatch({ type: actions.STORY_ADDED, accessData });
|
|
28
|
+
}
|
|
31
29
|
};
|
|
32
30
|
};
|
|
33
31
|
|
|
@@ -54,61 +52,55 @@ export const orgNameMutated = (orgId: string, newOrgName: string): any => {
|
|
|
54
52
|
|
|
55
53
|
export const storyNameMutated = (storyId: string, newStoryName: string): any => {
|
|
56
54
|
return (dispatch, getStore) => {
|
|
57
|
-
const {
|
|
58
|
-
access,
|
|
59
|
-
routing: {
|
|
60
|
-
locationBeforeTransitions: { query }
|
|
61
|
-
}
|
|
62
|
-
} = getStore();
|
|
63
|
-
const orgId: string = query.organization_id;
|
|
55
|
+
const { access } = getStore();
|
|
64
56
|
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
57
|
+
const orgId = getOrgIdFromStory(storyId, access);
|
|
58
|
+
if (orgId) {
|
|
59
|
+
const accessData: any = {
|
|
60
|
+
...access,
|
|
61
|
+
organizations: access.organizations.map((o: any) => {
|
|
62
|
+
if (o.id === orgId) {
|
|
63
|
+
return {
|
|
64
|
+
...o,
|
|
65
|
+
stories: o.stories.map((s: any) => {
|
|
66
|
+
if (s.id === storyId) {
|
|
67
|
+
return { ...s, name: newStoryName };
|
|
68
|
+
}
|
|
75
69
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
return s;
|
|
71
|
+
})
|
|
72
|
+
};
|
|
73
|
+
}
|
|
80
74
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
return o;
|
|
76
|
+
})
|
|
77
|
+
};
|
|
78
|
+
dispatch({ type: actions.STORY_NAME_MUTATION, accessData });
|
|
79
|
+
}
|
|
85
80
|
};
|
|
86
81
|
};
|
|
87
82
|
|
|
88
83
|
export const storyDeleted = (storyId: string): any => {
|
|
89
84
|
return (dispatch, getStore) => {
|
|
90
|
-
const {
|
|
91
|
-
access,
|
|
92
|
-
routing: {
|
|
93
|
-
locationBeforeTransitions: { query }
|
|
94
|
-
}
|
|
95
|
-
} = getStore();
|
|
96
|
-
const orgId: string = query.organization_id;
|
|
85
|
+
const { access } = getStore();
|
|
97
86
|
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
87
|
+
const orgId = getOrgIdFromStory(storyId, access);
|
|
88
|
+
if (orgId) {
|
|
89
|
+
const accessData: any = {
|
|
90
|
+
...access,
|
|
91
|
+
organizations: access.organizations.map((o: any) => {
|
|
92
|
+
if (o.id === orgId) {
|
|
93
|
+
return {
|
|
94
|
+
...o,
|
|
95
|
+
stories: o.stories.filter((s: any) => s.id !== storyId)
|
|
96
|
+
};
|
|
97
|
+
}
|
|
107
98
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
99
|
+
return o;
|
|
100
|
+
})
|
|
101
|
+
};
|
|
102
|
+
dispatch({ type: actions.STORY_DELETED, accessData });
|
|
103
|
+
}
|
|
112
104
|
};
|
|
113
105
|
};
|
|
114
106
|
|
package/src/services/API.ts
CHANGED
|
@@ -150,6 +150,10 @@ export interface IImposiumAPI {
|
|
|
150
150
|
cacheActiveStory(serviceId: any, orgId: string, storyId: string);
|
|
151
151
|
getCachedStoryForOrg(serviceId: string, orgId: string);
|
|
152
152
|
getAccessData(includeTotalRenders?: boolean, orgId?: string);
|
|
153
|
+
deleteExperience(experienceId: string, eraseMedia?: boolean);
|
|
154
|
+
exportExperiences(experienceId: string, params: any);
|
|
155
|
+
addOrReplaceNote(experienceId: string, notes: string);
|
|
156
|
+
updateModerationStatus(experienceId: string, status: string, reason?: string);
|
|
153
157
|
}
|
|
154
158
|
|
|
155
159
|
interface ITTSOptions {
|
package/src/utils/pendo.ts
CHANGED
|
@@ -1,31 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
* [initPendo description]
|
|
3
|
-
* This initalizes the Pendo Help system in the application
|
|
4
|
-
* The Pendo script should be added to the DOM in `index.html`
|
|
5
|
-
* This function takes the user object and sets some initial information on Pendo for tracking
|
|
6
|
-
* For full documentation of Pendo object please see Pendo Docs
|
|
7
|
-
*
|
|
8
|
-
* To prevent application breaking things, we wrap both groups in a try/catch
|
|
9
|
-
* This allows our Application to work regardless of the status of Pendo
|
|
10
|
-
* *************************************************************
|
|
11
|
-
* We DO NOT WANT TO BREAK OUR APP if a 3rd party script fails
|
|
12
|
-
* *************************************************************
|
|
13
|
-
*
|
|
14
|
-
* @param {object} userInfo User object from crm/v1/user
|
|
15
|
-
* Each application's `user/` endpoint returns slightly different data
|
|
16
|
-
* The `visitor` object will need to be adjusted based on the data returned
|
|
17
|
-
* We should always have access to:
|
|
18
|
-
* id
|
|
19
|
-
* email
|
|
20
|
-
* full_name
|
|
21
|
-
*
|
|
22
|
-
* @return {undefined} Nothing
|
|
23
|
-
*/
|
|
24
|
-
|
|
1
|
+
import { User } from '@auth0/auth0-react';
|
|
25
2
|
declare const pendo;
|
|
26
3
|
|
|
27
|
-
export const initPendo = (environment, userInfo) => {
|
|
28
|
-
if (
|
|
4
|
+
export const initPendo = (appLabel, environment, userInfo: User) => {
|
|
5
|
+
if (environment !== 'production') {
|
|
29
6
|
console.info(
|
|
30
7
|
'%cPendo%c is %cdisabled%c for local testing',
|
|
31
8
|
'color: #e247e5; font-weight:bold;',
|
|
@@ -39,7 +16,7 @@ export const initPendo = (environment, userInfo) => {
|
|
|
39
16
|
try {
|
|
40
17
|
const visitor = {
|
|
41
18
|
id: userInfo.sub,
|
|
42
|
-
email: userInfo
|
|
19
|
+
email: userInfo.email
|
|
43
20
|
};
|
|
44
21
|
|
|
45
22
|
/* eslint-disable no-undef */
|
|
@@ -47,7 +24,7 @@ export const initPendo = (environment, userInfo) => {
|
|
|
47
24
|
visitor: {
|
|
48
25
|
...visitor,
|
|
49
26
|
environment,
|
|
50
|
-
product:
|
|
27
|
+
product: appLabel,
|
|
51
28
|
language: navigator.language
|
|
52
29
|
}
|
|
53
30
|
});
|