-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MEN-7551 - fix: added path for all devices on device page #60
Conversation
@@ -28,7 +28,7 @@ import DocsLink from './common/docslink'; | |||
|
|||
const listItems = [ | |||
{ route: '/', text: 'Dashboard', canAccess }, | |||
{ route: '/devices', text: 'Devices', canAccess: ({ userCapabilities: { canReadDevices } }) => canReadDevices }, | |||
{ route: '/devices/accepted', text: 'Devices', canAccess: ({ userCapabilities: { canReadDevices } }) => canReadDevices }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should remain /devices
as it is expected to be set by the previously selected state, if that wasn't selected before the devices should always default to accepted
@@ -147,7 +147,7 @@ export const DeviceGroups = () => { | |||
} | |||
// preset selectedIssues and selectedId with empty values, in case if remain properties are missing them | |||
let listState = { ...remainder }; | |||
if (statusParam && Object.values(DEVICE_STATES).some(state => state === statusParam)) { | |||
if (statusParam && Object.values(DEVICE_STATES).some(state => state === statusParam || statusParam === 'any')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (statusParam && Object.values(DEVICE_STATES).some(state => state === statusParam || statusParam === 'any')) { | |
if (statusParam && (Object.values(DEVICE_STATES).some(state => state === statusParam) || statusParam === routes.allDevices.key)) { |
to not have the check in every iteration there
@@ -219,7 +219,7 @@ export const formatDeviceSearch = ({ pageState, filters, selectedGroup }) => { | |||
export const generateDevicePath = ({ pageState }) => { | |||
const { state: selectedState } = pageState; | |||
const path = ['/devices']; | |||
if (![routes.allDevices.key, ''].includes(selectedState)) { | |||
if (![''].includes(selectedState)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (![''].includes(selectedState)) { | |
if (selectedState !== '') { |
I think
994f3a8
to
e97a7bf
Compare
Ticket: MEN-7551 Changelog: None Signed-off-by: Mikita Pilinka <[email protected]>
Ticket: MEN-7551
Changelog: None