From 896263e3e189b0b2c5070540c06f46652dbb7037 Mon Sep 17 00:00:00 2001 From: Sam Selikoff Date: Wed, 12 Jun 2019 10:18:00 -0400 Subject: [PATCH] Add showImportPaths option --- addon/components/api/x-class/component.js | 5 +++++ addon/components/api/x-class/template.hbs | 2 +- addon/components/api/x-section/component.js | 5 +++++ addon/components/api/x-section/template.hbs | 2 +- index.js | 3 ++- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/addon/components/api/x-class/component.js b/addon/components/api/x-class/component.js index 37456f5e2..1ce756d62 100644 --- a/addon/components/api/x-class/component.js +++ b/addon/components/api/x-class/component.js @@ -3,6 +3,9 @@ import { computed } from '@ember/object'; import { or } from '@ember/object/computed'; import { capitalize } from '@ember/string'; import { memberFilter } from '../../../utils/computed'; +import config from 'dummy/config/environment'; + +const { showImportPaths } = config['ember-cli-addon-docs']; import layout from './template'; @@ -10,6 +13,8 @@ export default Component.extend({ layout, tagName: '', + showImportPaths, + showInherited: false, showProtected: false, showPrivate: false, diff --git a/addon/components/api/x-class/template.hbs b/addon/components/api/x-class/template.hbs index 60de60e0a..7ee3ede29 100644 --- a/addon/components/api/x-class/template.hbs +++ b/addon/components/api/x-class/template.hbs @@ -3,7 +3,7 @@ {{! wrapping in a div seems to work around https://github.com/ember-learn/ember-cli-addon-docs/issues/7 }}
{{{class.description}}}
-{{#if (or class.exportType hasToggles)}} +{{#if (or (and class.exportType showImportPaths) hasToggles)}} {{#api/x-meta-panel as |panel|}} {{#if class.exportType}} {{#panel.header}} diff --git a/addon/components/api/x-section/component.js b/addon/components/api/x-section/component.js index 919608159..3b7fc5f3e 100644 --- a/addon/components/api/x-section/component.js +++ b/addon/components/api/x-section/component.js @@ -1,6 +1,9 @@ import Component from '@ember/component'; import { computed } from '@ember/object'; import layout from './template'; +import config from 'dummy/config/environment'; + +const { showImportPaths } = config['ember-cli-addon-docs']; /** @class Api/XSection @@ -10,6 +13,8 @@ export default Component.extend({ layout, tagName: '', + showImportPaths, + /** * Params shouldn't be displayed when there are no descriptions and no subparams, * because the information is already displayed in the type signature and redundant diff --git a/addon/components/api/x-section/template.hbs b/addon/components/api/x-section/template.hbs index 4004b37d2..cb2664c8d 100644 --- a/addon/components/api/x-section/template.hbs +++ b/addon/components/api/x-section/template.hbs @@ -26,7 +26,7 @@ {{{item.description}}}

- {{#if (or item.exportType shouldDisplayParams)}} + {{#if (or (and item.exportType showImportPaths) shouldDisplayParams)}} {{#api/x-meta-panel as |panel|}} {{#if item.exportType}} {{#panel.header}} diff --git a/index.js b/index.js index 8ba5d6c43..761dd579b 100644 --- a/index.js +++ b/index.js @@ -51,7 +51,8 @@ module.exports = { primaryBranch: userConfig.getPrimaryBranch(), latestVersionName: LATEST_VERSION_NAME, deployVersion: 'ADDON_DOCS_DEPLOY_VERSION', - searchTokenSeparator: "\\s+" + searchTokenSeparator: "\\s+", + showImportPaths: true }, 'ember-component-css': { namespacing: false