From fe7007d06866cab141cfc3838538db69a43154a7 Mon Sep 17 00:00:00 2001 From: Westly Wright Date: Thu, 16 Mar 2017 16:25:33 -0700 Subject: [PATCH] add new modal blueprint --- blueprints/.jshintrc | 4 +++- .../components/__name__-__path__/component.js | 6 ++++++ .../components/__name__-__path__/template.hbs | 4 ++++ blueprints/modal/index.js | 16 ++++++++++++++++ blueprints/route/index.js | 2 +- 5 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 blueprints/modal/files/app/components/__name__-__path__/component.js create mode 100644 blueprints/modal/files/app/components/__name__-__path__/template.hbs create mode 100644 blueprints/modal/index.js diff --git a/blueprints/.jshintrc b/blueprints/.jshintrc index c189e4a7d..68b2b3584 100644 --- a/blueprints/.jshintrc +++ b/blueprints/.jshintrc @@ -1,5 +1,7 @@ { "predef": [ "console" - ] + ], + "strict": false, + "esversion": 6 } diff --git a/blueprints/modal/files/app/components/__name__-__path__/component.js b/blueprints/modal/files/app/components/__name__-__path__/component.js new file mode 100644 index 000000000..867e15fcd --- /dev/null +++ b/blueprints/modal/files/app/components/__name__-__path__/component.js @@ -0,0 +1,6 @@ +import Ember from 'ember'; +import ModalBase from 'ui/mixins/modal-base'; + +export default Ember.Component.extend(ModalBase, { + classNames: [`${<%= size %>}`], +}); diff --git a/blueprints/modal/files/app/components/__name__-__path__/template.hbs b/blueprints/modal/files/app/components/__name__-__path__/template.hbs new file mode 100644 index 000000000..555ff3980 --- /dev/null +++ b/blueprints/modal/files/app/components/__name__-__path__/template.hbs @@ -0,0 +1,4 @@ +
+
+ \ No newline at end of file diff --git a/blueprints/modal/index.js b/blueprints/modal/index.js new file mode 100644 index 000000000..5884d49f8 --- /dev/null +++ b/blueprints/modal/index.js @@ -0,0 +1,16 @@ +/*jshint node:true*/ +module.exports = { + description: 'Rancher specific modal', + + locals: function(options) { + // Return custom template variables here. + return { + // options are large-modal or medium-modal + size: `${options.entity.options.size}` || 'medium-modal' + }; + } + + // afterInstall: function(options) { + // // Perform extra work here. + // } +}; diff --git a/blueprints/route/index.js b/blueprints/route/index.js index 9ab93af83..46c7bad4c 100644 --- a/blueprints/route/index.js +++ b/blueprints/route/index.js @@ -1 +1 @@ -module.exports = require('../../node_modules/ember-cli/blueprints/route/index.js'); +module.exports = require('../../node_modules/ember-cli-legacy-blueprints/blueprints/route/index.js');