Skip to content

Share one SyncModal between the repository sync actions - #363

Open
warisshaikh1 wants to merge 1 commit into
pulp:mainfrom
warisshaikh1:shared-sync-modal
Open

warisshaikh1 wants to merge 1 commit into
pulp:mainfrom
warisshaikh1:shared-sync-modal

Conversation

@warisshaikh1

Copy link
Copy Markdown
Contributor

Suggested by @Redtigercod4 while reviewing #347, as a precursor to it.

ansible-repository-sync and file-repository-sync each carried a byte identical copy of the sync modal, about ninety lines apiece, so the mirror and optimize wording had to be changed in two places. This moves it to src/components/sync-modal.tsx as it stood -- the only edit is the inline prop type becoming an IProps interface, the way the other components declare theirs.

No behaviour change. Both actions keep their own permission check, disabled reasons and sync call; only the modal is shared.

One thing I noticed but deliberately left alone, since this is meant to be a pure move: file-repository-sync gates on file.change_collectionremote, which looks like it was copied from the ansible original -- pulp_file has no collection remote, so I would expect something like file.change_filerepository there. Happy to fix it here or in its own PR, whichever you prefer.

Assisted By: Cursor (Claude Opus 5); reviewed by me before submitting.

ansible-repository-sync and file-repository-sync each carried a byte
identical copy of the modal, some ninety lines apiece, so the mirror and
optimize wording had to be changed in two places. Moved to
src/components/sync-modal.tsx as it stood; the only edit is the inline
prop type becoming an IProps interface, as the other components declare
theirs.

No behaviour change. Each action keeps its own permission check, its own
disabled reasons and its own sync call.

Refs pulp#347
Assisted By: Cursor (Claude Opus 5)
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.

1 participant