From 4eb156f7070596298adaaa8650c99403108ef9f0 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 30 Jul 2020 11:15:03 -0500 Subject: [PATCH] Ui/ember blueprint updates (#9627) * Import layout in blueprint if generator used with --in flag * Generated story works with hot reloading out of the box --- ui/blueprints/component/index.js | 2 +- .../story/files/__path__/stories/__name__.stories.js | 8 +++----- ui/blueprints/story/index.js | 2 -- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ui/blueprints/component/index.js b/ui/blueprints/component/index.js index 4fbc5f50e..7260873ab 100644 --- a/ui/blueprints/component/index.js +++ b/ui/blueprints/component/index.js @@ -58,7 +58,7 @@ module.exports = { let contents = ''; // if we're in an addon, build import statement - if (options.project.isEmberCLIAddon() || (options.inRepoAddon && !options.inDummy)) { + if (options.project.isEmberCLIAddon() || (options.inRepoAddon && !options.inDummy) || !!options.in) { if (options.pod) { templatePath = './template'; } else { diff --git a/ui/blueprints/story/files/__path__/stories/__name__.stories.js b/ui/blueprints/story/files/__path__/stories/__name__.stories.js index cef442e4e..38af83e4c 100644 --- a/ui/blueprints/story/files/__path__/stories/__name__.stories.js +++ b/ui/blueprints/story/files/__path__/stories/__name__.stories.js @@ -1,16 +1,14 @@ - import hbs from 'htmlbars-inline-precompile'; import { storiesOf } from '@storybook/ember'; -<%= importMD %> +import { withKnobs } from '@storybook/addon-knobs'; storiesOf('<%= classifiedModuleName %>', module) .addParameters({ options: { showPanel: true } }) + .addDecorator(withKnobs()) .add(`<%= classifiedModuleName %>`, () => ({ template: hbs`
<%= header %>
<<%= classifiedModuleName %>/> `, context: {}, - }), - {notes} -); + })); diff --git a/ui/blueprints/story/index.js b/ui/blueprints/story/index.js index 497e4fd54..504fb24cd 100644 --- a/ui/blueprints/story/index.js +++ b/ui/blueprints/story/index.js @@ -38,9 +38,7 @@ module.exports = { locals: function(options) { let contents = ''; - let importMD = "import notes from './" + stringUtil.dasherize(options.entity.name) + ".md';\n"; return { - importMD: importMD, contents: contents, path: getPathOption(options), header: stringUtil