diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000..1991fd3de --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1 @@ +5a494a97687a5b1e663d6a2eb82d80f1b6d0e62b diff --git a/app/components/api-index-filter.js b/app/components/api-index-filter.gjs similarity index 93% rename from app/components/api-index-filter.js rename to app/components/api-index-filter.gjs index 0519cef32..f865daee4 100644 --- a/app/components/api-index-filter.js +++ b/app/components/api-index-filter.gjs @@ -1,4 +1,4 @@ -/* eslint-disable ember/no-computed-properties-in-native-classes */ +/* eslint-disable ember/no-classic-components, ember/no-computed-properties-in-native-classes, ember/require-tagless-components */ import { classNames } from '@ember-decorators/component'; import { computed } from '@ember/object'; import Component from '@ember/component'; @@ -22,7 +22,8 @@ const filterDataComputedParams = * @extends Component<{ Args: Args, Blocks: Blocks }> */ @classNames('api-index-filter') -export default class ApiIndexFilter extends Component { +export default class ApiIndexFilter extends Component { @computed('model.methods.[]', filterDataComputedParams) get filteredMethods() { return this.filterItems('methods'); diff --git a/app/components/api-index-filter.hbs b/app/components/api-index-filter.hbs deleted file mode 100644 index 5293704e2..000000000 --- a/app/components/api-index-filter.hbs +++ /dev/null @@ -1 +0,0 @@ -{{yield this.filteredData}} diff --git a/app/components/api-index.js b/app/components/api-index.gjs similarity index 86% rename from app/components/api-index.js rename to app/components/api-index.gjs index 9b0ca360b..c11294a11 100644 --- a/app/components/api-index.js +++ b/app/components/api-index.gjs @@ -20,7 +20,10 @@ import Component from '@glimmer/component'; /** * @extends Component<{ Args: Args, Blocks: Blocks }> */ -export default class ApiIndex extends Component { +import { hash } from "@ember/helper"; +export default class ApiIndex extends Component { get sections() { return [ { diff --git a/app/components/api-index.hbs b/app/components/api-index.hbs deleted file mode 100644 index 781acb739..000000000 --- a/app/components/api-index.hbs +++ /dev/null @@ -1,5 +0,0 @@ -
-{{yield (hash - sections=this.sections) -}} -
\ No newline at end of file diff --git a/app/components/class-field-description.gjs b/app/components/class-field-description.gjs new file mode 100644 index 000000000..1d89f8884 --- /dev/null +++ b/app/components/class-field-description.gjs @@ -0,0 +1,117 @@ +/* eslint-disable prettier/prettier */ +import { inject as service } from '@ember/service'; +import Component from '@glimmer/component'; +import { action } from '@ember/object'; +import { on } from "@ember/modifier"; +import { fn, array, concat } from "@ember/helper"; +import svgJar from "ember-svg-jar/helpers/svg-jar"; +import join from "ember-composable-helpers/helpers/join"; +import mapBy from "ember-composable-helpers/helpers/map-by"; +import { LinkTo } from "@ember/routing"; +import githubLink from "ember-api-docs/helpers/github-link"; +import and from "ember-truth-helpers/helpers/and"; +import eq from "ember-api-docs/helpers/eq"; +import ImportExample from "ember-api-docs/components/import-example"; +import MarkdownToHtml from "ember-cli-showdown/components/markdown-to-html"; + +export default class ClassFieldDescription extends Component { + @service + legacyModuleMappings; + + get hasImportExample() { + return this.legacyModuleMappings.hasFunctionMapping( + this.args.field.name, + this.args.field.class + ); + } + + /** + * Callback for updating the anchor with the field name that was clicked by a user. + * + * @method updateAnchor + * @method fieldName String The name representing the field that was clicked. + */ + @action + updateAnchor(fieldName) { + this.args.updateAnchor?.(fieldName); + } +} diff --git a/app/components/class-field-description.hbs b/app/components/class-field-description.hbs deleted file mode 100644 index 177875269..000000000 --- a/app/components/class-field-description.hbs +++ /dev/null @@ -1,80 +0,0 @@ -
- {{!-- TODO: Fix this link for a11y --}} - - {{#if @model.module}} -
-
- Module: - {{@model.module}} -
-
- {{/if}} - - {{#if @field.since}} -

- Available since v{{@field.since}} -

- {{/if}} - {{#if (and (eq @field.static 1) (eq @field.itemtype 'method') this.hasImportExample)}} - - {{/if}} -
- {{#each @field.params as |param|}} -
-
{{param.name}}
-
{{param.type}}
-
- {{#if param.props}} -
- {{#each param.props as |prop|}} -
-
{{prop.name}}
-
{{prop.type}}
-
-
- {{/each}} -
- {{/if}} -
- {{/each}} - {{#if @field.return}} -
-
returns
-
{{@field.return.type}}
-
-
- {{/if}} -
- -
\ No newline at end of file diff --git a/app/components/class-field-description.js b/app/components/class-field-description.js deleted file mode 100644 index 3e9afe642..000000000 --- a/app/components/class-field-description.js +++ /dev/null @@ -1,26 +0,0 @@ -import { inject as service } from '@ember/service'; -import Component from '@glimmer/component'; -import { action } from '@ember/object'; - -export default class ClassFieldDescription extends Component { - @service - legacyModuleMappings; - - get hasImportExample() { - return this.legacyModuleMappings.hasFunctionMapping( - this.args.field.name, - this.args.field.class - ); - } - - /** - * Callback for updating the anchor with the field name that was clicked by a user. - * - * @method updateAnchor - * @method fieldName String The name representing the field that was clicked. - */ - @action - updateAnchor(fieldName) { - this.args.updateAnchor?.(fieldName); - } -} diff --git a/app/components/ember-data-landing-page.hbs b/app/components/ember-data-landing-page.gjs similarity index 93% rename from app/components/ember-data-landing-page.hbs rename to app/components/ember-data-landing-page.gjs index 1bf245b34..1d7b31e2a 100644 --- a/app/components/ember-data-landing-page.hbs +++ b/app/components/ember-data-landing-page.gjs @@ -1,4 +1,5 @@ -
+import { LinkTo } from "@ember/routing"; + \ No newline at end of file diff --git a/app/components/ember-landing-page.gjs b/app/components/ember-landing-page.gjs new file mode 100644 index 000000000..ed49f7010 --- /dev/null +++ b/app/components/ember-landing-page.gjs @@ -0,0 +1,43 @@ +import { LinkTo } from "@ember/routing"; +import { array, hash } from "@ember/helper"; + \ No newline at end of file diff --git a/app/components/ember-landing-page.hbs b/app/components/ember-landing-page.hbs deleted file mode 100644 index afa196959..000000000 --- a/app/components/ember-landing-page.hbs +++ /dev/null @@ -1,40 +0,0 @@ -
-

Ember API Documentation

-

- To get started, choose a project (Ember or Ember Data) and a version - from the dropdown menu. Ember has core methods used in any app, while Ember Data has - documentation of the built-in library for making requests to a back end. - If you're looking for documentation of the command line tool used to generate files, build your - app, and more, visit ember-cli. The latest - testing API is available at - ember-test-helpers. -

-

Commonly searched-for documentation

- -

Useful links

- -
diff --git a/app/components/import-example.gjs b/app/components/import-example.gjs new file mode 100644 index 000000000..ae183e1a1 --- /dev/null +++ b/app/components/import-example.gjs @@ -0,0 +1,11 @@ +import Component from '@glimmer/component'; +import MarkdownToHtml from "ember-cli-showdown/components/markdown-to-html"; + +export default class ImportExample extends Component { + get markdown() { + let md = `\`\`\`js +import ${this.args.item} from '${this.args.package}'; +\`\`\``; + return md; + } +} diff --git a/app/components/import-example.hbs b/app/components/import-example.hbs deleted file mode 100644 index ca3142bea..000000000 --- a/app/components/import-example.hbs +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/app/components/import-example.js b/app/components/import-example.js deleted file mode 100644 index 013e1309f..000000000 --- a/app/components/import-example.js +++ /dev/null @@ -1,10 +0,0 @@ -import Component from '@glimmer/component'; - -export default class ImportExample extends Component { - get markdown() { - let md = `\`\`\`js -import ${this.args.item} from '${this.args.package}'; -\`\`\``; - return md; - } -} diff --git a/app/components/loading-spinner.gjs b/app/components/loading-spinner.gjs new file mode 100644 index 000000000..b888a39a9 --- /dev/null +++ b/app/components/loading-spinner.gjs @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git a/app/components/loading-spinner.hbs b/app/components/loading-spinner.hbs deleted file mode 100644 index f1b4445ec..000000000 --- a/app/components/loading-spinner.hbs +++ /dev/null @@ -1,9 +0,0 @@ -
-
-
-
-
-
-
- {{yield}} -
\ No newline at end of file diff --git a/app/components/search-input.js b/app/components/search-input.gjs similarity index 57% rename from app/components/search-input.js rename to app/components/search-input.gjs index b0ebaf68b..c2147f374 100644 --- a/app/components/search-input.js +++ b/app/components/search-input.gjs @@ -1,3 +1,4 @@ +/* eslint-disable ember/no-get */ import { inject as service } from '@ember/service'; import Component from '@glimmer/component'; import { get } from '@ember/object'; @@ -5,11 +6,24 @@ import { isPresent } from '@ember/utils'; import { task, timeout } from 'ember-concurrency'; import { action } from '@ember/object'; import { tracked } from '@glimmer/tracking'; +import perform from "ember-concurrency/helpers/perform"; +import EmberTether from "ember-tether/components/ember-tether"; +import Dropdown from "ember-api-docs/components/search-input/dropdown"; +import and from "ember-truth-helpers/helpers/and"; +import not from "ember-truth-helpers/helpers/not"; +import eq from "ember-api-docs/helpers/eq"; const SEARCH_DEBOUNCE_PERIOD = 300; const SEARCH_CLOSE_PERIOD = 200; -export default class SearchInput extends Component { +export default class SearchInput extends Component { @tracked query = ''; @tracked _focused = false; diff --git a/app/components/search-input.hbs b/app/components/search-input.hbs deleted file mode 100644 index c24b4c2b9..000000000 --- a/app/components/search-input.hbs +++ /dev/null @@ -1,34 +0,0 @@ -{{! template-lint-disable no-action }} -
- - {{! Search results dropdown }} - - - -
\ No newline at end of file diff --git a/app/components/search-input/dropdown-header.gjs b/app/components/search-input/dropdown-header.gjs new file mode 100644 index 000000000..f01842efb --- /dev/null +++ b/app/components/search-input/dropdown-header.gjs @@ -0,0 +1,11 @@ + + \ No newline at end of file diff --git a/app/components/search-input/dropdown-header.hbs b/app/components/search-input/dropdown-header.hbs deleted file mode 100644 index 057816aaa..000000000 --- a/app/components/search-input/dropdown-header.hbs +++ /dev/null @@ -1,10 +0,0 @@ -
-
-
- - {{yield}} - -
-
-
-
\ No newline at end of file diff --git a/app/components/search-input/dropdown.js b/app/components/search-input/dropdown.gjs similarity index 55% rename from app/components/search-input/dropdown.js rename to app/components/search-input/dropdown.gjs index 58ba8195a..17ec2e9fb 100644 --- a/app/components/search-input/dropdown.js +++ b/app/components/search-input/dropdown.gjs @@ -1,16 +1,48 @@ -import { - classNames, - attributeBindings, - tagName, -} from '@ember-decorators/component'; +/* eslint-disable ember/no-classic-components, ember/no-get, ember/require-tagless-components, prettier/prettier */ +import { classNames, attributeBindings, tagName } from '@ember-decorators/component'; import { get } from '@ember/object'; import Component from '@ember/component'; import { A } from '@ember/array'; +import DropdownHeader from "ember-api-docs/components/search-input/dropdown-header"; +import DropdownResult from "ember-api-docs/components/search-input/dropdown-result"; @tagName('span') @classNames('ds-dropdown-menu', 'ds-with-1') @attributeBindings('role') -export default class Dropdown extends Component { +export default class Dropdown extends Component { // Public API role = 'listbox'; diff --git a/app/components/search-input/dropdown.hbs b/app/components/search-input/dropdown.hbs deleted file mode 100644 index 3f4cfc5eb..000000000 --- a/app/components/search-input/dropdown.hbs +++ /dev/null @@ -1,33 +0,0 @@ - - {{#if this.noResults}} - - No results found - -
-
-

Try searching the deprecations guide.

-
-
- - {{else}} - {{!-- Level 0 hierarchy --}} - {{#each-in this._groupedResults as |lvl0section _lvl0results|}} - {{!-- Dropdown header --}} - - - {{lvl0section}} - - - {{!-- Level 1 hierarchy --}} - {{#each-in _lvl0results as |lvl1section _lvl1results|}} - {{!-- Each result will be shown here --}} - {{#each _lvl1results as |result index|}} - - {{/each}} - - {{/each-in}} - {{/each-in}} - {{/if}} -
- -{{yield}} diff --git a/app/components/table-of-contents.gjs b/app/components/table-of-contents.gjs new file mode 100644 index 000000000..738b48a89 --- /dev/null +++ b/app/components/table-of-contents.gjs @@ -0,0 +1,57 @@ +import { action } from '@ember/object'; +import Component from '@glimmer/component'; +import { on } from "@ember/modifier"; +import { fn, array } from "@ember/helper"; +import notEq from "ember-truth-helpers/helpers/not-eq"; +import { LinkTo } from "@ember/routing"; + +export default class TableOfContents extends Component { + @action + toggle(type) { + const tableElement = document.querySelector(`ol.toc-level-1.${type}`); + tableElement.classList.toggle('selected'); + } +} diff --git a/app/components/table-of-contents.hbs b/app/components/table-of-contents.hbs deleted file mode 100644 index 19e793e9f..000000000 --- a/app/components/table-of-contents.hbs +++ /dev/null @@ -1,44 +0,0 @@ -
    -
  1. - Packages -
      - {{#each @moduleIDs as |moduleID|}} - - {{#if (not-eq moduleID '@ember/object/computed')}} -
    1. - {{moduleID}} -
    2. - {{/if}} - - {{/each}} -
    -
  2. - - {{#if @isShowingNamespaces}} -
  3. - Namespaces -
      - {{#each @namespaceIDs as |namespaceID|}} -
    1. - {{namespaceID}} -
    2. - {{/each}} -
    -
  4. - {{/if}} - -
  5. - Classes -
      - {{#each @classesIDs as |classID|}} -
    1. - {{classID}} -
    2. - {{/each}} -
    -
  6. -
- \ No newline at end of file diff --git a/app/components/table-of-contents.js b/app/components/table-of-contents.js deleted file mode 100644 index ee710fa91..000000000 --- a/app/components/table-of-contents.js +++ /dev/null @@ -1,10 +0,0 @@ -import { action } from '@ember/object'; -import Component from '@glimmer/component'; - -export default class TableOfContents extends Component { - @action - toggle(type) { - const tableElement = document.querySelector(`ol.toc-level-1.${type}`); - tableElement.classList.toggle('selected'); - } -} diff --git a/app/templates/application.gjs b/app/templates/application.gjs new file mode 100644 index 000000000..eb8609ae5 --- /dev/null +++ b/app/templates/application.gjs @@ -0,0 +1,21 @@ +import RouteTemplate from 'ember-route-template' +import EsHeader from "ember-styleguide/components/es-header"; +import EsNavbar from "ember-styleguide/components/es-navbar"; +import SearchInput from "ember-api-docs/components/search-input"; +import EsFooter from "ember-styleguide/components/es-footer"; +import HeadLayout from "ember-cli-head/components/head-layout"; +import BasicDropdownWormhole from "ember-basic-dropdown/components/basic-dropdown-wormhole"; +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/application.hbs b/app/templates/application.hbs deleted file mode 100644 index d5e419ae7..000000000 --- a/app/templates/application.hbs +++ /dev/null @@ -1,14 +0,0 @@ - - - - - -
- {{outlet}} -
- - -{{!-- required by ember-cli-meta-tags --}} - - - \ No newline at end of file diff --git a/app/templates/class-index.gjs b/app/templates/class-index.gjs new file mode 100644 index 000000000..bf461d52b --- /dev/null +++ b/app/templates/class-index.gjs @@ -0,0 +1,26 @@ +import RouteTemplate from 'ember-route-template' +import ApiIndexFilter from "ember-api-docs/components/api-index-filter"; +import ApiIndex from "ember-api-docs/components/api-index"; +import { LinkTo } from "@ember/routing"; +import { array, hash } from "@ember/helper"; +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/class-index.hbs b/app/templates/class-index.hbs deleted file mode 100644 index 57c63ab41..000000000 --- a/app/templates/class-index.hbs +++ /dev/null @@ -1,28 +0,0 @@ - - - {{#each sectionData.sections as |section|}} -

{{section.title}}

- {{#if section.items}} -
    - {{#each section.items as |item|}} -
  • - - {{item.name}} - -
  • - {{/each}} -
- {{else}} -

No documented items

- {{/if}} - {{/each}} -
-
diff --git a/app/templates/class.gjs b/app/templates/class.gjs new file mode 100644 index 000000000..efe42db24 --- /dev/null +++ b/app/templates/class.gjs @@ -0,0 +1,4 @@ +import RouteTemplate from 'ember-route-template' + +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/class.hbs b/app/templates/class.hbs deleted file mode 100644 index c24cd6895..000000000 --- a/app/templates/class.hbs +++ /dev/null @@ -1 +0,0 @@ -{{outlet}} diff --git a/app/templates/data-class.gjs b/app/templates/data-class.gjs new file mode 100644 index 000000000..efe42db24 --- /dev/null +++ b/app/templates/data-class.gjs @@ -0,0 +1,4 @@ +import RouteTemplate from 'ember-route-template' + +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/data-class.hbs b/app/templates/data-class.hbs deleted file mode 100644 index c24cd6895..000000000 --- a/app/templates/data-class.hbs +++ /dev/null @@ -1 +0,0 @@ -{{outlet}} diff --git a/app/templates/data-module.gjs b/app/templates/data-module.gjs new file mode 100644 index 000000000..efe42db24 --- /dev/null +++ b/app/templates/data-module.gjs @@ -0,0 +1,4 @@ +import RouteTemplate from 'ember-route-template' + +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/data-module.hbs b/app/templates/data-module.hbs deleted file mode 100644 index c24cd6895..000000000 --- a/app/templates/data-module.hbs +++ /dev/null @@ -1 +0,0 @@ -{{outlet}} diff --git a/app/templates/ember-cli.hbs b/app/templates/ember-cli.gjs similarity index 58% rename from app/templates/ember-cli.hbs rename to app/templates/ember-cli.gjs index 8d2d34743..5b47019a6 100644 --- a/app/templates/ember-cli.hbs +++ b/app/templates/ember-cli.gjs @@ -1,4 +1,7 @@ -{{! template-lint-disable no-inline-styles }} +import RouteTemplate from 'ember-route-template' +import { LinkTo } from "@ember/routing"; +import eq from "ember-api-docs/helpers/eq"; +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/error.hbs b/app/templates/error.gjs similarity index 67% rename from app/templates/error.hbs rename to app/templates/error.gjs index 0a9f9d3fd..a61db58a0 100644 --- a/app/templates/error.hbs +++ b/app/templates/error.gjs @@ -1,5 +1,8 @@ -
- {{#if (eq this.model.status 404)}} +import RouteTemplate from 'ember-route-template' +import eq from "ember-api-docs/helpers/eq"; +import { LinkTo } from "@ember/routing"; +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/events.gjs b/app/templates/events.gjs new file mode 100644 index 000000000..b7fea891f --- /dev/null +++ b/app/templates/events.gjs @@ -0,0 +1,11 @@ +import RouteTemplate from 'ember-route-template' +import EmberAnchor from "ember-api-docs/components/ember-anchor"; +import ApiIndexFilter from "ember-api-docs/components/api-index-filter"; +import ClassFieldDescription from "ember-api-docs/components/class-field-description"; +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/events.hbs b/app/templates/events.hbs deleted file mode 100644 index 0b6dd1739..000000000 --- a/app/templates/events.hbs +++ /dev/null @@ -1,6 +0,0 @@ - - - {{#each filteredModel.events as |event|}} - - {{/each}} - diff --git a/app/templates/head.gjs b/app/templates/head.gjs new file mode 100644 index 000000000..58c71b45d --- /dev/null +++ b/app/templates/head.gjs @@ -0,0 +1,14 @@ +import RouteTemplate from 'ember-route-template' + +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/head.hbs b/app/templates/head.hbs deleted file mode 100644 index b67e03fa9..000000000 --- a/app/templates/head.hbs +++ /dev/null @@ -1,12 +0,0 @@ -{{this.model.title}} - - - - -{{#if this.model.description}} - - -{{/if}} -{{#unless this.model.isRelease}} - -{{/unless}} \ No newline at end of file diff --git a/app/templates/loading.gjs b/app/templates/loading.gjs new file mode 100644 index 000000000..a3a4e3850 --- /dev/null +++ b/app/templates/loading.gjs @@ -0,0 +1,4 @@ +import RouteTemplate from 'ember-route-template' +import LoadingSpinner from "ember-api-docs/components/loading-spinner"; +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/loading.hbs b/app/templates/loading.hbs deleted file mode 100644 index efb8b4ff5..000000000 --- a/app/templates/loading.hbs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/app/templates/methods.gjs b/app/templates/methods.gjs new file mode 100644 index 000000000..2557ee243 --- /dev/null +++ b/app/templates/methods.gjs @@ -0,0 +1,12 @@ +import RouteTemplate from 'ember-route-template' +import EmberAnchor from "ember-api-docs/components/ember-anchor"; +import ApiIndexFilter from "ember-api-docs/components/api-index-filter"; +import ClassFieldDescription from "ember-api-docs/components/class-field-description"; +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/methods.hbs b/app/templates/methods.hbs deleted file mode 100644 index 1d1e03838..000000000 --- a/app/templates/methods.hbs +++ /dev/null @@ -1,7 +0,0 @@ -{{! template-lint-disable no-action }} - - - {{#each filteredModel.methods as |method|}} - - {{/each}} - diff --git a/app/templates/project-version.gjs b/app/templates/project-version.gjs new file mode 100644 index 000000000..815c62ee4 --- /dev/null +++ b/app/templates/project-version.gjs @@ -0,0 +1,35 @@ +import RouteTemplate from 'ember-route-template' +import { LinkTo } from "@ember/routing"; +import eq from "ember-api-docs/helpers/eq"; +import PowerSelect from "ember-power-select/components/power-select"; +import routeAction from "ember-route-action-helper/helpers/route-action"; +import TableOfContents from "ember-api-docs/components/table-of-contents"; +import versionLt from "ember-api-docs/helpers/version-lt"; +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/project-version.hbs b/app/templates/project-version.hbs deleted file mode 100644 index b4ac9e8a3..000000000 --- a/app/templates/project-version.hbs +++ /dev/null @@ -1,44 +0,0 @@ -{{! template-lint-disable no-inline-styles }} - -
- {{outlet}} -
diff --git a/app/templates/project-version/classes/class.gjs b/app/templates/project-version/classes/class.gjs new file mode 100644 index 000000000..97913e601 --- /dev/null +++ b/app/templates/project-version/classes/class.gjs @@ -0,0 +1,121 @@ +import RouteTemplate from 'ember-route-template' +import and from "ember-truth-helpers/helpers/and"; +import isLatest from "ember-api-docs/helpers/is-latest"; +import githubLink from "ember-api-docs/helpers/github-link"; +import svgJar from "ember-svg-jar/helpers/svg-jar"; +import { LinkTo } from "@ember/routing"; +import { array, concat, hash } from "@ember/helper"; +import notEq from "ember-truth-helpers/helpers/not-eq"; +import not from "ember-truth-helpers/helpers/not"; +import eq from "ember-api-docs/helpers/eq"; +import ImportExample from "ember-api-docs/components/import-example"; +import MarkdownToHtml from "ember-cli-showdown/components/markdown-to-html"; +import or from "ember-truth-helpers/helpers/or"; +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/project-version/classes/class.hbs b/app/templates/project-version/classes/class.hbs deleted file mode 100644 index 85cacb66c..000000000 --- a/app/templates/project-version/classes/class.hbs +++ /dev/null @@ -1,130 +0,0 @@ -{{! template-lint-disable no-action }} -
- {{#if (and @model.project.id @model.file @model.line (is-latest version=@model.projectVersion.version allVersions=this.allVersions))}} - {{svg-jar "fa-pencil"}} - {{/if}} -

Class {{@model.name}}

- {{#if @model.access}}{{@model.access}}{{/if}} - -
- {{#if @model.extends}} -
- Extends: - - - {{@model.extends}} - - -
- {{/if}} - {{#if @model.uses}} -
- Uses: - - {{#each @model.usesObjects as |parentClass idx|}} - {{#if (not-eq idx 0)}},{{/if}} - {{parentClass.name}} - {{/each}} - -
- {{/if}} - {{#if @model.file}} -
- Defined in: - - {{@model.file}}:{{@model.line}} - -
- {{/if}} - {{#if @model.module}} -
- Module: - - - {{@model.module}} - - -
- {{/if}} - {{#if @model.since}} -
- Since: - v{{@model.since}} -
- {{/if}} -
- {{#if (and (not (eq this.static 1)) this.hasImportExample)}} - - {{/if}} -

- - {{#if (or @model.methods @model.properties @model.events)}} -
- -
- Show: - - - - -
-
- {{outlet}} -
- {{/if}} - -
diff --git a/app/templates/project-version/functions/function.gjs b/app/templates/project-version/functions/function.gjs new file mode 100644 index 000000000..34fcda672 --- /dev/null +++ b/app/templates/project-version/functions/function.gjs @@ -0,0 +1,5 @@ +import RouteTemplate from 'ember-route-template' +import ClassFieldDescription from "ember-api-docs/components/class-field-description"; +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/project-version/functions/function.hbs b/app/templates/project-version/functions/function.hbs deleted file mode 100644 index 51acaf4da..000000000 --- a/app/templates/project-version/functions/function.hbs +++ /dev/null @@ -1,2 +0,0 @@ -

Function

- diff --git a/app/templates/project-version/index.gjs b/app/templates/project-version/index.gjs new file mode 100644 index 000000000..f63db5221 --- /dev/null +++ b/app/templates/project-version/index.gjs @@ -0,0 +1,10 @@ +import RouteTemplate from 'ember-route-template' +import eq from "ember-api-docs/helpers/eq"; +import EmberDataLandingPage from "ember-api-docs/components/ember-data-landing-page"; +import EmberLandingPage from "ember-api-docs/components/ember-landing-page"; +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/project-version/index.hbs b/app/templates/project-version/index.hbs deleted file mode 100644 index af49c7180..000000000 --- a/app/templates/project-version/index.hbs +++ /dev/null @@ -1,5 +0,0 @@ -{{#if (eq @model.id "ember-data")}} - -{{else}} - -{{/if}} diff --git a/app/templates/project-version/modules/module.gjs b/app/templates/project-version/modules/module.gjs new file mode 100644 index 000000000..55c66ec92 --- /dev/null +++ b/app/templates/project-version/modules/module.gjs @@ -0,0 +1,95 @@ +import RouteTemplate from 'ember-route-template' +import eq from "ember-api-docs/helpers/eq"; +import { LinkTo } from "@ember/routing"; +import { array } from "@ember/helper"; +import MarkdownToHtml from "ember-cli-showdown/components/markdown-to-html"; +import not from "ember-truth-helpers/helpers/not"; +import and from "ember-truth-helpers/helpers/and"; +import gt from "ember-truth-helpers/helpers/gt"; +import functionHeadingId from "ember-api-docs/helpers/function-heading-id"; +import betterGet from "ember-api-docs/helpers/better-get"; +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/project-version/modules/module.hbs b/app/templates/project-version/modules/module.hbs deleted file mode 100644 index 314f9e4a5..000000000 --- a/app/templates/project-version/modules/module.hbs +++ /dev/null @@ -1,83 +0,0 @@ -
- {{#if (eq this.model.name 'ember-data-overview')}} -

EmberData Overview

- {{else}} -

Package {{this.model.name}}

- {{/if}} - {{#if this.model.access}}{{this.model.access}}{{/if}} - -

- {{#if this.model.parent}} -

- Parent: - {{this.model.parent}} -
- {{/if}} -

- -

- - {{#if this.submodules}} -
-

- - Submodules -

-
    - {{#each this.submodules as |module|}} -
  • - - {{module}} - -
  • - {{/each}} -
-
- {{/if}} - - {{#if this.classesAndNamespaces}} -
-

- - Classes -

-
    - {{#each this.classesAndNamespaces as |klass|}} - {{#if (not (and (eq this.model.name "ember-data") (eq klass "Ember")))}} -
  • - - {{klass}} - -
  • - {{/if}} - {{/each}} -
-
- {{/if}} - - {{#if (and this.functionHeadings (gt this.functionHeadings.length 0)) }} - -

- - Functions -

- {{#each this.functionHeadings as |funcHeading|}} -

- - {{funcHeading}} -

-
    - {{#each (better-get this.functions funcHeading) as |method|}} -
  • - - {{method.name}} - -
  • - {{/each}} -
- {{/each}} - - {{/if}} - {{outlet}} - -
diff --git a/app/templates/properties.gjs b/app/templates/properties.gjs new file mode 100644 index 000000000..6e2053eef --- /dev/null +++ b/app/templates/properties.gjs @@ -0,0 +1,12 @@ +import RouteTemplate from 'ember-route-template' +import EmberAnchor from "ember-api-docs/components/ember-anchor"; +import ApiIndexFilter from "ember-api-docs/components/api-index-filter"; +import ClassFieldDescription from "ember-api-docs/components/class-field-description"; +export default RouteTemplate() \ No newline at end of file diff --git a/app/templates/properties.hbs b/app/templates/properties.hbs deleted file mode 100644 index aadb2ef45..000000000 --- a/app/templates/properties.hbs +++ /dev/null @@ -1,7 +0,0 @@ -{{! template-lint-disable no-action }} - - - {{#each filteredModel.properties as |property|}} - - {{/each}} - diff --git a/tests/integration/components/api-index-filter-test.js b/tests/integration/components/api-index-filter-test.gjs similarity index 63% rename from tests/integration/components/api-index-filter-test.js rename to tests/integration/components/api-index-filter-test.gjs index bacae9407..f2547cd47 100644 --- a/tests/integration/components/api-index-filter-test.js +++ b/tests/integration/components/api-index-filter-test.gjs @@ -1,8 +1,9 @@ +/* eslint-disable prettier/prettier */ import EmberObject from '@ember/object'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render, click, findAll } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; +import ApiIndexFilter from "ember-api-docs/components/api-index-filter"; module('Integration | Component | api index filter', function (hooks) { setupRenderingTest(hooks); @@ -71,7 +72,8 @@ module('Integration | Component | api index filter', function (hooks) { ], }); - test('clicking inherited shows inherited methods', async function (assert) { + test('clicking inherited shows inherited methods', async function (assert) {const self = this; + let filterData = EmberObject.create({ showInherited: false, showProtected: false, @@ -85,44 +87,32 @@ module('Integration | Component | api index filter', function (hooks) { filterData.set(field, !filterData.get(field)); }; - await render(hbs` - {{#api-index-filter model=this.model filterData=this.filterData as |myModel|}} + await render(); await click('#inherited-toggle'); assert @@ -136,7 +126,8 @@ module('Integration | Component | api index filter', function (hooks) { .hasText('parentDoSomething', 'should display 1 inherited method'); }); - test('clicking private shows private methods', async function (assert) { + test('clicking private shows private methods', async function (assert) {const self = this; + let filterData = EmberObject.create({ showInherited: false, showProtected: false, @@ -150,44 +141,32 @@ module('Integration | Component | api index filter', function (hooks) { filterData.set(field, !filterData.get(field)); }; - await render(hbs` - {{#api-index-filter model=this.model filterData=this.filterData updateFilter=(action "updateFilter") as |myModel|}} + await render(); await click('#private-toggle'); assert @@ -201,7 +180,8 @@ module('Integration | Component | api index filter', function (hooks) { .hasText('doSomethingPrivate', 'should display 1 private method'); }); - test('clicking private and inherited shows both methods', async function (assert) { + test('clicking private and inherited shows both methods', async function (assert) {const self = this; + let filterData = EmberObject.create({ showInherited: false, showProtected: false, @@ -215,44 +195,32 @@ module('Integration | Component | api index filter', function (hooks) { filterData.set(field, value); }; - await render(hbs` - {{#api-index-filter model=this.model filterData=this.filterData as |myModel|}} + await render(); await click('#private-toggle'); await click('#inherited-toggle'); @@ -270,7 +238,8 @@ module('Integration | Component | api index filter', function (hooks) { .hasText('parentDoSomething', 'should display 1 inherited method'); }); - test('clicking all toggles shows all methods', async function (assert) { + test('clicking all toggles shows all methods', async function (assert) {const self = this; + let filterData = EmberObject.create({ showInherited: false, showProtected: false, @@ -284,44 +253,32 @@ module('Integration | Component | api index filter', function (hooks) { filterData.set(field, !filterData.get(field)); }; - await render(hbs` - {{#api-index-filter model=this.model filterData=this.filterData as |myModel|}} + await render(); await click('#private-toggle'); await click('#inherited-toggle'); @@ -347,7 +304,8 @@ module('Integration | Component | api index filter', function (hooks) { .hasText('parentDoSomething', 'should display 1 inherited method'); }); - test('clicking all toggles off should only show public', async function (assert) { + test('clicking all toggles off should only show public', async function (assert) {const self = this; + let filterData = EmberObject.create({ showInherited: true, showProtected: true, @@ -361,44 +319,32 @@ module('Integration | Component | api index filter', function (hooks) { filterData.set(field, !filterData.get(field)); }; - await render(hbs` - {{#api-index-filter model=this.model filterData=this.filterData as |myModel|}} + await render(); assert .dom('.method-name') @@ -432,7 +378,8 @@ module('Integration | Component | api index filter', function (hooks) { .hasText('doSomething', 'should display 1 public method'); }); - test('should show only local method implementation when duplicates', async function (assert) { + test('should show only local method implementation when duplicates', async function (assert) {const self = this; + let filterData = EmberObject.create({ showInherited: true, showProtected: false, @@ -443,14 +390,14 @@ module('Integration | Component | api index filter', function (hooks) { this.set('model', model); this.set('filterData', filterData); - await render(hbs` - {{#api-index-filter model=this.model filterData=this.filterData as |myModel|}} + await render(); assert .dom('.method-name') .exists( diff --git a/tests/integration/components/api-index-test.js b/tests/integration/components/api-index-test.gjs similarity index 69% rename from tests/integration/components/api-index-test.js rename to tests/integration/components/api-index-test.gjs index e862ca666..5f9bc9763 100644 --- a/tests/integration/components/api-index-test.js +++ b/tests/integration/components/api-index-test.gjs @@ -2,7 +2,10 @@ import EmberObject from '@ember/object'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render, click, findAll } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; +import ApiIndex from "ember-api-docs/components/api-index"; +import { LinkTo } from "@ember/routing"; +import { array, hash } from "@ember/helper"; +import ApiIndexFilter from "ember-api-docs/components/api-index-filter"; module('Integration | Component | api index', function (hooks) { setupRenderingTest(hooks); @@ -13,7 +16,8 @@ module('Integration | Component | api index', function (hooks) { this.actions[actionName].apply(this, args); }); - test('should display api index', async function (assert) { + test('should display api index', async function (assert) {const self = this; + let model = EmberObject.create({ project: { id: 'lolwut', @@ -44,24 +48,15 @@ module('Integration | Component | api index', function (hooks) { this.set('myModel', model); // Template block usage: - await render(hbs` - {{#api-index itemData=this.myModel as |sectionData|}} + await render(); assert .dom('.api-index-section-title') .exists({ count: 3 }, 'should show 3 sections'); @@ -96,7 +91,8 @@ module('Integration | Component | api index', function (hooks) { .hasText('didSomething', 'should display 1 event'); }); - test('should display text when no methods', async function (assert) { + test('should display text when no methods', async function (assert) {const self = this; + let model = EmberObject.create({ project: { id: 'lolwut', @@ -122,24 +118,15 @@ module('Integration | Component | api index', function (hooks) { this.set('myModel', model); // Template block usage: - await render(hbs` - {{#api-index itemData=this.myModel as |sectionData|}} + await render(); assert .dom('.api-index-section-title') .exists({ count: 3 }, 'should show 3 sections'); @@ -174,7 +161,8 @@ module('Integration | Component | api index', function (hooks) { .hasText('didSomething', 'should display 1 event'); }); - test('should display api index with filter', async function (assert) { + test('should display api index with filter', async function (assert) {const self = this; + let model = EmberObject.create({ project: { id: 'lolwut', @@ -236,56 +224,35 @@ module('Integration | Component | api index', function (hooks) { }; // Template block usage: - await render(hbs` - {{#api-index-filter model=this.myModel filterData=this.filterData as |filteredModel|}} + await render(); assert .dom('.api-index-section-title') .exists({ count: 3 }, 'should show 3 sections'); @@ -321,7 +288,8 @@ module('Integration | Component | api index', function (hooks) { .hasText('didSomething', 'should display 1 event'); }); - test('should display inherited method when show inherited toggled on', async function (assert) { + test('should display inherited method when show inherited toggled on', async function (assert) {const self = this; + let model = EmberObject.create({ project: { id: 'lolwut', @@ -382,57 +350,36 @@ module('Integration | Component | api index', function (hooks) { filterData.set(field, !filterData.get(field)); }; - await render(hbs` - {{#api-index-filter model=this.myModel filterData=this.filterData as |filteredModel|}} + await render(); assert .dom('.api-index-section-title') .exists({ count: 3 }, 'should show 3 sections'); diff --git a/tests/integration/components/class-field-description-test.js b/tests/integration/components/class-field-description-test.gjs similarity index 76% rename from tests/integration/components/class-field-description-test.js rename to tests/integration/components/class-field-description-test.gjs index 7bb0a9277..f8856ae35 100644 --- a/tests/integration/components/class-field-description-test.js +++ b/tests/integration/components/class-field-description-test.gjs @@ -1,19 +1,15 @@ +/* eslint-disable prettier/prettier */ import EmberObject from '@ember/object'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; -import { - render, - click, - findAll, - find, - triggerEvent, -} from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; +import { render, click, findAll, find, triggerEvent } from '@ember/test-helpers'; +import ClassFieldDescription from "ember-api-docs/components/class-field-description"; module('Integration | Component | class field description', function (hooks) { setupRenderingTest(hooks); - test('it renders', async function (assert) { + test('it renders', async function (assert) {const self = this; + this.set('type', 'method'); this.set( 'field', @@ -27,7 +23,7 @@ module('Integration | Component | class field description', function (hooks) { ); await render( - hbs`` + ); assert.dom('.method-name').hasText('concat'); @@ -36,7 +32,8 @@ module('Integration | Component | class field description', function (hooks) { assert.dom(findAll('.args')[0]).hasText('(param1, param2, param3)'); }); - test('On hover -- the link icon shows up', async function (assert) { + test('On hover -- the link icon shows up', async function (assert) {const self = this; + this.set('type', 'method'); this.set( 'field', @@ -50,7 +47,7 @@ module('Integration | Component | class field description', function (hooks) { ); await render( - hbs`` + ); await triggerEvent('.class-field-description--link', 'mouseenter'); @@ -59,7 +56,8 @@ module('Integration | Component | class field description', function (hooks) { .exists('The link icon appears when hovering on the method text'); }); - test('it calls the provided action on link-click with the field name as an arg', async function (assert) { + test('it calls the provided action on link-click with the field name as an arg', async function (assert) {const self = this; + assert.expect(3); this.set('updateAnchor', (name) => { assert.equal( @@ -78,7 +76,7 @@ module('Integration | Component | class field description', function (hooks) { ); await render( - hbs`` + ); await click('.class-field-description--link'); @@ -86,7 +84,8 @@ module('Integration | Component | class field description', function (hooks) { assert.verifySteps(['updateAnchorAction']); }); - test('parameter props are displayed', async function (assert) { + test('parameter props are displayed', async function (assert) {const self = this; + this.set('type', 'method'); this.set( 'field', @@ -104,7 +103,7 @@ module('Integration | Component | class field description', function (hooks) { ); await render( - hbs`` + ); assert.dom(find('.prop:nth-child(1) dt')).hasText('prop1'); diff --git a/tests/integration/components/import-example-test.js b/tests/integration/components/import-example-test.gjs similarity index 66% rename from tests/integration/components/import-example-test.js rename to tests/integration/components/import-example-test.gjs index 3e0813391..2015220d7 100644 --- a/tests/integration/components/import-example-test.js +++ b/tests/integration/components/import-example-test.gjs @@ -1,21 +1,22 @@ +/* eslint-disable prettier/prettier */ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; +import ImportExample from "ember-api-docs/components/import-example"; module('Integration | Component | import example', function (hooks) { setupRenderingTest(hooks); test('it renders a class import example', async function (assert) { await render( - hbs`` + ); assert.dom('*').hasText("import Application from '@ember/application';"); }); test('it renders a function import example', async function (assert) { await render( - hbs`` + ); assert.dom('*').hasText("import { uniqBy } from '@ember/object/computed';"); }); diff --git a/tests/integration/components/loading-spinner-test.js b/tests/integration/components/loading-spinner-test.gjs similarity index 77% rename from tests/integration/components/loading-spinner-test.js rename to tests/integration/components/loading-spinner-test.gjs index 00edc93b1..9d714a767 100644 --- a/tests/integration/components/loading-spinner-test.js +++ b/tests/integration/components/loading-spinner-test.gjs @@ -1,7 +1,7 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; +import LoadingSpinner from "ember-api-docs/components/loading-spinner"; module('Integration | Component | loading spinner', function (hooks) { setupRenderingTest(hooks); @@ -10,16 +10,16 @@ module('Integration | Component | loading spinner', function (hooks) { // Set any properties with this.set('myProperty', 'value'); // Handle any actions with this.on('myAction', function(val) { ... }); - await render(hbs``); + await render(); assert.dom('*').hasText(''); // Template block usage: - await render(hbs` + await render(); assert.dom('*').hasText('template block text'); }); diff --git a/tests/integration/components/search-input-test.js b/tests/integration/components/search-input-test.gjs similarity index 96% rename from tests/integration/components/search-input-test.js rename to tests/integration/components/search-input-test.gjs index 1a012fb54..41c795852 100644 --- a/tests/integration/components/search-input-test.js +++ b/tests/integration/components/search-input-test.gjs @@ -1,8 +1,8 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { fillIn, render, waitFor } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; import { set } from '@ember/object'; +import SearchInput from "ember-api-docs/components/search-input"; module('Integration | Component | search input', function (hooks) { setupRenderingTest(hooks); @@ -155,7 +155,7 @@ module('Integration | Component | search input', function (hooks) { ]; }); - await render(hbs``); + await render(); await fillIn('#search-input', 'model'); @@ -171,7 +171,7 @@ module('Integration | Component | search input', function (hooks) { return []; }); - await render(hbs``); + await render(); await fillIn('#search-input', 'model'); diff --git a/tests/integration/components/table-of-contents-test.js b/tests/integration/components/table-of-contents-test.gjs similarity index 77% rename from tests/integration/components/table-of-contents-test.js rename to tests/integration/components/table-of-contents-test.gjs index 9b8e80027..e6e84c9f2 100644 --- a/tests/integration/components/table-of-contents-test.js +++ b/tests/integration/components/table-of-contents-test.gjs @@ -1,7 +1,8 @@ +/* eslint-disable prettier/prettier */ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render, findAll, click } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; +import TableOfContents from "ember-api-docs/components/table-of-contents"; const TIMEOUT_FOR_ANIMATION = 600; const CLASSES = ['Descriptor', 'Ember']; @@ -10,19 +11,15 @@ const MODULES = ['@ember/application', '@ember/array']; module('Integration | Component | table of contents', function (hooks) { setupRenderingTest(hooks); - test('it renders', async function (assert) { + test('it renders', async function (assert) {const self = this; + // Set any properties with this.set('myProperty', 'value'); this.set('emberVersion', '2.4.3'); this.set('classesIDs', CLASSES); - await render(hbs` - - `); + await render(); const contentTitle = document.querySelector( '[data-test-toc-title="classes"]' @@ -37,19 +34,15 @@ module('Integration | Component | table of contents', function (hooks) { assert.dom(findAll(`${contentReference} li`)[1]).hasText(CLASSES[1]); }); - test('Starts with underlying content visible', async function (assert) { + test('Starts with underlying content visible', async function (assert) {const self = this; + // Set any properties with this.set('myProperty', 'value'); this.set('emberVersion', '2.4.3'); this.set('moduleIDs', MODULES); - await render(hbs` - - `); + await render(); const contentReference = '.toc-level-1'; const content = document.querySelector(contentReference); @@ -67,19 +60,15 @@ module('Integration | Component | table of contents', function (hooks) { assert.dom(findAll(`${contentReference} li`)[1]).hasText(MODULES[1]); }); - test('Underlying content hides once clicked', async function (assert) { + test('Underlying content hides once clicked', async function (assert) {const self = this; + // Set any properties with this.set('myProperty', 'value'); this.set('emberVersion', '2.4.3'); this.set('moduleIDs', MODULES); - await render(hbs` - - `); + await render(); const contentTitle = document.querySelector( '[data-test-toc-title="packages"]' @@ -101,19 +90,15 @@ module('Integration | Component | table of contents', function (hooks) { }, TIMEOUT_FOR_ANIMATION); }); - test('Underlying content should be visible after 2 clicks', async function (assert) { + test('Underlying content should be visible after 2 clicks', async function (assert) {const self = this; + // Set any properties with this.set('myProperty', 'value'); this.set('emberVersion', '2.4.3'); this.set('moduleIDs', MODULES); - await render(hbs` - - `); + await render(); const titleButton = document.querySelector( '[data-test-toc-title="packages"]' diff --git a/tests/integration/helpers/better-get-test.js b/tests/integration/helpers/better-get-test.gjs similarity index 60% rename from tests/integration/helpers/better-get-test.js rename to tests/integration/helpers/better-get-test.gjs index 6140bfdc9..00d15c462 100644 --- a/tests/integration/helpers/better-get-test.js +++ b/tests/integration/helpers/better-get-test.gjs @@ -1,31 +1,33 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; +import betterGet from "ember-api-docs/helpers/better-get"; module('helper:better-get', function (hooks) { setupRenderingTest(hooks); - test('should get dot separated', async function (assert) { + test('should get dot separated', async function (assert) {const self = this; + let obj = { 'Ember.Object': 'hello', }; this.set('dataStructure', obj); this.set('key', 'Ember.Object'); - await render(hbs`{{better-get dataStructure key}}`); + await render(); assert.dom(this.element).hasText('hello'); }); - test('should get rfc 176 module', async function (assert) { + test('should get rfc 176 module', async function (assert) {const self = this; + let obj = { '@ember/object': 'hello', }; this.set('dataStructure', obj); this.set('key', '@ember/object'); - await render(hbs`{{better-get dataStructure key}}`); + await render(); assert.dom(this.element).hasText('hello'); }); diff --git a/tests/integration/helpers/function-heading-id-test.js b/tests/integration/helpers/function-heading-id-test.gjs similarity index 69% rename from tests/integration/helpers/function-heading-id-test.js rename to tests/integration/helpers/function-heading-id-test.gjs index afe4403c0..343f56e53 100644 --- a/tests/integration/helpers/function-heading-id-test.js +++ b/tests/integration/helpers/function-heading-id-test.gjs @@ -1,15 +1,16 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; +import functionHeadingId from "ember-api-docs/helpers/function-heading-id"; module('helper:function-heading-id', function (hooks) { setupRenderingTest(hooks); - test('should transform nested package to id', async function (assert) { + test('should transform nested package to id', async function (assert) {const self = this; + this.set('inputValue', '@ember/object/computed'); - await render(hbs`{{function-heading-id inputValue}}`); + await render(); assert.dom(this.element).hasText('functions-computed'); }); diff --git a/tests/integration/helpers/is-latest-test.js b/tests/integration/helpers/is-latest-test.gjs similarity index 69% rename from tests/integration/helpers/is-latest-test.js rename to tests/integration/helpers/is-latest-test.gjs index 35d18488e..095ef9358 100644 --- a/tests/integration/helpers/is-latest-test.js +++ b/tests/integration/helpers/is-latest-test.gjs @@ -1,35 +1,37 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; import { A } from '@ember/array'; +import isLatest from "ember-api-docs/helpers/is-latest"; const versions = A(['ember-1.13.0', 'ember-3.5.0', 'ember-2.1.10']); module('helper:is-latest', function (hooks) { setupRenderingTest(hooks); - test('should resolve true if latest release', async function (assert) { + test('should resolve true if latest release', async function (assert) {const self = this; + this.set('version', '3.5.0'); this.set('allVersions', versions); - await render(hbs` - {{#if (is-latest version=this.version allVersions=this.allVersions)}} + await render(); assert.dom(this.element).hasText('Hello World'); }); - test('should resolve false if not latest', async function (assert) { + test('should resolve false if not latest', async function (assert) {const self = this; + this.set('version', '3.1.0'); this.set('allVersions', versions); - await render(hbs` - {{#if (is-latest version=this.version allVersions=this.allVersions)}} + await render(); assert.notEqual(this.element.textContent.trim(), 'Hello World'); }); }); diff --git a/tests/integration/helpers/version-lt-test.js b/tests/integration/helpers/version-lt-test.gjs similarity index 65% rename from tests/integration/helpers/version-lt-test.js rename to tests/integration/helpers/version-lt-test.gjs index 297671b2e..23b56856f 100644 --- a/tests/integration/helpers/version-lt-test.js +++ b/tests/integration/helpers/version-lt-test.gjs @@ -1,33 +1,33 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; +import versionLt from "ember-api-docs/helpers/version-lt"; module('helper:version-lt', function (hooks) { setupRenderingTest(hooks); test('should calculate major version diffs', async function (assert) { - await render(hbs`{{version-lt '2.10' '3.0' 'ember'}}`); + await render(); assert.dom(this.element).hasText('true'); }); test('should calculate minor version diffs', async function (assert) { - await render(hbs`{{version-lt '2.15' '2.16' 'ember'}}`); + await render(); assert.dom(this.element).hasText('true'); }); test('should fail if major greater', async function (assert) { - await render(hbs`{{version-lt '3.0' '2.16' 'ember'}}`); + await render(); assert.dom(this.element).hasText('false'); }); test('should fail if minor greater', async function (assert) { - await render(hbs`{{version-lt '2.17' '2.16' 'ember'}}`); + await render(); assert.dom(this.element).hasText('false'); }); test('should fail if equal', async function (assert) { - await render(hbs`{{version-lt '2.16' '2.16' 'ember'}}`); + await render(); assert.dom(this.element).hasText('false'); }); });