* feat: 🎸 implement helper Implement `time-remainig` helper to display duration of a session for desktop app. ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-10487 * refactor: 💡 Refactored scenarios Refactored `ipc.js` scenario to include `expiration_time` for a new session. ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-10487 * fix: 🐛 Fix add expiration_time when user has no grants to read (#2024) * refactor: 💡 refactor styles Removed `div` and added `Hds::Badge` to `h1` element. Condensed and renamed styling for title to `session-details-info` ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-10487 * Refactored `projects/targets` controller to return the correct `expiration_time` field returned from CLI. Cleaned up CSS for `session-details-info` attribute and wrapped `@model.displayname` in span tag. ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-10487 * Update ui/desktop/app/controllers/scopes/scope/projects/targets/index.js mixed naming expiration field on payload to store Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com> * refactor: 💡 refactored page header Refactored `sessions` header to use `<Hds::Text::Dislpay/>` instead of a span. ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-10487 * refactor: 💡 refactor cli response Refactor `expiration` field from CLI response to be the correct definition ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-10487 * refactor: 💡 refactor sessions layout Removed span as parent of header information, and pushed styles to yielded page.header. Fixed stub in test ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-10487 --------- Co-authored-by: Carlos Alcaide Corvo <ccorvo@hashicorp.com> Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
38 lines
906 B
Handlebars
38 lines
906 B
Handlebars
{{!
|
|
Copyright (c) HashiCorp, Inc.
|
|
SPDX-License-Identifier: MPL-2.0
|
|
}}
|
|
|
|
{{page-title @model.displayName}}
|
|
|
|
<Rose::Layout::Page as |page|>
|
|
|
|
<page.header class='session-details-info'>
|
|
<Hds::IconTile @color='boundary' @icon='terminal' />
|
|
<Hds::Text::Display @tag='h1' @size='500'>
|
|
{{@model.displayName}}
|
|
</Hds::Text::Display>
|
|
<Hds::Badge
|
|
@text={{time-remaining @model.expiration_time}}
|
|
@icon='loading'
|
|
/>
|
|
</page.header>
|
|
|
|
<page.actions>
|
|
{{#if (can 'cancel session' @model)}}
|
|
<Hds::Button
|
|
data-test-session-detail-cancel-button
|
|
@text={{t 'resources.session.actions.end'}}
|
|
@icon='x'
|
|
@color='secondary'
|
|
{{on 'click' (route-action 'cancelSession' @model)}}
|
|
/>
|
|
{{/if}}
|
|
|
|
</page.actions>
|
|
|
|
<page.body class='details-screen-body'>
|
|
<Session::Tabs @model={{@model}} />
|
|
</page.body>
|
|
|
|
</Rose::Layout::Page> |