@defra/lis-infra-ui-services 0.16.0 → 0.17.0
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defra/lis-infra-ui-services",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "UI-Services shared definitions for the livestock taxonomy topology.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"author": "Defra DDTS",
|
|
54
54
|
"license": "OGL-UK-3.0",
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@defra/lis-hubs-infra-registry": "^0.
|
|
56
|
+
"@defra/lis-hubs-infra-registry": "^0.5.0",
|
|
57
57
|
"@hapi/catbox-memory": "6.0.2",
|
|
58
58
|
"@hapi/catbox-redis": "7.0.2",
|
|
59
59
|
"@hapi/vision": "7.0.3",
|
package/src/base-path.js
CHANGED
|
@@ -84,7 +84,10 @@ export function buildAppPath({ request, routePath = '/', basePath = '' }) {
|
|
|
84
84
|
* @param {{ routePath?: string, basePath?: string }} options
|
|
85
85
|
* @returns {string[]}
|
|
86
86
|
*/
|
|
87
|
-
export function getRouteVariants({
|
|
87
|
+
export function getRouteVariants({
|
|
88
|
+
routePath = '/',
|
|
89
|
+
basePath: _basePath = ''
|
|
90
|
+
}) {
|
|
88
91
|
const normalizedPath = normalizePath(routePath)
|
|
89
92
|
return [normalizedPath]
|
|
90
93
|
}
|
package/src/duration.js
CHANGED
|
@@ -35,11 +35,7 @@ export const seconds = {
|
|
|
35
35
|
oneHour: MINUTES_IN_HOUR * SECONDS_IN_MINUTE,
|
|
36
36
|
eightHours: EIGHT * MINUTES_IN_HOUR * SECONDS_IN_MINUTE,
|
|
37
37
|
oneDay: HOURS_IN_DAY * MINUTES_IN_HOUR * SECONDS_IN_MINUTE,
|
|
38
|
-
oneWeek:
|
|
39
|
-
DAYS_IN_WEEK *
|
|
40
|
-
HOURS_IN_DAY *
|
|
41
|
-
MINUTES_IN_HOUR *
|
|
42
|
-
SECONDS_IN_MINUTE
|
|
38
|
+
oneWeek: DAYS_IN_WEEK * HOURS_IN_DAY * MINUTES_IN_HOUR * SECONDS_IN_MINUTE
|
|
43
39
|
}
|
|
44
40
|
|
|
45
41
|
/**
|
package/src/index.js
CHANGED
|
@@ -21,8 +21,7 @@ export const SUPPORTED_TAXONOMIES = [
|
|
|
21
21
|
id: 'status',
|
|
22
22
|
slug: 'status',
|
|
23
23
|
label: 'Status',
|
|
24
|
-
summary: 'Surface status information and lifecycle checks for livestock.'
|
|
25
|
-
accessMode: 'hub-service'
|
|
24
|
+
summary: 'Surface status information and lifecycle checks for livestock.'
|
|
26
25
|
},
|
|
27
26
|
{
|
|
28
27
|
id: 'home',
|
|
@@ -85,7 +85,10 @@ describe('searchForm()', () => {
|
|
|
85
85
|
|
|
86
86
|
test('escapes a search term containing markup', () => {
|
|
87
87
|
// Act
|
|
88
|
-
const html = render({
|
|
88
|
+
const html = render({
|
|
89
|
+
label: 'Search',
|
|
90
|
+
value: '"><script>alert(1)</script>'
|
|
91
|
+
})
|
|
89
92
|
|
|
90
93
|
// Assert
|
|
91
94
|
expect(html).not.toContain('<script>alert(1)</script>')
|
|
@@ -52,7 +52,9 @@ describe('createNunjucksConfig()', () => {
|
|
|
52
52
|
test('resolves the base path from the module registry when moduleId is given', () => {
|
|
53
53
|
// Arrange
|
|
54
54
|
mocks.getBasePathForModule.mockReturnValue('/cattle/register')
|
|
55
|
-
const config = {
|
|
55
|
+
const config = {
|
|
56
|
+
get: vi.fn((key) => (key === 'root' ? projectRoot : false))
|
|
57
|
+
}
|
|
56
58
|
|
|
57
59
|
// Act
|
|
58
60
|
createNunjucksConfig({
|
|
@@ -68,7 +70,9 @@ describe('createNunjucksConfig()', () => {
|
|
|
68
70
|
|
|
69
71
|
test('defaults to an empty base path when no moduleId is given', () => {
|
|
70
72
|
// Arrange
|
|
71
|
-
const config = {
|
|
73
|
+
const config = {
|
|
74
|
+
get: vi.fn((key) => (key === 'root' ? projectRoot : false))
|
|
75
|
+
}
|
|
72
76
|
|
|
73
77
|
// Act
|
|
74
78
|
const nunjucksConfig = createNunjucksConfig({
|