2998deac50
This is mostly a direct application of the ember-angle-brackets-codemod. I manually restored newlines in multi-line component invocations, usually preserving file line length except for now-non-positional link-to @route. I needed to rename task to taskState in some cases to avoid Ember Concurrency naming conflicts.
22 lines
549 B
JavaScript
22 lines
549 B
JavaScript
import Component from '@ember/component';
|
|
import { computed } from '@ember/object';
|
|
import { isEmpty } from '@ember/utils';
|
|
|
|
export default Component.extend({
|
|
tagName: '',
|
|
|
|
allocation: null,
|
|
taskState: null,
|
|
|
|
pathToEntry: computed('path', 'entry.Name', function() {
|
|
const pathWithNoLeadingSlash = this.get('path').replace(/^\//, '');
|
|
const name = encodeURIComponent(this.get('entry.Name'));
|
|
|
|
if (isEmpty(pathWithNoLeadingSlash)) {
|
|
return name;
|
|
} else {
|
|
return `${pathWithNoLeadingSlash}/${name}`;
|
|
}
|
|
}),
|
|
});
|