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

Disable Required Toggle When No Subtags Are Enabled #48381

Merged
merged 6 commits into from
Sep 4, 2024
4 changes: 4 additions & 0 deletions src/pages/workspace/tags/WorkspaceViewTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ function WorkspaceViewTagsPage({route}: WorkspaceViewTagsProps) {
);
};

if (!!currentPolicyTag?.required && !Object.values(currentPolicyTag?.tags ?? {}).some((tag) => tag.enabled)) {
Tag.setPolicyTagsRequired(policyID, false, route.params.orderWeight);
}

const navigateToEditTag = () => {
Navigation.navigate(ROUTES.WORKSPACE_EDIT_TAGS.getRoute(route.params.policyID, currentPolicyTag?.orderWeight));
};
Expand Down
Loading