Skip to content

Commit

Permalink
PROD-2409 By default, don't show data categories that are disabled (#…
Browse files Browse the repository at this point in the history
…5102)

Co-authored-by: Lucano Vera <lucanovera@ethyca.com>
  • Loading branch information
lucanovera and Lucano Vera authored Jul 18, 2024
1 parent 09289b2 commit a24f3f6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ The types of changes are:
- Endpoints for listing systems (GET /system) and datasets (GET /dataset) now support optional pagination [#5071](https://github.com/ethyca/fides/pull/5071)
- Messaging page will now show a notice about using global mode [#5090](https://github.com/ethyca/fides/pull/5090)
- Changed behavior of project selection modal in discovery monitor form [#5092](https://github.com/ethyca/fides/pull/5092)
- Data category selector for Discovery results won't show disabled categories [#5102](https://github.com/ethyca/fides/pull/5102)


### Developer Experience
- Upgrade to React 18 and Chakra 2, including other dependencies [#5036](https://github.com/ethyca/fides/pull/5036)
Expand Down
4 changes: 2 additions & 2 deletions clients/admin-ui/cypress/e2e/discovery-detection.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ describe("discovery and detection", () => {

it("allows classifications to be changed using the dropdown", () => {
cy.intercept("GET", "/api/v1/data_category", [
{ fides_key: "system" },
{ fides_key: "user.contact" },
{ fides_key: "system", active: true },
{ fides_key: "user.contact", active: true },
]);
cy.intercept("PATCH", "/api/v1/plus/discovery-monitor/*/results").as(
"patchClassification"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,21 @@ const Option = ({ data, setValue }: OptionProps<TaxonomySelectOption>) => {
interface TaxonomySelectDropdownProps {
onChange: (selectedOption: TaxonomySelectOption) => void;
menuIsOpen?: boolean;
showDisabled?: boolean;
}
const TaxonomySelectDropdown = ({
onChange,
menuIsOpen,
showDisabled = false,
}: TaxonomySelectDropdownProps) => {
const { getDataCategoryDisplayName, getDataCategories } = useTaxonomies();
const dataCategories = getDataCategories();

const getActiveDataCategories = () =>
getDataCategories().filter((c) => c.active);

const dataCategories = showDisabled
? getDataCategories()
: getActiveDataCategories();

const options: Options<TaxonomySelectOption> = dataCategories.map(
(category) => ({
Expand Down

0 comments on commit a24f3f6

Please sign in to comment.