Skip to content

Commit

Permalink
Documentation site upgrade (#979)
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic authored Apr 10, 2023
1 parent 4366d77 commit 3bb0896
Show file tree
Hide file tree
Showing 76 changed files with 106 additions and 230 deletions.
6 changes: 5 additions & 1 deletion config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,12 @@ module.exports = function() {
npm: {
devDependencies: {
'ember-data': '~3.24.0',
'ember-cli-addon-docs': '^1.0.0',
'ember-cli-addon-docs': '^5.1.0',
'ember-cli-addon-docs-yuidoc': '^1.0.0',
'ember-cli-deploy': '^1.0.2',
'ember-cli-deploy-build': '^1.1.1',
'ember-cli-deploy-git': '^1.3.3',
'ember-cli-deploy-git-ci': '^1.0.1',
},
},
},
Expand Down
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@
"ember-auto-import": "^2.4.2",
"ember-cli": "~3.28.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-deploy": "^1.0.2",
"ember-cli-deploy-build": "^1.1.1",
"ember-cli-deploy-git": "^1.3.3",
"ember-cli-deploy-git-ci": "^1.0.1",
"ember-cli-eslint": "^5.1.0",
"ember-cli-inject-live-reload": "^2.0.1",
"ember-cli-sass": "^10.0.0",
Expand Down Expand Up @@ -114,7 +110,7 @@
}
},
"volta": {
"node": "14.18.2",
"yarn": "1.22.17"
"node": "18.15.0",
"yarn": "1.22.19"
}
}
2 changes: 1 addition & 1 deletion tests/acceptance/docs-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module('Acceptance | docs', function(hooks) {

let navItems = Array.from(nav.querySelectorAll('li'));

let expectedNavItems = ['API REFERENCE', '{{ember-table}}'];
let expectedNavItems = ['API REFERENCE', '<EmberTable/​>'];

expectedNavItems.forEach(expectedText => {
assert.ok(
Expand Down
25 changes: 6 additions & 19 deletions tests/dummy/app/app.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
/* globals define, require */
import Application from '@ember/application';
import Resolver from './resolver';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
import EmberRouter from '@ember/routing/router';
import config from 'dummy/config/environment';

// Including ember-cli-addon-docs breaks certain versions of Ember when testing
// but they also break if we remove it. This defines a stub router which should
// prevent breakage.
if (!require.entries['ember-cli-addon-docs/router']) {
define('ember-cli-addon-docs/router', () => {
return EmberRouter;
});
export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}

const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver,
});

loadInitializers(App, config.modulePrefix);

export default App;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EmberTableRow from '../../../components/ember-tr';
import EmberTableRow from 'ember-table/components/ember-tr/component';

export default EmberTableRow.extend({
classNames: ['custom-row'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from '@ember/component';
import { computed } from '@ember/object';
import faker from 'faker';
import { getRandomInt } from '../../../../../../utils/generators';
import { getRandomInt } from 'dummy/utils/generators';

export default Component.extend({
// BEGIN-SNIPPET docs-example-sorting-empty-values.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{{docs-hero
byline='the power table for power users'
}}

Ember Table is a power table made for users who need a full-fledged,
fully-customizable table component for their apps. It is built to be flexible,
scalable, and ergonomic for day-to-day use.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Component from '@ember/component';
import { computed } from '@ember/object';
import { generateRows } from '../../../../../utils/generators';
import { generateRows } from 'dummy/utils/generators';

export default Component.extend({
rows: computed(function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import { generateRows } from '../../../../../utils/generators';
import { generateRows } from 'dummy/utils/generators';

export default Controller.extend({
rows: computed(function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Controller from '@ember/controller';
import { A as emberA } from '@ember/array';
import { get, set } from '@ember/object';

import { generateRows } from '../../../../../utils/generators';
import { generateRows } from 'dummy/utils/generators';
import { computed } from '@ember/object';

export default Controller.extend({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Controller from '@ember/controller';
import { computed } from '@ember/object';

import { generateRows } from '../../../../../utils/generators';
import { generateRows } from 'dummy/utils/generators';

export default Controller.extend({
// BEGIN-SNIPPET docs-example-scroll-indicators.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import { addObserver } from '@ember/object/observers'; // eslint-disable-line no-restricted-imports
import { generateRows } from '../../../../../utils/generators';
import { generateRows } from 'dummy/utils/generators';

const defaultResizeMode = {
'eq-container': 'fluid',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import faker from 'faker';
import { getRandomInt } from '../../../../../utils/generators';
import { getRandomInt } from 'dummy/utils/generators';

export default Controller.extend({
// BEGIN-SNIPPET docs-example-sortings.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Controller from '@ember/controller';
import { A as emberA } from '@ember/array';
import { computed } from '@ember/object';
import { generateRows, generateColumn } from '../../../../../utils/generators';
import { generateRows, generateColumn } from 'dummy/utils/generators';

const COLUMN_COUNT = 4;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import { generateRows, getRandomInt } from '../../../../../utils/generators';
import { generateRows, getRandomInt } from 'dummy/utils/generators';
import faker from 'faker';

export default Controller.extend({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import { generateRows } from '../../../../../utils/generators';
import { generateRows } from 'dummy/utils/generators';

export default Controller.extend({
rows: computed(function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import { generateRows, generateColumns } from '../../../utils/generators';
import { generateRows, generateColumns } from 'dummy/utils/generators';

export default Controller.extend({
rows: computed(function() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import { generateRows, generateColumns } from '../../../utils/generators';
import { generateRows, generateColumns } from 'dummy/utils/generators';

export default Controller.extend({
rows: computed(function() {
Expand Down
4 changes: 2 additions & 2 deletions tests/dummy/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{{content-for "head"}}

<link rel="shortcut icon" href="/assets/images/favicon.png" />
<link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link rel="stylesheet" href="{{rootURL}}assets/dummy.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/dummy.css">

{{content-for "head-footer"}}
</head>
Expand Down
7 changes: 0 additions & 7 deletions tests/dummy/app/pods/application/template.hbs

This file was deleted.

43 changes: 0 additions & 43 deletions tests/dummy/app/pods/docs/template.hbs

This file was deleted.

7 changes: 0 additions & 7 deletions tests/dummy/app/pods/index/route.js

This file was deleted.

3 changes: 0 additions & 3 deletions tests/dummy/app/resolver.js

This file was deleted.

7 changes: 7 additions & 0 deletions tests/dummy/app/routes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Route from '@ember/routing/route';

export default class IndexRoute extends Route {
redirect() {
this.transitionTo('docs');
}
}
5 changes: 5 additions & 0 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<DocsHeader />

{{outlet}}

<DocsKeyboardShortcuts />
44 changes: 44 additions & 0 deletions tests/dummy/app/templates/docs.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<DocsViewer as |viewer|>
<viewer.nav as |nav|>

<nav.section @label="Introduction" />

<nav.item @label='Introduction' @route='docs.index' />
<nav.item @label='Quickstart' @route='docs.quickstart' />
<nav.item @label='Why Ember Table?' @route='docs.why-ember-table' />

<nav.section @label='Guides' />

<nav.item @label='A Basic Table' @route='docs.guides.main.basic-table' />
<nav.item @label='Table Customization' @route='docs.guides.main.table-customization' />
<nav.item @label='Table Meta Data' @route='docs.guides.main.table-meta-data' />
<nav.item @label='Styling the Table' @route='docs.guides.main.styling-the-table' />
<nav.item @label='Infinite Scroll' @route='docs.guides.main.infinite-scroll' />

<nav.section @label='Header' />

<nav.item @label='Columns' @route='docs.guides.header.columns' />
<nav.item @label='Subcolumns' @route='docs.guides.header.subcolumns' />
<nav.item @label='Fixed Columns' @route='docs.guides.header.fixed-columns' />
<nav.item @label='Size Constraints' @route='docs.guides.header.size-constraints' />
<nav.item @label='Sorting' @route='docs.guides.header.sorting' />
<nav.item @label='Scroll Indicators' @route='docs.guides.header.scroll-indicators' />
<nav.item @label='Column Keys' @route='docs.guides.header.column-keys' />

<nav.section @label='Body' />

<nav.item @label='Rows and Trees' @route='docs.guides.body.rows-and-trees' />
<nav.item @label='Row Selection' @route='docs.guides.body.row-selection' />
<nav.item @label='Occlusion' @route='docs.guides.body.occlusion' />

<nav.section @label='Testing' />

<nav.item @label='Table Test Page' @route='docs.testing.test-page' />

</viewer.nav>

<viewer.main>
{{outlet}}
</viewer.main>

</DocsViewer>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ to control the selection using DDAU:

{{#docs-demo as |demo|}}
{{#demo.example name="docs-example-row-selection"}}
{{docs/guides/body/row-selection/examples/row-selection
{{examples/row-selection
rows=this.rows
columns=this.columns}}
{{/demo.example}}
Expand All @@ -27,7 +27,7 @@ selected, all of its children _must_ be selected:

{{#docs-demo as |demo|}}
{{#demo.example name="selected-rows"}}
{{docs/guides/body/row-selection/examples/selected-rows
{{examples/selected-rows
rowWithChildren=this.rowWithChildren
columns=this.columns
preselection=this.preselection}}
Expand Down Expand Up @@ -68,7 +68,7 @@ itself.

{{#docs-demo as |demo|}}
{{#demo.example name='selection-modes'}}
{{docs/guides/body/row-selection/examples/selection-modes
{{examples/selection-modes
columns=this.columns
rowsWithChildren=this.rowsWithChildren
rowSelectionMode=this.rowSelectionMode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ of each individual column and constraints for the widths. Widths are controlled
by the component, and if you don't provide one they'll use automatic defaults.
If you don't want to provide widths, but want your table to grow or shrink to
a suitable size in its container, you should take a look at
{{link-to 'width constraints' 'docs.guides.header.size-constraints'}}.
{{#link-to route='docs.guides.header.size-constraints'}}width
constraints{{/link-to}}.

If you do provide a width, changes to width via resizing will be reflected onto
your column object. This allows you to share, save, and reuse the widths that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ you can make fixed columns toggleable for your users.

{{#docs-demo as |demo|}}
{{#demo.example name='dynamic-fixed-columns'}}
{{docs/guides/header/fixed-columns/dynamic-example
{{examples/fixed-columns-dynamic
rows=this.rows
columns=dynamicFixedColumns
toggleFixed=(action "toggleFixed")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ This demo shows that in action:
Empty values can be treated differently depending on the needs by using the `sortEmptyLast` option.
To see its effect, try sorting the "Material" column in ascending order with and without "sortEmptyLast" checked.

{{docs/guides/header/sorting/empty-values}}
{{examples/sorting-empty-values}}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Infinite scroll is a common UI pattern where additional table rows are loaded as

{{#docs-demo as |demo|}}
{{#demo.example}}
{{docs/guides/main/infinite-scroll/example}}
{{examples/infinite-scroll}}
{{/demo.example}}

{{demo.snippet name='docs-example-infinite-scroll.hbs'}}
{{demo.snippet label='component.js' name='docs-example-infinite-scroll.js'}}
{{/docs-demo}}

Ember Table does not provide a built-in spinner. You must specify your own by passing a block to `<t.loadingMore>` like in the example above. See the {{#link-to 'docs.api.item' 'components/ember-table-loading-more'}}`EmberTableLoadingMore`{{/link-to}} component docs for more information.
Ember Table does not provide a built-in spinner. You must specify your own by passing a block to `<t.loadingMore>` like in the example above. See the {{#link-to route='docs.api.item' model='components/ember-table-loading-more'}}`EmberTableLoadingMore`{{/link-to}} component docs for more information.
3 changes: 3 additions & 0 deletions tests/dummy/app/templates/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<DocsHero @byline="the power table for power users" />

<IndexContent />
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 3bb0896

Please sign in to comment.