2023-04-10 15:36:59 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2022-04-21 17:57:18 +00:00
|
|
|
import { helper } from '@ember/component/helper';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Volume Name Formatter
|
|
|
|
*
|
|
|
|
* Usage: {{format-volume-name source=string isPerAlloc=boolean volumeExtension=string}}
|
|
|
|
*
|
|
|
|
* Outputs a title/link for volumes that are per_alloc-aware.
|
|
|
|
* (when a volume is per_alloc, its route location requires an additional extension)
|
|
|
|
*/
|
|
|
|
export function formatVolumeName(
|
|
|
|
_,
|
|
|
|
{ source = '', isPerAlloc, volumeExtension }
|
|
|
|
) {
|
|
|
|
return `${source}${isPerAlloc ? volumeExtension : ''}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default helper(formatVolumeName);
|