Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(copy-uuid): add option to completely hide uuid [MA-1908] #652

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/core/copy-uuid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ A Kong UI component for displaying uuid and copying it to clipboard.
- [`iconColor`](#iconcolor)
- [`tooltip`](#tooltip)
- [`successTooltip`](#successtooltip)
- [`showUuid`](#showuuid)
- [Events](#events)
- [`success`](#success)
- [`error`](#error)
Expand Down Expand Up @@ -205,6 +206,14 @@ Tooltip text to display on hovering over the copy icon. This field is required i
Note: The `tooltip` prop is required to have a value in order to use this prop. When using this prop the `@success` and `@error` events will not be fired, as the tooltip text will be updated instead.
Tooltip text to display on successful copy.

### `showUuid`

- type: `Boolean`
- required: `false`
- default: `true`

If false the UUID will not be shown at all. Useful for the case the host app wants to display something that the uuid resolves to, but still be able to copy the uuid behind the scenes.
filipgutica marked this conversation as resolved.
Show resolved Hide resolved

## Events

Success and error events are only emitted if NOT using the `successTooltip` prop.
Expand Down
7 changes: 7 additions & 0 deletions packages/core/copy-uuid/sandbox/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
:uuid="uuid"
/>
</div>
<div>
<h3>Don't show uuid</h3>
<CopyUuid
:show-uuid="false"
:uuid="uuid"
/>
</div>
</main>
</div>
</template>
Expand Down
9 changes: 8 additions & 1 deletion packages/core/copy-uuid/src/components/CopyUuid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
useMono ? 'mono' : null
]"
>
{{ isHidden ? '**********' : uuid }}
<span v-if="showUuid">
{{ isHidden ? '**********' : uuid }}
</span>
</div>
</div>
<component
Expand Down Expand Up @@ -82,6 +84,11 @@ const props = defineProps({
type: String,
default: '',
},
showUuid: {
type: Boolean,
required: false,
default: true,
},
})

const emit = defineEmits<{
Expand Down