FIX: Allow plugins to override admin component templates

This commit is contained in:
Robin Ward 2018-01-10 13:14:16 -05:00
parent 01726e68ab
commit 17213887a1
2 changed files with 3 additions and 2 deletions

View File

@ -11,7 +11,7 @@
input=suspendUntil}} input=suspendUntil}}
</label> </label>
</div> </div>
{{suspension-details reason=reason message=message}} {{suspension-details reason=reason message=message tagName=''}}
{{else}} {{else}}
<div class='cant-suspend'> <div class='cant-suspend'>

View File

@ -195,7 +195,8 @@ export function buildResolver(baseName) {
findAdminTemplate(parsedName) { findAdminTemplate(parsedName) {
var decamelized = parsedName.fullNameWithoutType.decamelize(); var decamelized = parsedName.fullNameWithoutType.decamelize();
if (decamelized.indexOf('components') === 0) { if (decamelized.indexOf('components') === 0) {
const compTemplate = Ember.TEMPLATES['admin/templates/' + decamelized]; let comPath = `admin/templates/${decamelized}`;
const compTemplate = Ember.TEMPLATES[`javascripts/${comPath}`] || Ember.TEMPLATES[comPath];
if (compTemplate) { return compTemplate; } if (compTemplate) { return compTemplate; }
} }