2019-07-02 21:42:38 +00:00
|
|
|
import Component from '@ember/component';
|
|
|
|
import { computed } from '@ember/object';
|
|
|
|
import { isEmpty } from '@ember/utils';
|
|
|
|
|
|
|
|
export default Component.extend({
|
|
|
|
tagName: '',
|
|
|
|
|
2020-06-01 13:15:59 +00:00
|
|
|
allocation: null,
|
2020-06-01 19:03:56 +00:00
|
|
|
taskState: null,
|
2020-06-01 13:15:59 +00:00
|
|
|
|
2019-07-02 21:42:38 +00:00
|
|
|
pathToEntry: computed('path', 'entry.Name', function() {
|
|
|
|
const pathWithNoLeadingSlash = this.get('path').replace(/^\//, '');
|
2019-08-12 20:51:38 +00:00
|
|
|
const name = encodeURIComponent(this.get('entry.Name'));
|
2019-07-02 21:42:38 +00:00
|
|
|
|
|
|
|
if (isEmpty(pathWithNoLeadingSlash)) {
|
|
|
|
return name;
|
|
|
|
} else {
|
|
|
|
return `${pathWithNoLeadingSlash}/${name}`;
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
});
|