Skip to content

Commit 9b80e6d

Browse files
Provisioning records
+ enrollment groups + linked hubs + lazy router + detail icons
1 parent f179a18 commit 9b80e6d

84 files changed

Lines changed: 827 additions & 238 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.storybook/preview.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { addons } from '@storybook/addons'
33
import { useEffect, useState } from 'react'
44
import { CHANGE } from 'storybook-addon-themes/src/constants'
55

6-
import light from '../src/components/Atomic/_theme/light'
6+
import plgd from '../src/components/Atomic/_theme/plgd'
77
import siemens from '../src/components/Atomic/_theme/siemens'
88

99
import 'bootstrap/dist/css/bootstrap.min.css'
@@ -26,11 +26,11 @@ export const parameters = {
2626
},
2727
},
2828
themes: {
29-
default: 'light',
29+
default: 'plgd',
3030
list: [
31-
{ name: 'light', class: ['theme-twt', 'light-mode'], color: '#00aced' },
31+
{ name: 'plgd', class: ['theme-plgd', 'plgd-mode'], color: '#00aced' },
3232
// { name: 'dark', class: ['theme-fb', 'dark-mode'], color: '#3b5998' },
33-
{ name: 'siemens', class: ['theme-fb', 'siemens-mode'], color: '#000028' },
33+
{ name: 'siemens', class: ['theme-siemens', 'siemens-mode'], color: '#000028' },
3434
],
3535
},
3636
}
@@ -45,7 +45,7 @@ const withTheme = (StoryFn, context) => {
4545
return (lastValue && lastValue[0]) || themes.default
4646
})
4747

48-
const getThemeByKey = (themeName) => themeName === 'light' ? light : siemens
48+
const getThemeByKey = (themeName) => themeName === 'plgd' ? plgd : siemens
4949

