-
Notifications
You must be signed in to change notification settings - Fork 11
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
resource filter in audit list issue resolved #975
Conversation
src/resources/audit/AuditList.tsx
Outdated
@@ -43,6 +43,21 @@ const SecurityRelatedFilter = ({ | |||
|
|||
return <Chip sx={{ marginBottom: 1 }} label={label} /> | |||
} | |||
const availableResources = [ |
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.
@TahaKhanAbdalli - don't we have constants for these string values?
src/resources/audit/AuditList.tsx
Outdated
'destruction', | ||
'vaultLocation', | ||
'dispatch', | ||
'project', |
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.
Aah, we cosmetically rename project
using the config data.
I think this requires this change:
- array contains pairs of elements - the resource name and the cosmetically displayed label. For this, we'll use the config value for
project
and presentvaultLocation
asvault location
(same with mediaType). - when we render values for the
resource
column, we should display this cosmetic label, not the rawresource
value.
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.
Working on it.
src/resources/audit/config.tsx
Outdated
[constants.R_DESTRUCTION]: 'Destruction', | ||
[constants.R_VAULT_LOCATION]: 'Vault Location', | ||
[constants.R_DISPATCH]: 'Dispatch', | ||
[constants.R_PROJECTS]: 'Project', |
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.
the value of Project needs to come from the config-file, please @TahaKhanAbdalli
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.
got it.
I was thinking to add config based on audit and other files but never-mind. let me add them to the constants file.
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.
But note: the resource used in the filter needs to be project
(since that's the resource/table name), but the displayed label will come from the ConfigData
(it's Projekt
in our mock dataset)
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.
Should I turn project
to Projekt
into the resource filter?
src/resources/audit/AuditList.tsx
Outdated
source='resource' | ||
label='Resource' | ||
render={(record) => ( | ||
<span> |
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.
@TahaKhanAbdalli - have a linter warning on the next line.
Is it worth refactoring it into an arrow function, where we can be a bit more verbose?
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.
Let me check.
|
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.
Tested and working
fixes #951