[go: nahoru, domu]

Skip to content

Commit

Permalink
ui: fix device rename permission in device details
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo R.S. Joao <leonardo.joao@ossystems.com.br>
  • Loading branch information
leonardojoao authored and otavio committed Feb 24, 2022
1 parent b8c089e commit 21bda04
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
37 changes: 28 additions & 9 deletions ui/src/components/device/DeviceDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,34 @@
</template>

<v-card>
<v-list-item @click.stop="openDialog('deviceRenameShow')">
<DeviceRename
:name="device.name"
:uid="device.uid"
:show.sync="deviceRenameShow"
data-test="deviceRename-component"
@newHostname="receiveName"
/>
</v-list-item>
<v-tooltip
bottom
:disabled="hasAuthorizationRename"
>
<template #activator="{ on, attrs }">
<div
v-bind="attrs"
v-on="on"
>
<v-list-item
:disabled="!hasAuthorizationRename"
@click.stop="openDialog('deviceRenameShow')"
>
<DeviceRename
:name="device.name"
:uid="device.uid"
:show.sync="deviceRenameShow"
data-test="deviceRename-component"
@newHostname="receiveName"
/>
</v-list-item>
</div>
</template>

<span>
You don't have this kind of authorization.
</span>
</v-tooltip>

<v-tooltip
bottom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ exports[`DeviceDetails Offline Device Renders the component 1`] = `
<v-spacer-stub tag="div"></v-spacer-stub>
<v-menu-stub opendelay="0" closedelay="0" openonclick="true" contentclass="" maxwidth="auto" nudgebottom="0" nudgeleft="0" nudgeright="0" nudgetop="0" nudgewidth="0" closeonclick="true" closeoncontentclick="true" maxheight="auto" offsety="true" origin="top left" transition="v-menu-transition">
<v-card-stub loaderheight="4" tag="div">
<v-list-item-stub activeclass="" tag="div">
<devicerename-stub name="39-5e-2a" uid="a582b47a" data-test="deviceRename-component"></devicerename-stub>
</v-list-item-stub>
<v-tooltip-stub opendelay="0" closedelay="0" bottom="true" openonclick="true" openonhover="true" openonfocus="true" contentclass="" maxwidth="auto" nudgebottom="0" nudgeleft="0" nudgeright="0" nudgetop="0" nudgewidth="0" tag="span"> <span>
You don't have this kind of authorization.
</span></v-tooltip-stub>
<v-tooltip-stub opendelay="0" closedelay="0" bottom="true" openonclick="true" openonhover="true" openonfocus="true" contentclass="" maxwidth="auto" nudgebottom="0" nudgeleft="0" nudgeright="0" nudgetop="0" nudgewidth="0" tag="span"> <span>
You don't have this kind of authorization.
</span></v-tooltip-stub>
Expand Down Expand Up @@ -114,9 +114,9 @@ exports[`DeviceDetails Online Device and owner Renders the component 1`] = `
<v-spacer-stub tag="div"></v-spacer-stub>
<v-menu-stub opendelay="0" closedelay="0" openonclick="true" contentclass="" maxwidth="auto" nudgebottom="0" nudgeleft="0" nudgeright="0" nudgetop="0" nudgewidth="0" closeonclick="true" closeoncontentclick="true" maxheight="auto" offsety="true" origin="top left" transition="v-menu-transition">
<v-card-stub loaderheight="4" tag="div">
<v-list-item-stub activeclass="" tag="div">
<devicerename-stub name="39-5e-2a" uid="a582b47a" data-test="deviceRename-component"></devicerename-stub>
</v-list-item-stub>
<v-tooltip-stub opendelay="0" closedelay="0" bottom="true" disabled="true" openonclick="true" openonhover="true" openonfocus="true" contentclass="" maxwidth="auto" nudgebottom="0" nudgeleft="0" nudgeright="0" nudgetop="0" nudgewidth="0" tag="span"> <span>
You don't have this kind of authorization.
</span></v-tooltip-stub>
<v-tooltip-stub opendelay="0" closedelay="0" bottom="true" disabled="true" openonclick="true" openonhover="true" openonfocus="true" contentclass="" maxwidth="auto" nudgebottom="0" nudgeleft="0" nudgeright="0" nudgetop="0" nudgewidth="0" tag="span"> <span>
You don't have this kind of authorization.
</span></v-tooltip-stub>
Expand Down

0 comments on commit 21bda04

Please sign in to comment.