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

Refactor: Add the capability of setting "allow list" content policy #422

Merged
merged 17 commits into from
Jan 16, 2024

Conversation

mayan-000
Copy link
Collaborator

Description

This PR refactors the implementation for allow list to better align with extension by adding new key to CookieTableData called isDomainInAllowList, and moves/break down the logic from design-system to the extension package.

Relevant Technical Choices

Testing Instructions

Additional Information:

Screenshot/Screencast


Checklist

  • I have thoroughly tested this code to the best of my abilities.
  • I have reviewed the code myself before requesting a review.
  • This code is covered by unit tests to verify that it works as intended.
  • The QA of this PR is done by a member of the QA team (to be checked by QA).

Fixes #

@mayan-000 mayan-000 self-assigned this Jan 16, 2024
@mohdsayed mohdsayed marked this pull request as ready for review January 16, 2024 14:58
@mohdsayed mohdsayed merged commit ef3aea8 into feat/allowed-list Jan 16, 2024
4 checks passed
@mohdsayed mohdsayed deleted the ref/allowed-list branch January 16, 2024 14:58
mohdsayed added a commit that referenced this pull request Jan 29, 2024
)

* Add permission for contentSettings

* Clear contentSettings.cookies when browser window is opened

* Add custom hook for allowed list

* Create state for and handle classes in body row

* Update TableProps and details component

* Add mock test data and test for bodyRow

* Add test for BodyRow

* Update useAllowedList hook to handle session storage

* Add test data for cookie table body

* Add method for adding domain to allow list

* Add new clors to tailwind

* Add condition before loopin through storage.allowList

* Refactor cdoe

* Refactor code

* Refactor code

* Add types

* Refactor code

* Refactor code

* Refactor code

* Use async/await instead of promise then

* Refactor code to move onClick function to a utility

* Update details section for allowed cookies

* Show green for an item that is not blocked and allow listed

* Show green border for allow listed items even if they are blocked

* Fix state update

* Capitalize R in blocked reason

* Refactor: Add the capability of setting "allow list" content policy (#422)

* Add new key in CookieTableData type

* Pass row context menu as prop and remove useAllowList hook

* Move useAllowedList logic into standalone functions

* Move conext menu into CookieListing and introduce states and callback for modal

* Remove selected row from table

* Stop propagation on click

* ref: Refactor the utils handling clicks, removal of domain, setting domain and parent domain

* perf: clean up unrequired calls

* chore: delete already moved files

* ref: Refactor useEffects

* fix: Update condition for getting domain in allow list

* ref: move row context menu ui and logic to separate component

* ref: move allowed list logic to a hook

* test: add tests for rowContextMenu

* fix: capitalize context menu options

* test: add tests for utils

* Add reloadCurrentTab to reload current tab

* Reload page on adding domain to allowed list

* Fix url pattern issue

* Fix styling for border left

* Update message

* Update text for context menu

* Allow cookies for domain with dot prefix

* Refactor code

* Fix tests

* Remove condition for fixing remove allow list issue

* Remove unused code for useHighlighting

* Fix parent domain double click issue

* Code improvements and refactoring

* Fix test case

* Add code improvements

* Fix test

* ref: use domains list as prop

* test: fix test

---------

Co-authored-by: Mayank Rana <58820001+mayan-000@users.noreply.github.com>
Co-authored-by: Mayank Rana <mayankranax1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants