a5bef3ce72
* Allocation page linkfix * fix added to task page and computed prop moved to allocation model * Fallback query added to task group when specific volume isnt knowable * Delog * link text reflects alloc suffix * Helper instead of in-template conditionals * formatVolumeName unit test * Removing unused helper import
19 lines
518 B
JavaScript
19 lines
518 B
JavaScript
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);
|