orc-shared 5.9.0-dev.10 → 5.9.0-dev.12
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/components/Registry.js +110 -0
- package/dist/sharedMessages.js +20 -0
- package/package.json +1 -1
- package/src/components/Registry.js +42 -0
- package/src/components/Registry.test.js +85 -0
- package/src/sharedMessages.js +20 -0
- package/src/translations/en-US.json +5 -0
- package/src/translations/fr-CA.json +5 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
var _InformationItem = _interopRequireDefault(require("./MaterialUI/DataDisplay/PredefinedElements/InformationItem"));
|
|
7
|
+
var _sharedMessages = _interopRequireDefault(require("../sharedMessages"));
|
|
8
|
+
var _reactIntl = require("react-intl");
|
|
9
|
+
var _Box = _interopRequireDefault(require("@material-ui/core/Box"));
|
|
10
|
+
var _styles = require("@material-ui/core/styles");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
(function () {
|
|
13
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
14
|
+
enterModule && enterModule(module);
|
|
15
|
+
})();
|
|
16
|
+
(function () {
|
|
17
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
18
|
+
enterModule && enterModule(module);
|
|
19
|
+
})();
|
|
20
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
24
|
+
return a;
|
|
25
|
+
};
|
|
26
|
+
var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
27
|
+
return {
|
|
28
|
+
registry: {
|
|
29
|
+
"& > div + div": {
|
|
30
|
+
marginTop: theme.spacing(2)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
var Registry = function Registry(_ref) {
|
|
36
|
+
var dateCreated = _ref.dateCreated,
|
|
37
|
+
createdBy = _ref.createdBy,
|
|
38
|
+
lastModifiedDate = _ref.lastModifiedDate,
|
|
39
|
+
lastModifiedBy = _ref.lastModifiedBy,
|
|
40
|
+
_ref$additionalConten = _ref.additionalContent,
|
|
41
|
+
additionalContent = _ref$additionalConten === void 0 ? [] : _ref$additionalConten;
|
|
42
|
+
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
43
|
+
formatDate = _useIntl.formatDate;
|
|
44
|
+
var classes = useStyles();
|
|
45
|
+
var created = formatDate(dateCreated);
|
|
46
|
+
var lastModified = formatDate(lastModifiedDate);
|
|
47
|
+
var registry = /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
48
|
+
className: classes.registry,
|
|
49
|
+
display: "flex",
|
|
50
|
+
flexDirection: "column"
|
|
51
|
+
}, dateCreated !== undefined && /*#__PURE__*/_react.default.createElement(_InformationItem.default, {
|
|
52
|
+
label: _sharedMessages.default.created,
|
|
53
|
+
children: created
|
|
54
|
+
}), createdBy !== undefined && /*#__PURE__*/_react.default.createElement(_InformationItem.default, {
|
|
55
|
+
label: _sharedMessages.default.createdBy,
|
|
56
|
+
children: createdBy
|
|
57
|
+
}), lastModifiedDate !== undefined && /*#__PURE__*/_react.default.createElement(_InformationItem.default, {
|
|
58
|
+
label: _sharedMessages.default.lastModified,
|
|
59
|
+
children: lastModified
|
|
60
|
+
}), lastModifiedBy !== undefined && /*#__PURE__*/_react.default.createElement(_InformationItem.default, {
|
|
61
|
+
label: _sharedMessages.default.lastModifiedBy,
|
|
62
|
+
children: lastModifiedBy
|
|
63
|
+
}), additionalContent.map(function (c, index) {
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement(_InformationItem.default, {
|
|
65
|
+
key: "additional" + index,
|
|
66
|
+
label: c.label,
|
|
67
|
+
children: c.content
|
|
68
|
+
});
|
|
69
|
+
}));
|
|
70
|
+
return registry;
|
|
71
|
+
};
|
|
72
|
+
__signature__(Registry, "useIntl{{ formatDate }}\nuseStyles{classes}", function () {
|
|
73
|
+
return [_reactIntl.useIntl, useStyles];
|
|
74
|
+
});
|
|
75
|
+
__signature__(Registry, "useIntl{{ formatDate }}\nuseStyles{classes}", function () {
|
|
76
|
+
return [_reactIntl.useIntl, useStyles];
|
|
77
|
+
});
|
|
78
|
+
var _default = Registry;
|
|
79
|
+
var _default2 = _default;
|
|
80
|
+
var _default3 = exports.default = _default2;
|
|
81
|
+
;
|
|
82
|
+
(function () {
|
|
83
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
84
|
+
if (!reactHotLoader) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/Registry.js");
|
|
88
|
+
reactHotLoader.register(Registry, "Registry", "/home/vsts/work/1/s/src/components/Registry.js");
|
|
89
|
+
reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/Registry.js");
|
|
90
|
+
})();
|
|
91
|
+
;
|
|
92
|
+
(function () {
|
|
93
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
94
|
+
leaveModule && leaveModule(module);
|
|
95
|
+
})();
|
|
96
|
+
;
|
|
97
|
+
(function () {
|
|
98
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
99
|
+
if (!reactHotLoader) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
reactHotLoader.register(useStyles, "useStyles", "/home/vsts/work/1/s/src/components/Registry.js");
|
|
103
|
+
reactHotLoader.register(Registry, "Registry", "/home/vsts/work/1/s/src/components/Registry.js");
|
|
104
|
+
reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/Registry.js");
|
|
105
|
+
})();
|
|
106
|
+
;
|
|
107
|
+
(function () {
|
|
108
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
109
|
+
leaveModule && leaveModule(module);
|
|
110
|
+
})();
|
package/dist/sharedMessages.js
CHANGED
|
@@ -293,6 +293,26 @@ var sharedMessages = (0, _reactIntl.defineMessages)({
|
|
|
293
293
|
valueTypeWrapperFalse: {
|
|
294
294
|
id: "orc-shared.valueTypeWrapperFalse",
|
|
295
295
|
defaultMessage: "False"
|
|
296
|
+
},
|
|
297
|
+
registry: {
|
|
298
|
+
id: "orc-shared.registry",
|
|
299
|
+
defaultMessage: "Registry"
|
|
300
|
+
},
|
|
301
|
+
created: {
|
|
302
|
+
id: "orc-shared.created",
|
|
303
|
+
defaultMessage: "Date Created"
|
|
304
|
+
},
|
|
305
|
+
createdBy: {
|
|
306
|
+
id: "orc-shared.createdBy",
|
|
307
|
+
defaultMessage: "Created By"
|
|
308
|
+
},
|
|
309
|
+
lastModified: {
|
|
310
|
+
id: "orc-shared.lastModified",
|
|
311
|
+
defaultMessage: "Last Modified"
|
|
312
|
+
},
|
|
313
|
+
lastModifiedBy: {
|
|
314
|
+
id: "orc-shared.lastModifiedBy",
|
|
315
|
+
defaultMessage: "Last Modified By"
|
|
296
316
|
}
|
|
297
317
|
});
|
|
298
318
|
var _default = sharedMessages;
|
package/package.json
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import InformationItem from "./MaterialUI/DataDisplay/PredefinedElements/InformationItem";
|
|
3
|
+
import sharedMessages from "~/sharedMessages";
|
|
4
|
+
import { useIntl } from "react-intl";
|
|
5
|
+
import Box from "@material-ui/core/Box";
|
|
6
|
+
import { makeStyles } from "@material-ui/core/styles";
|
|
7
|
+
|
|
8
|
+
const useStyles = makeStyles(theme => ({
|
|
9
|
+
registry: {
|
|
10
|
+
"& > div + div": {
|
|
11
|
+
marginTop: theme.spacing(2),
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
const Registry = ({ dateCreated, createdBy, lastModifiedDate, lastModifiedBy, additionalContent = [] }) => {
|
|
17
|
+
const { formatDate } = useIntl();
|
|
18
|
+
const classes = useStyles();
|
|
19
|
+
|
|
20
|
+
const created = formatDate(dateCreated);
|
|
21
|
+
const lastModified = formatDate(lastModifiedDate);
|
|
22
|
+
|
|
23
|
+
const registry = (
|
|
24
|
+
<Box className={classes.registry} display="flex" flexDirection="column">
|
|
25
|
+
{dateCreated !== undefined && <InformationItem label={sharedMessages.created} children={created} />}
|
|
26
|
+
{createdBy !== undefined && <InformationItem label={sharedMessages.createdBy} children={createdBy} />}
|
|
27
|
+
{lastModifiedDate !== undefined && (
|
|
28
|
+
<InformationItem label={sharedMessages.lastModified} children={lastModified} />
|
|
29
|
+
)}
|
|
30
|
+
{lastModifiedBy !== undefined && (
|
|
31
|
+
<InformationItem label={sharedMessages.lastModifiedBy} children={lastModifiedBy} />
|
|
32
|
+
)}
|
|
33
|
+
{additionalContent.map((c, index) => (
|
|
34
|
+
<InformationItem key={"additional" + index} label={c.label} children={c.content} />
|
|
35
|
+
))}
|
|
36
|
+
</Box>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return registry;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default Registry;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import InformationItem from "./MaterialUI/DataDisplay/PredefinedElements/InformationItem";
|
|
3
|
+
import sharedMessages from "~/sharedMessages";
|
|
4
|
+
import Box from "@material-ui/core/Box";
|
|
5
|
+
import Registry from "./Registry";
|
|
6
|
+
import { TestWrapper, createMuiTheme, extractMessages } from "../utils/testUtils";
|
|
7
|
+
|
|
8
|
+
const messages = extractMessages(sharedMessages);
|
|
9
|
+
const theme = createMuiTheme();
|
|
10
|
+
|
|
11
|
+
describe("Registry", () => {
|
|
12
|
+
it("Renders Registry correctly", () => {
|
|
13
|
+
const created = "2020-10-06T16:21:55.5700000Z";
|
|
14
|
+
const createdBy = "Somebody";
|
|
15
|
+
const lastModified = "2020-10-06T16:21:55.5700000Z";
|
|
16
|
+
const lastModifiedBy = "OOE@oco";
|
|
17
|
+
|
|
18
|
+
const component = (
|
|
19
|
+
<TestWrapper intlProvider={{ messages }} stylesProvider muiThemeProvider={{ theme }}>
|
|
20
|
+
<Registry
|
|
21
|
+
dateCreated={created}
|
|
22
|
+
createdBy={createdBy}
|
|
23
|
+
lastModifiedDate={lastModified}
|
|
24
|
+
lastModifiedBy={lastModifiedBy}
|
|
25
|
+
/>
|
|
26
|
+
</TestWrapper>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const expected = (
|
|
30
|
+
<TestWrapper intlProvider={{ messages }} stylesProvider muiThemeProvider={{ theme }}>
|
|
31
|
+
<Box display="flex" flexDirection="column">
|
|
32
|
+
<InformationItem label={sharedMessages.created} children="10/6/2020" />
|
|
33
|
+
<InformationItem label={sharedMessages.createdBy} children={createdBy} />
|
|
34
|
+
<InformationItem label={sharedMessages.lastModified} children="10/6/2020" />
|
|
35
|
+
<InformationItem label={sharedMessages.lastModifiedBy} children={lastModifiedBy} />
|
|
36
|
+
</Box>
|
|
37
|
+
</TestWrapper>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
expect(component, "when mounted", "to satisfy", expected);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("Renders Registry correctly with additional content", () => {
|
|
44
|
+
const created = "2020-10-06T16:21:55.5700000Z";
|
|
45
|
+
const createdBy = "Somebody";
|
|
46
|
+
const lastModified = "2020-10-06T16:21:55.5700000Z";
|
|
47
|
+
const lastModifiedBy = "OOE@oco";
|
|
48
|
+
|
|
49
|
+
const component = (
|
|
50
|
+
<TestWrapper intlProvider={{ messages }} stylesProvider muiThemeProvider={{ theme }}>
|
|
51
|
+
<Registry
|
|
52
|
+
dateCreated={created}
|
|
53
|
+
createdBy={createdBy}
|
|
54
|
+
lastModifiedDate={lastModified}
|
|
55
|
+
lastModifiedBy={lastModifiedBy}
|
|
56
|
+
additionalContent={[
|
|
57
|
+
{
|
|
58
|
+
label: sharedMessages.about,
|
|
59
|
+
content: "some date",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: sharedMessages.help,
|
|
63
|
+
content: "Hugh Mann",
|
|
64
|
+
},
|
|
65
|
+
]}
|
|
66
|
+
/>
|
|
67
|
+
</TestWrapper>
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
const expected = (
|
|
71
|
+
<TestWrapper intlProvider={{ messages }} stylesProvider muiThemeProvider={{ theme }}>
|
|
72
|
+
<Box display="flex" flexDirection="column">
|
|
73
|
+
<InformationItem label={sharedMessages.created} children="10/6/2020" />
|
|
74
|
+
<InformationItem label={sharedMessages.createdBy} children={createdBy} />
|
|
75
|
+
<InformationItem label={sharedMessages.lastModified} children="10/6/2020" />
|
|
76
|
+
<InformationItem label={sharedMessages.lastModifiedBy} children={lastModifiedBy} />
|
|
77
|
+
<InformationItem label={sharedMessages.about} children={"some date"} />
|
|
78
|
+
<InformationItem label={sharedMessages.help} children={"Hugh Mann"} />
|
|
79
|
+
</Box>
|
|
80
|
+
</TestWrapper>
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
expect(component, "when mounted", "to satisfy", expected);
|
|
84
|
+
});
|
|
85
|
+
});
|
package/src/sharedMessages.js
CHANGED
|
@@ -279,6 +279,26 @@ const sharedMessages = defineMessages({
|
|
|
279
279
|
id: "orc-shared.valueTypeWrapperFalse",
|
|
280
280
|
defaultMessage: "False",
|
|
281
281
|
},
|
|
282
|
+
registry: {
|
|
283
|
+
id: "orc-shared.registry",
|
|
284
|
+
defaultMessage: "Registry",
|
|
285
|
+
},
|
|
286
|
+
created: {
|
|
287
|
+
id: "orc-shared.created",
|
|
288
|
+
defaultMessage: "Date Created",
|
|
289
|
+
},
|
|
290
|
+
createdBy: {
|
|
291
|
+
id: "orc-shared.createdBy",
|
|
292
|
+
defaultMessage: "Created By",
|
|
293
|
+
},
|
|
294
|
+
lastModified: {
|
|
295
|
+
id: "orc-shared.lastModified",
|
|
296
|
+
defaultMessage: "Last Modified",
|
|
297
|
+
},
|
|
298
|
+
lastModifiedBy: {
|
|
299
|
+
id: "orc-shared.lastModifiedBy",
|
|
300
|
+
defaultMessage: "Last Modified By",
|
|
301
|
+
},
|
|
282
302
|
});
|
|
283
303
|
|
|
284
304
|
export default sharedMessages;
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"orc-shared.confirmation": "Confirmation",
|
|
15
15
|
"orc-shared.copyright": "© {year} Orckestra Technologies Inc.",
|
|
16
16
|
"orc-shared.copyrightTermsNotice": "This computer program is protected by copyright laws and international treaties. Unauthorized reproduction or redistribution of this program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law. Orckestra is a trademark of Orckestra Technologies Inc. All other trademarks are property of the respective owners.",
|
|
17
|
+
"orc-shared.created": "Date Created",
|
|
18
|
+
"orc-shared.createdBy": "Created By",
|
|
17
19
|
"orc-shared.dataTypeBoolean": "Yes/No Choice",
|
|
18
20
|
"orc-shared.dataTypeDate": "Date/Calendar",
|
|
19
21
|
"orc-shared.dataTypeDecimal": "Decimal Number",
|
|
@@ -37,6 +39,8 @@
|
|
|
37
39
|
"orc-shared.inactive": "Inactive",
|
|
38
40
|
"orc-shared.internetExplorerWarningContent": "You are using a browser that we no longer support. For a better experience with our HTML web applications, we recommend you to use the latest version of one of the following browsers:",
|
|
39
41
|
"orc-shared.internetExplorerWarningTitle": "Improve your experience",
|
|
42
|
+
"orc-shared.lastModified": "Last Modified",
|
|
43
|
+
"orc-shared.lastModifiedBy": "Last Modified By",
|
|
40
44
|
"orc-shared.needToRefresh": "You are not authorized to execute a request. Click refresh to reload the application.",
|
|
41
45
|
"orc-shared.next": "Next",
|
|
42
46
|
"orc-shared.no": "No",
|
|
@@ -46,6 +50,7 @@
|
|
|
46
50
|
"orc-shared.orcSharedVersion": "Orc-Shared Framework {version}",
|
|
47
51
|
"orc-shared.preferences": "Preferences",
|
|
48
52
|
"orc-shared.refresh": "Refresh",
|
|
53
|
+
"orc-shared.registry": "Registry",
|
|
49
54
|
"orc-shared.remove": "Remove",
|
|
50
55
|
"orc-shared.save": "Save",
|
|
51
56
|
"orc-shared.scopeChangeWithOpenedTabsConfirmation": "One or more entities opened will be closed. Would you like to change scope now?",
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"orc-shared.confirmation": "Confirmation",
|
|
15
15
|
"orc-shared.copyright": "© {year} Technologies Orckestra Inc.",
|
|
16
16
|
"orc-shared.copyrightTermsNotice": "Avertissement: Ce programme est protégé par la loi relative au droit d'auteur et par les conventions internationales. Toute reproduction ou distribution partielle ou totale du logiciel, par quelque moyen que ce soit, est strictement interdite. Toute personne ne respectant pas ces dispositions se rendra coupable du délit de contrefaçon et sera passible des sanctions pénales prévues par la loi. Orckestra est une marque de commerce déposée et détenue par Technologies Orckestra Inc. Toutes les autres marques de commerce sont la propriété de leurs détenteurs respectifs.",
|
|
17
|
+
"orc-shared.created": "Date de création",
|
|
18
|
+
"orc-shared.createdBy": "Créé par",
|
|
17
19
|
"orc-shared.dataTypeBoolean": "Choix Oui/Non",
|
|
18
20
|
"orc-shared.dataTypeDate": "Date/Calendrier",
|
|
19
21
|
"orc-shared.dataTypeDecimal": "Nombre décimal",
|
|
@@ -37,6 +39,8 @@
|
|
|
37
39
|
"orc-shared.inactive": "Inactif",
|
|
38
40
|
"orc-shared.internetExplorerWarningContent": "Vous utilisez un navigateur qui n'est plus supporté. Pour assurer une expérience optimale de nos applications web HTML, nous vous recommendons d'utiliser la dernière version des navigateurs suivants:",
|
|
39
41
|
"orc-shared.internetExplorerWarningTitle": "Améliorez votre expérience",
|
|
42
|
+
"orc-shared.lastModified": "Dernière date de modification",
|
|
43
|
+
"orc-shared.lastModifiedBy": "Modifié par",
|
|
40
44
|
"orc-shared.needToRefresh": "Vous n'êtes pas autorisé à effectuer une requête. Veuillez cliquer sur Rafraîchir pour rafraîchir l’application.",
|
|
41
45
|
"orc-shared.next": "Suivant",
|
|
42
46
|
"orc-shared.no": "Non",
|
|
@@ -46,6 +50,7 @@
|
|
|
46
50
|
"orc-shared.orcSharedVersion": "Infrastructure Orc-Shared {version}",
|
|
47
51
|
"orc-shared.preferences": "Préférences",
|
|
48
52
|
"orc-shared.refresh": "Rafraîchir",
|
|
53
|
+
"orc-shared.registry": "Régistre",
|
|
49
54
|
"orc-shared.remove": "Retirer",
|
|
50
55
|
"orc-shared.save": "Sauvegarder",
|
|
51
56
|
"orc-shared.scopeChangeWithOpenedTabsConfirmation": "Une ou plusieurs entités ouvertes seront fermées. Voulez-vous vraiment changer de Scope?",
|