open-vault/ui/app/templates/components/secret-list/transform-list-item.hbs
Angel Garbarino 98c2ba2e6c
secret-list/item partial removed (#11710)
* secret-list/item partial removed

* remove all partials and I'm sure break many things.

* changing props types and breaking more things

* cleanup

* fix options for backend

* fix transform list item test
2021-06-02 08:59:31 -06:00

84 lines
2.5 KiB
Handlebars

{{#if (and @item.updatePath.canRead (not this.isBuiltin))}}
{{#linked-block
"vault.cluster.secrets.backend.show"
@itemPath
class="list-item-row"
data-test-secret-link=@itemPath
encode=true
queryParams=(secret-query-params @backendType)
}}
<div class="columns is-mobile">
<div class="column is-10">
<SecretLink
@mode="show"
@secret={{@itemPath}}
@queryParams={{query-params type=@modelType}}
@class="has-text-black has-text-weight-semibold">
<Icon
@glyph='file-outline'
@class="has-text-grey-light"/>
{{if (eq @item.id ' ') '(self)' (or @item.keyWithoutParent @item.id)}}
</SecretLink>
</div>
<div class="column has-text-right">
{{#if (or @item.updatePath.canRead @item.updatePath.canUpdate)}}
<PopupMenu name="secret-menu">
<nav class="menu">
<ul class="menu-list">
{{#if @item.updatePath.canRead}}
<li class="action">
<SecretLink
@mode="show"
@secret={{@itemPath}}
@class="has-text-black has-text-weight-semibold">
Details
</SecretLink>
</li>
{{/if}}
{{#if @item.updatePath.canUpdate}}
<li class="action">
<SecretLink
@mode="edit"
@secret={{@itemPath}}
@class="has-text-black has-text-weight-semibold">
Edit
</SecretLink>
</li>
{{/if}}
</ul>
</nav>
</PopupMenu>
{{/if}}
</div>
</div>
{{/linked-block}}
{{else}}
<div class="list-item-row" data-test-view-only-list-item>
<div class="columns is-mobile">
<div class="column is-12 has-text-grey has-text-weight-semibold">
<Icon
@glyph='file-outline'
@class="has-text-grey-light"/>
{{#if this.isBuiltin}}
<ToolTip
@verticalPosition="above"
@horizontalPosition="left"
as |T|>
<T.trigger @tabindex=false>
{{@item.id}}
</T.trigger>
<T.content @class="tool-tip">
<div class="box">
This is a built-in HashiCorp {{@itemType}}. It can't be viewed or edited.
</div>
</T.content>
</ToolTip>
{{else}}
{{@item.id}}
{{/if}}
</div>
</div>
</div>
{{/if}}