Commit a3114b49 authored by gfyoung's avatar gfyoung Committed by Miguel Rincon

Conditionally render Docker row checkbox

If visible when the user has no permissions,
it's confusing to be able to interact with
the UI and appear to be able to perform
actions on the registry list when you can't.
parent 9092e3de
......@@ -64,7 +64,12 @@ export default {
<template>
<list-item v-bind="$attrs" :selected="selected">
<template #left-action>
<gl-form-checkbox class="gl-m-0" :checked="selected" @change="$emit('select')" />
<gl-form-checkbox
v-if="Boolean(tag.destroy_path)"
class="gl-m-0"
:checked="selected"
@change="$emit('select')"
/>
</template>
<template #left-primary>
<div class="gl-display-flex gl-align-items-center">
......
title: Conditionally render Docker row checkbox
merge_request: 36000
author: gfyoung
type: fixed
......@@ -54,6 +54,14 @@ describe('tags list row', () => {
expect(findCheckbox().exists()).toBe(true);
});
it("does not exist when the row can't be deleted", () => {
const customTag = { ...tag, destroy_path: '' };
mountComponent({ ...defaultProps, tag: customTag });
expect(findCheckbox().exists()).toBe(false);
});
it('is wired to the selected prop', () => {
mountComponent({ ...defaultProps, selected: true });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment