feat(templates): fix unresponsive action dropdown for non-admin
Two changes that together restore the per-row Edit / Delete menu for non-admin users: - ``templateActions`` drops the blanket ``access: 'canSeeAdmin'`` gate on every menu item. With the gate on, non-admin callers got an empty filtered menu, so clicking the "..." did nothing. - The management page passes ``mine=true`` to the list API. The endpoint now drops Global rows for non-admin callers (rows they can't edit anyway), so the dropdown shows up only on rows the caller may manage. The GPU-instance create picker reuses the same API without ``mine``, keeping Global presets visible there.
This commit is contained in:
@@ -45,7 +45,13 @@ const GPUServiceTemplates: React.FC = () => {
|
||||
isInfiniteScroll: true,
|
||||
contentForDelete: intl.formatMessage({ id: 'gpuservice.template' }),
|
||||
defaultQueryParams: {
|
||||
perPage: 24
|
||||
perPage: 24,
|
||||
// Management view: drop Global rows for non-admin callers — the
|
||||
// page is a CRUD surface, and admin-curated Global templates
|
||||
// they can't edit only add visual noise. The instance-create
|
||||
// picker (uses ``useQueryTemplates`` separately) doesn't set
|
||||
// this and so still sees Global presets.
|
||||
mine: true
|
||||
}
|
||||
});
|
||||
const { openTemplateModalStatus, openTemplateModal, closeTemplateModal } =
|
||||
|
||||
Reference in New Issue
Block a user