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

Add confirmation dialog for bulk trashcan or delete table action #4123

Conversation

daniele-mng
Copy link
Contributor

@daniele-mng daniele-mng commented Aug 13, 2024

What

  • Add a confirmation dialog for table bulk actions move to trashcan/delete

Why

  • To prevent accidental deletions by ensuring users confirm their actions before proceeding. This adds an extra layer of safety.

References

GEA-412

Checklist

  • Tests

bjoernricks and others added 30 commits June 6, 2024 11:43
An instance variable stores the value directly and doesn't cause
re-renders if it is changed. Variables returned from this hooks are
comparable to instance variables for class components.
The dependency review workflow is able to write a summary message to the
PR if it is allowed to write to the workflow.
The useShallowEqualSelector hooks allows to avoid re-renders if an
object is selected from the redux store but its value(s) didn't change.
With the standard selector which uses `===` comparison even updating an
object's value to the same value will cause a re-render (because a new
state object is created).

This pattern can be found at https://react-redux.js.org/api/hooks#recipe-useshallowequalselector
The new usePageFilter hook allows to get the current applied filter of a
page from the redux store.
Update the usePageFilter hook to add additional functions to change,
reset and remove a page filter.
The selectors where invented for usage with mapStateToProps therefore
they return objects at the moment. To avoid unnecessary re-renders the
returned objects need to be compared with shallow equal.
At the end FilterProvider should be replaced with usePageFilter
completely.
Allow for better reading flow where variables and hooks are defined at
the top.
* Add: CVSS 4.0 Calculator
* Add: test for CvssV4Point0Calculator
* Apply: review comments
* Add: German translations
Add a new hooks that allows to get the previous value after the value is
changed. For example this hook can be used to check whether a filter has
changed.
CVSS 4.0 metrics can now be displayed in CVE details.
for translation and consistency with the calculator.
The hook can be used to run a function after a specific amount of time
for example for doing a reload of data.
* Change: withIconSize HOC to hook

* add tests

* improve test coverage

* remove snapshot test
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](micromatch/braces@3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
The new useReload hook is based in useTiming. It calls a timing
function before every reload to calculate the timeout before the reload.
This timing function gets a isVisible argument passed. Using the
argument the timing function can decide to extend the timeout when the
current browser window is not visible.
The hook determines the sort field and direction of a filter and allows
to change both via a returned function. The hook can be used to
implement the filter changes when clicking on the different header
columns of a entities list.
The hook returns functions the update a filter for getting the next,
previous, first and last page for a list of entities.
The useSelection hook implements the entity selection at a entities list
table. It is possible to select/deselect specific entities from the
list/table, to select all entities displayed at the page or all entities
for the current filter (filter without rows value applied).
@daniele-mng daniele-mng requested review from a team as code owners August 13, 2024 15:13
Copy link

github-actions bot commented Aug 13, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 3ef5850.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

OpenSSF Scorecard

PackageVersionScoreDetails
npm/@typescript-eslint/scope-manager 7.18.0 🟢 5.2
Details
CheckScoreReason
Code-Review🟢 7Found 16/22 approved changesets -- score normalized to 7
Maintained🟢 1030 commit(s) and 27 issue activity found in the last 90 days -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 9license file detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Signed-Releases⚠️ -1no releases found
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Security-Policy🟢 10security policy file detected
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities⚠️ 016 existing vulnerabilities detected
npm/@typescript-eslint/types 7.18.0 🟢 5.2
Details
CheckScoreReason
Code-Review🟢 7Found 16/22 approved changesets -- score normalized to 7
Maintained🟢 1030 commit(s) and 27 issue activity found in the last 90 days -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 9license file detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Signed-Releases⚠️ -1no releases found
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Security-Policy🟢 10security policy file detected
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities⚠️ 016 existing vulnerabilities detected
npm/@typescript-eslint/typescript-estree 7.18.0 🟢 5.2
Details
CheckScoreReason
Code-Review🟢 7Found 16/22 approved changesets -- score normalized to 7
Maintained🟢 1030 commit(s) and 27 issue activity found in the last 90 days -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 9license file detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Signed-Releases⚠️ -1no releases found
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Security-Policy🟢 10security policy file detected
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities⚠️ 016 existing vulnerabilities detected
npm/@typescript-eslint/utils 7.18.0 🟢 5.2
Details
CheckScoreReason
Code-Review🟢 7Found 16/22 approved changesets -- score normalized to 7
Maintained🟢 1030 commit(s) and 27 issue activity found in the last 90 days -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 9license file detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Signed-Releases⚠️ -1no releases found
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Security-Policy🟢 10security policy file detected
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities⚠️ 016 existing vulnerabilities detected
npm/@typescript-eslint/visitor-keys 7.18.0 🟢 5.2
Details
CheckScoreReason
Code-Review🟢 7Found 16/22 approved changesets -- score normalized to 7
Maintained🟢 1030 commit(s) and 27 issue activity found in the last 90 days -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 9license file detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Signed-Releases⚠️ -1no releases found
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Security-Policy🟢 10security policy file detected
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities⚠️ 016 existing vulnerabilities detected
npm/eslint-plugin-vitest 0.5.4 UnknownUnknown
npm/eslint-plugin-vitest ^0.5.4 UnknownUnknown

Scanned Manifest Files

package-lock.json
package.json
  • eslint-plugin-vitest@^0.5.4

@daniele-mng daniele-mng changed the base branch from main to rebase-opensight-ui August 13, 2024 15:14
Copy link

github-actions bot commented Aug 13, 2024

Conventional Commits Report

Type Number
Added 1

🚀 Conventional commits found.

@daniele-mng daniele-mng force-pushed the ADD-confirmation-dialog-for-bulk-trashcan-or-delete branch from 11e512e to 97553b2 Compare August 14, 2024 07:47
@daniele-mng daniele-mng force-pushed the rebase-opensight-ui branch 2 times, most recently from acd7f33 to 0334c01 Compare August 20, 2024 16:44
Copy link
Contributor

@a-h-abdelsalam a-h-abdelsalam left a comment

Choose a reason for hiding this comment

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

Looks good to me! However, I see the ticket suggests the confirmation dialog to be optional (set in user settings) and to keep the default behavior without confirmation.

Was this already discussed ?

src/web/pages/audits/__tests__/listpage.jsx Outdated Show resolved Hide resolved
a-h-abdelsalam
a-h-abdelsalam previously approved these changes Aug 23, 2024
Base automatically changed from rebase-opensight-ui to opensight-ui August 23, 2024 11:55
@daniele-mng daniele-mng dismissed a-h-abdelsalam’s stale review August 23, 2024 11:55

The base branch was changed.

@timopollmeier timopollmeier deleted the ADD-confirmation-dialog-for-bulk-trashcan-or-delete branch September 27, 2024 10:21
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.

6 participants