Jordan Reimer 8700becc45
[UI] Ember Data Migration - API Property Casing (#31325)
* updates api client vars to snake_case for custom messages

* updates api client vars to snake_case for tools

* updates api client vars to snake_case for sync

* updates api client vars to snake_case for secrets engine

* updates api client vars to snake_case for auth

* updates api client vars to snake_case for usage

* updates api client dep to point to gh repo

* fixes custom-messages service unit tests

* fixes configure-ssh test

* fixes configure-ssh test...again
2025-07-18 09:32:01 -06:00

59 lines
1.9 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}
<Messages::TabPageHeader
@authenticated={{@message.authenticated}}
@pageTitle={{@message.title}}
@breadcrumbs={{@breadcrumbs}}
/>
<Toolbar>
<ToolbarActions aria-label="message delete and edit">
{{#if @capabilities.canDelete}}
<ConfirmAction
class="toolbar-button"
@buttonColor="secondary"
@onConfirmAction={{this.deleteMessage}}
@confirmTitle="Are you sure?"
@confirmMessage="This will delete this message permanently. You cannot undo this action."
@buttonText="Delete message"
/>
<div class="toolbar-separator"></div>
{{/if}}
{{#if @capabilities.canUpdate}}
<LinkTo class="toolbar-link" @route="messages.message.edit" @model={{@message.id}} data-test-link-to="edit">
Edit message
<Icon @name="chevron-right" />
</LinkTo>
{{/if}}
</ToolbarActions>
</Toolbar>
{{#each this.displayFields as |field|}}
{{#if (or (eq field "end_time") (eq field "start_time"))}}
{{! if the attr is an end_time and is falsy, we want to show a 'Never' text value }}
<InfoTableRow
@label={{capitalize (humanize (dasherize field))}}
@value={{if
(and (eq field "end_time") (not (get @message field)))
"Never"
(date-format (get @message field) "MMM d, yyyy hh:mm aaa" withTimeZone=true)
}}
/>
{{else if (eq field "link")}}
{{#if (is-empty-value @message.link)}}
<InfoTableRow @label="Link" @value="None" />
{{else}}
{{#each-in @message.link as |title href|}}
<InfoTableRow @label="Link" @value={{title}}>
<Hds::Link::Inline @icon="external-link" @href={{href}} data-test-link="message link">{{title}}</Hds::Link::Inline>
</InfoTableRow>
{{/each-in}}
{{/if}}
{{else}}
<InfoTableRow @label={{capitalize (humanize (dasherize field))}} @value={{get @message field}} />
{{/if}}
{{/each}}