Skip to content

Commit

Permalink
Repository sync - warn about community set to signed_only (#4411) (#4413
Browse files Browse the repository at this point in the history
)

follows #4385, #4392

No-Issue

(cherry picked from commit 5b0a830)

Co-authored-by: Martin Hradil <mhradil@redhat.com>
  • Loading branch information
patchback[bot] and himdel committed Oct 16, 2023
1 parent e94913e commit 7272c20
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions src/actions/ansible-repository-sync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,29 @@ export const ansibleRepositorySyncAction = Action({
return t`Sync task is already queued.`;
}

// only available on detail screen; list will have remote: string, so no .url
if (
remote &&
remote.url === 'https://galaxy.ansible.com/api/' &&
!remote.requirements_file
) {
// Remote checks only available on detail screen; list will have remote: string, so no .url
if (remote && remote.url === 'https://galaxy.ansible.com/api/') {
const name = remote.name;
const url = formatPath(Paths.ansibleRemoteEdit, { name });

return (
<Trans>
YAML requirements are required to sync from Galaxy - you can{' '}
<Link to={url}>edit the {name} remote</Link> to add requirements.
</Trans>
);
if (!remote.requirements_file) {
return (
<Trans>
YAML requirements are required to sync from Galaxy. You can{' '}
<Link to={url}>edit the {name} remote</Link> to add requirements.
</Trans>
);
}

if (remote.signed_only) {
return (
<Trans>
Community content will never be synced if the remote is set to only
sync signed content. You can{' '}
<Link to={url}>edit the {name} remote</Link> to change it.
</Trans>
);
}
}

return null;
Expand Down

0 comments on commit 7272c20

Please sign in to comment.