diff --git a/ui/app/components/link-status.js b/ui/app/components/link-status.js index 153d4667ce..f7493ed4b5 100644 --- a/ui/app/components/link-status.js +++ b/ui/app/components/link-status.js @@ -14,7 +14,6 @@ import { inject as service } from '@ember/service'; */ export default class LinkStatus extends Component { - @service store; @service version; get state() { @@ -28,47 +27,14 @@ export default class LinkStatus extends Component { get timestamp() { try { - return this.state !== 'connected' ? this.args.status.split('since')[1].split('m=')[0].trim() : null; + return this.state !== 'connected' ? this.args.status.split('since')[1].split(';')[0].trim() : null; } catch { return null; } } - get message() { - if (this.args.status) { - const error = this.args.status.split('error:')[1] || ''; - const timestamp = this.timestamp ? ` [${this.timestamp}]` : ''; - const sinceTimestamp = timestamp ? ` since${timestamp}` : ''; - if (this.state === 'disconnected') { - // if generally disconnected hide the banner - return !error || error.includes('UNKNOWN') - ? null - : `Vault has been disconnected from HCP${sinceTimestamp}. Error: ${error}`; - } else if (this.state === 'connecting') { - if (error.includes('connection refused')) { - return `Vault has been trying to connect to HCP${sinceTimestamp}, but HCP is not reachable. Vault will try again soon.`; - } else if (error.includes('principal does not have permission to register as provider')) { - return `Vault tried connecting to HCP, but the Resource ID is invalid. Check your resource ID.${timestamp}`; - } else if (error.includes('cannot fetch token: 401 Unauthorized')) { - return `Vault tried connecting to HCP, but the authorization information is wrong. Update it and try again.${timestamp}`; - } else { - // catch all for any unknown errors or missing error - const errorMessage = error ? ` Error: ${error}` : ''; - return `Vault has been trying to connect to HCP${sinceTimestamp}. Vault will try again soon.${errorMessage}`; - } - } - } - return null; - } - - get showStatus() { - // enterprise only feature at this time but will expand to OSS in future release - if (!this.version.isEnterprise || !this.args.status) { - return false; - } - if (this.state !== 'connected' && !this.message) { - return false; - } - return true; + get error() { + const status = this.args.status; + return status && status !== 'connected' ? status.split('error:')[1] : null; } } diff --git a/ui/app/styles/core/buttons.scss b/ui/app/styles/core/buttons.scss index 9ae0a2e844..2d8cf8ffb1 100644 --- a/ui/app/styles/core/buttons.scss +++ b/ui/app/styles/core/buttons.scss @@ -280,5 +280,4 @@ a.button.disabled { font-size: inherit; font-weight: inherit; cursor: pointer; - color: $link; } diff --git a/ui/app/templates/components/link-status.hbs b/ui/app/templates/components/link-status.hbs index ba89101a9c..2ff89bd0dc 100644 --- a/ui/app/templates/components/link-status.hbs +++ b/ui/app/templates/components/link-status.hbs @@ -1,4 +1,4 @@ -{{#if this.showStatus}} +{{#if (and this.state this.version.isEnterprise)}} -{{/if}} \ No newline at end of file +{{/if}} + + + + + \ No newline at end of file diff --git a/ui/app/templates/components/oidc/scope-form.hbs b/ui/app/templates/components/oidc/scope-form.hbs index b5af5588b4..108aa8e45b 100644 --- a/ui/app/templates/components/oidc/scope-form.hbs +++ b/ui/app/templates/components/oidc/scope-form.hbs @@ -39,7 +39,7 @@ You can use Alt+Tab (Option+Tab on MacOS) in the code editor to skip to the next field. See