-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathsecurity.js
56 lines (47 loc) · 1.33 KB
/
security.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React from 'react';
import * as securityComponentList from '@carbon/ibm-security';
import * as carbonComponentList from '@carbon/react';
import { getSecurityPrefix } from '../../../web-extension/src/globals/prefixSelectors.js';
import { buildReactComponentList } from '../helpers.js';
// can we remove identical components from carbon-react?
const componentList = {};
// filtering out carbon components already being tracked in ./carbon.js
Object.keys(securityComponentList).forEach((key) => {
if (!carbonComponentList[key]) {
componentList[key] = securityComponentList[key];
}
});
const prefix = getSecurityPrefix('');
const mockedProps = {
// pageSizes: [0],
profile: {
name: {
first_name: '',
surname: '',
},
},
items: [],
labels: {
mainNavigation: { ariaLabel: '' },
menu: { button: '' },
},
title: 'asdf',
closeButton: { onClick: () => {} },
primaryButton: { onClick: () => {} },
secondaryButton: { onClick: () => {} },
};
const customComps = [(Comp) => <Comp>{() => ''}</Comp>];
const filterByTheseComponents = []; // compKey/name for debugging
const { _stats, ...components } = buildReactComponentList(
componentList,
prefix,
mockedProps,
customComps,
filterByTheseComponents
);
const security = {
name: 'IBM security',
components,
_stats,
};
export { security };