Skip to content
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

Merged
merged 7 commits into from
Jan 4, 2024

Conversation

TahaKhanAbdalli
Copy link
Collaborator

fixes #951

@IanMayo IanMayo temporarily deployed to rco-review-pr-975 January 3, 2024 10:39 Inactive
@@ -43,6 +43,21 @@ const SecurityRelatedFilter = ({

return <Chip sx={{ marginBottom: 1 }} label={label} />
}
const availableResources = [
Copy link
Contributor

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?

'destruction',
'vaultLocation',
'dispatch',
'project',
Copy link
Contributor

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 present vaultLocation as vault location (same with mediaType).
  • when we render values for the resource column, we should display this cosmetic label, not the raw resource value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on it.

@IanMayo IanMayo temporarily deployed to rco-review-pr-975 January 3, 2024 14:07 Inactive
[constants.R_DESTRUCTION]: 'Destruction',
[constants.R_VAULT_LOCATION]: 'Vault Location',
[constants.R_DISPATCH]: 'Dispatch',
[constants.R_PROJECTS]: 'Project',
Copy link
Contributor

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

Copy link
Collaborator Author

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.

Copy link
Contributor

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)

Copy link
Collaborator Author

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?

@IanMayo IanMayo temporarily deployed to rco-review-pr-975 January 3, 2024 15:51 Inactive
@IanMayo
Copy link
Contributor

IanMayo commented Jan 3, 2024

Just one more bit - taking the project label from the ConfigData:
image

@IanMayo IanMayo temporarily deployed to rco-review-pr-975 January 4, 2024 10:02 Inactive
source='resource'
label='Resource'
render={(record) => (
<span>
Copy link
Contributor

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.
image

Is it worth refactoring it into an arrow function, where we can be a bit more verbose?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me check.

@IanMayo IanMayo temporarily deployed to rco-review-pr-975 January 4, 2024 10:57 Inactive
@IanMayo IanMayo temporarily deployed to rco-review-pr-975 January 4, 2024 11:25 Inactive
@IanMayo IanMayo temporarily deployed to rco-review-pr-975 January 4, 2024 11:27 Inactive
Copy link

sonarqubecloud bot commented Jan 4, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@IanMayo IanMayo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and working

@IanMayo IanMayo merged commit 8138d4e into main Jan 4, 2024
3 checks passed
@IanMayo IanMayo deleted the 951_auditList_resource_filter branch January 4, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audit List - resource filter
2 participants