Skip to content

Commit 29bafa8

Browse files
committed
add validations and components
1 parent 05c3d20 commit 29bafa8

File tree

10 files changed

+58
-3
lines changed

10 files changed

+58
-3
lines changed

lib/schemas/browse/modules/componentNames.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ module.exports = {
2626
multiValueWrapper: 'MultiValueWrapper',
2727
asyncUserChip: 'AsyncUserChip',
2828
countDown: 'CountDown',
29-
location: 'Location'
29+
location: 'Location',
30+
copyToClipBoardButton: 'CopyToClipboardButton'
3031
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
const { makeComponent } = require('../../../utils');
4+
const { copyToClipBoardButton } = require('../componentNames');
5+
6+
module.exports = makeComponent({
7+
name: copyToClipBoardButton,
8+
properties: {}
9+
});

lib/schemas/browse/modules/components/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const asyncWrapper = require('./asyncWrapper');
1515
const multiValueWrapper = require('./multiValueWrapper');
1616
const asyncUserChip = require('./asyncUserChip');
1717
const countDown = require('./countDown');
18+
const copyToClipboardButton = require('./copyToClipboardButton');
1819

1920
module.exports = [
2021
...texts,
@@ -32,5 +33,6 @@ module.exports = [
3233
multiValueWrapper,
3334
asyncUserChip,
3435
countDown,
35-
location
36+
location,
37+
copyToClipboardButton
3638
];

lib/schemas/edit-new/modules/componentNames.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ module.exports = {
3535
objectCreator: 'ObjectCreator',
3636
location: 'Location',
3737
fieldList: 'FieldList',
38-
steps: 'Steps'
38+
steps: 'Steps',
39+
copyToClipBoardButton: 'CopyToClipboardButton'
3940
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
const { makeComponent } = require('../../../utils');
4+
const { copyToClipBoardButton } = require('../componentNames');
5+
6+
module.exports = makeComponent({
7+
name: copyToClipBoardButton,
8+
properties: {}
9+
});

lib/schemas/edit-new/modules/components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const objectCreator = require('./objectCreator');
2525
const statusSelector = require('./statusSelector');
2626
const fieldList = require('./fieldList');
2727
const steps = require('./steps');
28+
const copyToClipboardButton = require('./copyToClipboardButton');
2829

2930
module.exports = [
3031
selects,
@@ -50,6 +51,7 @@ module.exports = [
5051
objectCreator,
5152
location,
5253
fieldList,
54+
copyToClipboardButton,
5355
...images,
5456
...chips,
5557
...others

tests/mocks/schemas/browse.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,17 @@
885885
"deviceDisplay": "desktop",
886886
"mapper": "addHashtag"
887887
},
888+
{
889+
"name": "id",
890+
"component": "CopyToClipboardButton",
891+
"attributes": {
892+
"sortable": false,
893+
"isDefaultSort": false,
894+
"isStatus": false,
895+
"initialSortDirection": "desc"
896+
},
897+
"componentAttributes": {}
898+
},
888899
{
889900
"name": "motiveName",
890901
"component": "MediumText",

tests/mocks/schemas/edit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@ sections:
369369
referenceValueType: static
370370
referenceValue: null
371371

372+
- name: name
373+
component: CopyToClipboardButton
374+
componentAttributes: {}
375+
372376
- name: nameGroup
373377
component: Select
374378
componentAttributes:

tests/mocks/schemas/expected/browse.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,17 @@
964964
"fontWeight": "bold"
965965
}
966966
},
967+
{
968+
"name": "id",
969+
"component": "CopyToClipboardButton",
970+
"componentAttributes": {},
971+
"attributes": {
972+
"sortable": false,
973+
"isDefaultSort": false,
974+
"isStatus": false,
975+
"initialSortDirection": "desc"
976+
}
977+
},
967978
{
968979
"name": "motiveName",
969980
"component": "MediumText",

tests/mocks/schemas/expected/edit.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,11 @@
603603
]
604604
}
605605
},
606+
{
607+
"name": "name",
608+
"component": "CopyToClipboardButton",
609+
"componentAttributes": {}
610+
},
606611
{
607612
"name": "nameGroup",
608613
"component": "Select",

0 commit comments

Comments
 (0)