-
Notifications
You must be signed in to change notification settings - Fork 4.3k
/
Copy pathsecret-list-header.js
34 lines (30 loc) · 1.24 KB
/
secret-list-header.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import Component from '@glimmer/component';
import { supportedSecretBackends } from 'vault/helpers/supported-secret-backends';
import { CONFIGURATION_ONLY } from 'vault/helpers/mountable-secret-engines';
/**
* @module SecretListHeader
* SecretListHeader component is breadcrumb, title with icon and menu with tabs component.
*
* Example is wrapped in back ticks because this component relies on routing and cannot render an isolated sample, so just rendering template sample
* @example
* ```
* <SecretListHeader @model={{this.model}} />
* ```
*
* @param {object} model - Model used to pull information about icon and title and backend type for navigation.
* @param {boolean} [isConfigure=false] - Boolean to determine if the configure tab should be shown.
*/
export default class SecretListHeader extends Component {
get isKV() {
return ['kv', 'generic'].includes(this.args.model.engineType);
}
get showListTab() {
// only show the list tab if the engine is not a configuration only engine and the UI supports it
const { engineType } = this.args.model;
return supportedSecretBackends().includes(engineType) && !CONFIGURATION_ONLY.includes(engineType);
}
}