Skip to content

#4281 ruleset type admin tools#4329

Open
cielbellerose wants to merge 4 commits into
feature/rules-dashboardfrom
#4281-ruleset-type-admin-tools
Open

#4281 ruleset type admin tools#4329
cielbellerose wants to merge 4 commits into
feature/rules-dashboardfrom
#4281-ruleset-type-admin-tools

Conversation

@cielbellerose

@cielbellerose cielbellerose commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Changes

Moved logic for adding and deleting ruleset types to admin tools (since only admins had permissions for these actions)

Screenshots

Screenshot 2026-07-17 at 10 00 14 PM Screenshot 2026-07-17 at 10 03 45 PM Screenshot 2026-07-17 at 10 05 30 PM Screenshot 2026-07-17 at 10 05 40 PM

Checklist

It can be helpful to check the Checks and Files changed tabs.
Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.

  • All commits are tagged with the ticket number
  • No linting errors / newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Screenshots of UI changes (see Screenshots section)
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • No yarn.lock changes (unless dependencies have changed)
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes #4281

@cielbellerose cielbellerose linked an issue Jul 14, 2026 that may be closed by this pull request
3 tasks
@cielbellerose
cielbellerose changed the base branch from develop to feature/rules-dashboard July 14, 2026 16:56
@cielbellerose cielbellerose self-assigned this Jul 18, 2026
@cielbellerose
cielbellerose marked this pull request as ready for review July 18, 2026 02:12

const handleDeleteSubmit = () => {
onDelete(rulesetTypeId, name);
setShowDeleteModal(false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the modal should stay open if there is an error


const RulesetTypesTable: React.FC = () => {
const toast = useToast();
const { data: rulesetTypes = [], isLoading, error } = useAllRulesetTypes();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why does it need to be set to []?
also missing isError

const { mutateAsync: deleteRulesetType } = useDeleteRulesetType();
const [addRulesetTypeModalShow, setAddRulesetTypeModalShow] = useState(false);

if (error) return <ErrorPage message={error.message} />;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should be isError

};

const rulesetTypeTableRows = rulesetTypes.map((rulesetType, index) => (
<TableRow>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

needs a key

}
};

const RulesetTypeDeleteButton: React.FC<RulesetTypeDeleteButtonProps> = ({ rulesetTypeId, name, onDelete }) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Move this out of RulesetTypesTable's body so it's declared once at module scope, not recreated on every render

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.

[RulesDashboard] - Only Show Ruleset Type Create/Delete for Admin

2 participants