5050
useEffect(() => {
5151
channel.on(CHANGE, setThemeName);

src/app/clientApp/Devices/Detail/DevicesDetailsPage/DevicesDetailsPage.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { messages as menuT } from '../../../../../components/Atomic/Menu/Menu.i1
1212
import Notification from '../../../../../components/Atomic/Notification/Toast'
1313
import StatusTag from '../../../../../components/Atomic/StatusTag'
1414
import Breadcrumbs from '../../../../../components/Layout/Header/Breadcrumbs'
15-
import EditDeviceNameModal from '../../../../../components/Organisms/EditDeviceNameModal'
15+
import EditNameModal from '../../../../../components/Organisms/EditNameModal'
1616
import Tabs from '../../../../../components/Atomic/Tabs'
1717
import { getApiErrorMessage } from '../../../../../common/utils'
1818
import { disOwnDevice, ownDevice } from '../../slice'
@@ -415,20 +415,20 @@ const DevicesDetailsPage: FC<Props> = (props) => {
415415
show={showFirstTimeOnboardingModal}
416416
/>
417417

418-
<EditDeviceNameModal
419-
deviceName={deviceName}
420-
deviceNameLoading={deviceNameLoading}
418+
<EditNameModal
421419
handleClose={() => setShowEditNameModal(false)}
422420
handleSubmit={updateDeviceName}
423421
i18n={{
424422
close: _(t.close),
425-
deviceName: _(t.deviceName),
423+
namePlaceholder: _(t.deviceName),
426424
edit: _(t.edit),
427425
name: _(t.name),
428426
reset: _(t.reset),
429427
saveChange: _(t.saveChange),
430428
savingChanges: _(t.savingChanges),
431429
}}
430+
loading={deviceNameLoading}
431+
name={deviceName}
432432
show={showEditNameModal}
433433
/>
434434
</PageLayout>

src/app/clientApp/Devices/List/DevicesListActionButton/DevicesListActionButton.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import isFunction from 'lodash/isFunction'
44

55
import TableActionButton from '../../../../../components/Organisms/TableActionButton'
66
import { ItemType } from '../../../../../components/Organisms/TableActionButton/TableActionButton.types'
7-
import { IconClose, IconNetwork, IconPlus, IconShowPassword } from '../../../../../components/Atomic/Icon'
7+
import { IconClose, IconNetwork, IconPlus, IconArrowDetail } from '../../../../../components/Atomic/Icon'
88
import { devicesOwnerships } from '../../constants'
99
import { canSetDPSEndpoint } from '../../utils'
1010
import { getDevicesResourcesAllApi } from '../../rest'
@@ -21,23 +21,7 @@ const DevicesListActionButton: FC<Props> = memo((props) => {
2121
const isUnsupported = useMemo(() => ownershipStatus === UNSUPPORTED, [ownershipStatus])
2222

2323
const getDefaultItems = () => {
24-
const defaultItems: ItemType[] = [
25-
{
26-
id: 'detail',
27-
onClick: () => onView(deviceId),
28-
label: _(t.details),
29-
icon: <IconShowPassword />,
30-
},
31-
]
32-
33-
if (!isUnsupported) {
34-
defaultItems.push({
35-
id: 'own',
36-
onClick: () => onOwnChange(),
37-
label: isOwned ? _(t.disOwnDevice) : _(t.ownDevice),
38-
icon: isOwned ? <IconClose /> : <IconPlus />,
39-
})
40-
}
24+
const defaultItems: ItemType[] = []
4125

4226
if (isOwned) {
4327
defaultItems.push({
@@ -49,6 +33,22 @@ const DevicesListActionButton: FC<Props> = memo((props) => {
4933
})
5034
}
5135

36+
if (!isUnsupported) {
37+
defaultItems.push({
38+
id: 'own',
39+
onClick: () => onOwnChange(),
40+
label: isOwned ? _(t.disOwnDevice) : _(t.ownDevice),
41+
icon: isOwned ? <IconClose /> : <IconPlus />,
42+
})
43+
}
44+
45+
defaultItems.push({
46+
id: 'detail',
47+
onClick: () => onView(deviceId),
48+
label: _(t.details),
49+
icon: <IconArrowDetail />,
50+
})
51+
5252
return defaultItems
5353
}
5454
const { formatMessage: _ } = useIntl()

src/common/hooks/useWellKnownConfiguration.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import mergeWith from 'lodash/mergeWith'
44
import cloneDeep from 'lodash/cloneDeep'
55

66
import { fetchApi } from '../services'
7+
import { MenuItemVisibilityType } from '../../components/Layout/LeftPanel/LeftPanel.types'
78

89
export type BuildInformationType = {
910
buildDate: string
@@ -50,6 +51,11 @@ export type WellKnownConfigType = {
5051
releaseUrl: string
5152
version: string
5253
}
54+
ui: {
55+
menu: {
56+
[key: string]: MenuItemVisibilityType
57+
}
58+
}
5359
} & BuildInformationType
5460

5561
type useWellKnownConfigurationReturnType = [

src/components/Atomic/Grid/Column/Column.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type ColumnSizesType = {
1111
}
1212

1313
export type Props = {
14-
children: ReactNode | ReactElement
14+
children?: ReactNode | ReactElement
1515
id?: string
1616
className?: string
1717
style?: CSSProperties
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

src/components/Atomic/Icon/components/IconActions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const SvgIconActions = (props: SVGProps<SVGSVGElement>, ref: Ref<SVGSVGElement>)
77
<svg xmlns='http://www.w3.org/2000/svg' width={props.width || 16} height={props.height || 16} fill='none' viewBox='0 0 20 20' ref={ref} {...props}>
88
<path
99
fill='currentcolor'
10-
d='M10 14.012c1.15 0 2.083.969 2.083 2.16 0 1.193-.933 2.161-2.083 2.161-1.15 0-2.083-.968-2.083-2.16 0-1.192.933-2.16 2.083-2.16Zm0-6.172c1.15 0 2.083.968 2.083 2.16 0 1.192-.933 2.16-2.083 2.16-1.15 0-2.083-.968-2.083-2.16 0-1.192.933-2.16 2.083-2.16Zm2.083-4.013c0 1.192-.933 2.16-2.083 2.16-1.15 0-2.083-.968-2.083-2.16 0-1.192.933-2.16 2.083-2.16 1.15 0 2.083.968 2.083 2.16Z'
10+
d='M10 14.012c1.15 0 2.083.969 2.083 2.16 0 1.193-.933 2.161-2.083 2.161-1.15 0-2.083-.968-2.083-2.16 0-1.192.933-2.16 2.083-2.16m0-6.172c1.15 0 2.083.968 2.083 2.16 0 1.192-.933 2.16-2.083 2.16-1.15 0-2.083-.968-2.083-2.16 0-1.192.933-2.16 2.083-2.16m2.083-4.013c0 1.192-.933 2.16-2.083 2.16-1.15 0-2.083-.968-2.083-2.16 0-1.192.933-2.16 2.083-2.16 1.15 0 2.083.968 2.083 2.16Z'
1111
/>
1212
</svg>
1313
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Auto-generated file created by svgr-cli source svg-template.js
2+
// Do not edit directly
3+
import * as React from 'react'
4+
import type { SVGProps } from 'react'
5+
import { Ref, forwardRef, memo } from 'react'
6+
const SvgIconArrowDetail = (props: SVGProps<SVGSVGElement>, ref: Ref<SVGSVGElement>) => (
7+
<svg xmlns='http://www.w3.org/2000/svg' width={props.width || 16} height={props.height || 16} fill='none' viewBox='0 0 20 20' ref={ref} {...props}>
8+
<path fill='currentcolor' d='M6.91 14.412a.833.833 0 0 0 1.18 1.179l5-5a.833.833 0 0 0 0-1.179l-5-5a.833.833 0 0 0-1.18 1.179L11.323 10 6.91 14.412' />
9+
</svg>
10+
)
11+
const ForwardRef = forwardRef(SvgIconArrowDetail)
12+
const Memo = memo(ForwardRef)
13+
export default Memo
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Auto-generated file created by svgr-cli source svg-template.js
2+
// Do not edit directly
3+
import * as React from 'react'
4+
import type { SVGProps } from 'react'
5+
import { Ref, forwardRef, memo } from 'react'
6+
const SvgIconArrowDownNoPadding = (props: SVGProps<SVGSVGElement>, ref: Ref<SVGSVGElement>) => (
7+
<svg xmlns='http://www.w3.org/2000/svg' width={props.width || 16} height={props.height || 16} fill='none' viewBox='0 0 20 20' ref={ref} {...props}>
8+
<path fill='currentcolor' d='M5.59 6.912a.833.833 0 1 0-1.18 1.179l5 5a.833.833 0 0 0 1.18 0l5-5a.833.833 0 0 0-1.18-1.179L10 11.322l-4.41-4.41' />
9+
</svg>
10+
)
11+
const ForwardRef = forwardRef(SvgIconArrowDownNoPadding)
12+
const Memo = memo(ForwardRef)
13+
export default Memo

0 commit comments

Comments
 (0)