mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-03 20:17:59 +00:00 
			
		
		
		
	Co-authored-by: Chelsea Shaw <cshaw@hashicorp.com> Co-authored-by: clairebontempo@gmail.com <clairebontempo@gmail.com> Co-authored-by: Angel Garbarino <angel@hashicorp.com>
		
			
				
	
	
		
			35 lines
		
	
	
		
			866 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			866 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
/**
 | 
						|
 * Copyright (c) HashiCorp, Inc.
 | 
						|
 * SPDX-License-Identifier: MPL-2.0
 | 
						|
 */
 | 
						|
 | 
						|
import Component from '@glimmer/component';
 | 
						|
import { inject as service } from '@ember/service';
 | 
						|
 | 
						|
/**
 | 
						|
 * @module DashboardVaultVersionTitle
 | 
						|
 * DashboardVaultVersionTitle component are use to display the vault version title and the badges
 | 
						|
 *
 | 
						|
 * @example
 | 
						|
 * ```js
 | 
						|
 * <Dashboard::VaultVersionTitle />
 | 
						|
 * ```
 | 
						|
 */
 | 
						|
 | 
						|
export default class DashboardVaultVersionTitle extends Component {
 | 
						|
  @service version;
 | 
						|
  @service namespace;
 | 
						|
 | 
						|
  get versionHeader() {
 | 
						|
    return this.version.isEnterprise
 | 
						|
      ? `Vault v${this.version.version.slice(0, this.version.version.indexOf('+'))}`
 | 
						|
      : `Vault v${this.version.version}`;
 | 
						|
  }
 | 
						|
 | 
						|
  get namespaceDisplay() {
 | 
						|
    if (this.namespace.inRootNamespace) return 'root';
 | 
						|
    const parts = this.namespace.path?.split('/');
 | 
						|
    return parts[parts.length - 1];
 | 
						|
  }
 | 
						|
}
 |