Files
threshold-ui/ui/admin/app/components/form/credential/index.js
T

24 lines
595 B
JavaScript
Raw Normal View History

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
2022-12-12 16:37:01 -08:00
import Component from '@glimmer/component';
import { inject as service } from '@ember/service';
import { types } from 'api/models/credential';
export default class FormCredentialComponent extends Component {
// =services
@service features;
// =attributes
/**
* Returns an array of available credential types the user can create
* @type {object}
*/
get credentialTypes() {
return this.features.isEnabled('json-credentials')
? types
: types.filter((type) => type !== 'json');
}
}