@capillarytech/creatives-library 6.12.0 → 6.12.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/package.json
CHANGED
|
@@ -3,18 +3,15 @@ import { FormattedMessage } from 'react-intl';
|
|
|
3
3
|
import { CapRow, CapHeading } from '@capillarytech/cap-ui-library';
|
|
4
4
|
import messages from './messages';
|
|
5
5
|
|
|
6
|
-
const AccessForbidden = () =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</CapRow>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
6
|
+
const AccessForbidden = () => (
|
|
7
|
+
<CapRow className="margin-t-32 text-align-center">
|
|
8
|
+
<CapHeading type="h2">
|
|
9
|
+
<FormattedMessage {...messages.forbiddenHeader} />
|
|
10
|
+
</CapHeading>
|
|
11
|
+
<CapHeading type="h3" className="margin-t-24">
|
|
12
|
+
<FormattedMessage {...messages.forbiddenDesc} />
|
|
13
|
+
</CapHeading>
|
|
14
|
+
</CapRow>
|
|
15
|
+
);
|
|
19
16
|
|
|
20
17
|
export default AccessForbidden;
|
|
@@ -217,13 +217,12 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
|
|
|
217
217
|
return this.props.Templates.loadingTemplates;
|
|
218
218
|
}
|
|
219
219
|
render() {
|
|
220
|
-
const { isFullMode, className, authData = {}} = this.props;
|
|
221
|
-
const { accessiblePermissions = []} = authData.user || {};
|
|
220
|
+
const { isFullMode, className, cap = {}, authData = {}} = this.props;
|
|
221
|
+
const { accessiblePermissions = []} = cap.user || authData.user || {};
|
|
222
222
|
let isCreativeAccessible = true;
|
|
223
223
|
if (!accessiblePermissions.includes(CREATIVES_UI_VIEW)) {
|
|
224
224
|
isCreativeAccessible = false;
|
|
225
225
|
}
|
|
226
|
-
|
|
227
226
|
return (
|
|
228
227
|
!isCreativeAccessible ? <AccessForbidden /> : (
|
|
229
228
|
<div className={`${className} creatives-templates-container ${isFullMode ? 'fullmode' : 'library-mode'}`}>
|