diff --git a/projects/start-os/CHANGELOG.md b/projects/start-os/CHANGELOG.md index ed2f7a0de..ab17eba6c 100644 --- a/projects/start-os/CHANGELOG.md +++ b/projects/start-os/CHANGELOG.md @@ -61,6 +61,10 @@ file tracks notable changes since the move to the monorepo. plaintext address, including the passwords typed into it. See [Gateways](https://docs.start9.com/start-os/gateways.html). +- **An action result that hands you a link can be opened in a new tab.** Where a + service returns a URL — an authorization link, an admin panel — the result + shows an open-in-new-tab button beside it. + ### Changed - **Your server's name is now its `.local` address, without the `.local` on the diff --git a/projects/start-os/web/ui/src/app/routes/portal/routes/services/modals/action-success/action-success-member.component.ts b/projects/start-os/web/ui/src/app/routes/portal/routes/services/modals/action-success/action-success-member.component.ts index 0313395d0..8570c6336 100644 --- a/projects/start-os/web/ui/src/app/routes/portal/routes/services/modals/action-success/action-success-member.component.ts +++ b/projects/start-os/web/ui/src/app/routes/portal/routes/services/modals/action-success/action-success-member.component.ts @@ -44,6 +44,21 @@ import { QRComponent } from 'src/app/routes/portal/components/qr.component' {{ 'Copy' | i18n }} } + @if (member.launchable) { + + {{ 'Open' | i18n }} + + } @if (member.qr) { } + @if (single.launchable) { + + {{ 'Open' | i18n }} + + } Self::V1(a), @@ -192,12 +193,18 @@ pub enum ActionResultValue { /// The actual string value to display. The UI renders it as a single-line field — /// multi-line text belongs in the result's `message`. value: String, - /// Whether or not to include a copy to clipboard icon to copy the value - copyable: bool, - /// Whether or not to also display the value as a QR code - qr: bool, - /// Whether or not to mask the value using ●●●●●●●, which is useful for password or other sensitive information - masked: bool, + /// (optional) Whether or not to include a copy to clipboard icon to copy the value + #[ts(optional)] + copyable: Option, + /// (optional) Whether or not to also display the value as a QR code + #[ts(optional)] + qr: Option, + /// (optional) Whether or not to mask the value using ●●●●●●●, which is useful for password or other sensitive information + #[ts(optional)] + masked: Option, + /// (optional) Whether or not to include an open in new tab icon to launch the value, which must be an http(s) URL + #[ts(optional)] + launchable: Option, }, Group { /// An new group of nested values, experienced by the user as an accordion dropdown @@ -212,7 +219,7 @@ impl ActionResultValue { write!(f, " ")?; } write!(f, "{value}")?; - if *qr { + if qr.unwrap_or_default() { use qrcode::render::unicode; writeln!(f)?; for _ in 0..indent { diff --git a/shared-libs/ts-modules/start-core/lib/osBindings/ActionResultMember.ts b/shared-libs/ts-modules/start-core/lib/osBindings/ActionResultMember.ts index 9f3a28973..b8c5ee5c6 100644 --- a/shared-libs/ts-modules/start-core/lib/osBindings/ActionResultMember.ts +++ b/shared-libs/ts-modules/start-core/lib/osBindings/ActionResultMember.ts @@ -18,17 +18,21 @@ export type ActionResultMember = { */ value: string /** - * Whether or not to include a copy to clipboard icon to copy the value + * (optional) Whether or not to include a copy to clipboard icon to copy the value */ - copyable: boolean + copyable?: boolean /** - * Whether or not to also display the value as a QR code + * (optional) Whether or not to also display the value as a QR code */ - qr: boolean + qr?: boolean /** - * Whether or not to mask the value using ●●●●●●●, which is useful for password or other sensitive information + * (optional) Whether or not to mask the value using ●●●●●●●, which is useful for password or other sensitive information */ - masked: boolean + masked?: boolean + /** + * (optional) Whether or not to include an open in new tab icon to launch the value, which must be an http(s) URL + */ + launchable?: boolean } | { type: 'group' diff --git a/shared-libs/ts-modules/start-core/lib/osBindings/ActionResultValue.ts b/shared-libs/ts-modules/start-core/lib/osBindings/ActionResultValue.ts index fa4c733f7..dc2ce28ea 100644 --- a/shared-libs/ts-modules/start-core/lib/osBindings/ActionResultValue.ts +++ b/shared-libs/ts-modules/start-core/lib/osBindings/ActionResultValue.ts @@ -10,17 +10,21 @@ export type ActionResultValue = */ value: string /** - * Whether or not to include a copy to clipboard icon to copy the value + * (optional) Whether or not to include a copy to clipboard icon to copy the value */ - copyable: boolean + copyable?: boolean /** - * Whether or not to also display the value as a QR code + * (optional) Whether or not to also display the value as a QR code */ - qr: boolean + qr?: boolean /** - * Whether or not to mask the value using ●●●●●●●, which is useful for password or other sensitive information + * (optional) Whether or not to mask the value using ●●●●●●●, which is useful for password or other sensitive information */ - masked: boolean + masked?: boolean + /** + * (optional) Whether or not to include an open in new tab icon to launch the value, which must be an http(s) URL + */ + launchable?: boolean } | { type: 'group'