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: '',
|
|
|
|
|
|
|
|
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}`;
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
});
|