vault/ui/app/models/transform/alphabet.js
Angel Garbarino 9506160c7d
Glimmerize old components (#24068)
* update transforms

* glimmer transform alphabet

* move alphabet edit

* license info and remove block error

* logo edition

* not found

* Update ui/app/components/logo-edition.js

Co-authored-by: Kianna <30884335+kiannaquach@users.noreply.github.com>

* ad js docs

---------

Co-authored-by: Kianna <30884335+kiannaquach@users.noreply.github.com>
2023-11-10 12:43:44 -07:00

45 lines
1.1 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import Model, { attr } from '@ember-data/model';
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
export default class Alphabet extends Model {
idPrefix = 'alphabet/';
get idForNav() {
const modelId = this.id || '';
return `${this.idPrefix}${modelId}`;
}
@attr('string', {
readOnly: true,
subText: 'The alphabet name. Keep in mind that spaces are not allowed and this cannot be edited later.',
})
name;
@attr('string', {
label: 'Alphabet',
subText:
'Provide the set of valid UTF-8 characters contained within both the input and transformed value.',
docLink: '/vault/api-docs/secret/transform#create-update-alphabet',
})
alphabet;
get attrs() {
const keys = ['name', 'alphabet'];
return expandAttributeMeta(this, keys);
}
@attr('string', {
readOnly: true,
})
backend;
@lazyCapabilities(apiPath`${'backend'}/alphabet/${'id'}`, 'backend', 'id')
updatePath;
}