Skip to content

Commit 9bf6a54

Browse files
authored
feat: Add showImportPaths option (#382)
1 parent b2ec9a3 commit 9bf6a54

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

addon/components/api/x-class/component.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@ import { computed } from '@ember/object';
33
import { or } from '@ember/object/computed';
44
import { capitalize } from '@ember/string';
55
import { memberFilter } from '../../../utils/computed';
6+
import config from 'dummy/config/environment';
7+
8+
const { showImportPaths } = config['ember-cli-addon-docs'];
69

710
import layout from './template';
811

912
export default Component.extend({
1013
layout,
1114
tagName: '',
1215

16+
showImportPaths,
17+
1318
showInherited: false,
1419
showProtected: false,
1520
showPrivate: false,

addon/components/api/x-class/template.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{! wrapping in a div seems to work around https://github.com/ember-learn/ember-cli-addon-docs/issues/7 }}
44
<div data-test-class-description>{{{class.description}}}</div>
55

6-
{{#if (or class.exportType hasToggles)}}
6+
{{#if (or (and class.exportType showImportPaths) hasToggles)}}
77
{{#api/x-meta-panel as |panel|}}
88
{{#if class.exportType}}
99
{{#panel.header}}

addon/components/api/x-section/component.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import Component from '@ember/component';
22
import { computed } from '@ember/object';
33
import layout from './template';
4+
import config from 'dummy/config/environment';
5+
6+
const { showImportPaths } = config['ember-cli-addon-docs'];
47

58
/**
69
@class Api/XSection
@@ -10,6 +13,8 @@ export default Component.extend({
1013
layout,
1114
tagName: '',
1215

16+
showImportPaths,
17+
1318
/**
1419
* Params shouldn't be displayed when there are no descriptions and no subparams,
1520
* because the information is already displayed in the type signature and redundant

addon/components/api/x-section/template.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{{{item.description}}}
2727
</p>
2828

29-
{{#if (or item.exportType shouldDisplayParams)}}
29+
{{#if (or (and item.exportType showImportPaths) shouldDisplayParams)}}
3030
{{#api/x-meta-panel as |panel|}}
3131
{{#if item.exportType}}
3232
{{#panel.header}}

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ module.exports = {
5151
primaryBranch: userConfig.getPrimaryBranch(),
5252
latestVersionName: LATEST_VERSION_NAME,
5353
deployVersion: 'ADDON_DOCS_DEPLOY_VERSION',
54-
searchTokenSeparator: "\\s+"
54+
searchTokenSeparator: "\\s+",
55+
showImportPaths: true
5556
},
5657
'ember-component-css': {
5758
namespacing: false

0 commit comments

Comments
 (0)