Skip to content

Commit 2d3415d

Browse files
committed
remove events, methods, properties sub-routes
1 parent 9675bf5 commit 2d3415d

File tree

14 files changed

+31
-110
lines changed

14 files changed

+31
-110
lines changed

app/controllers/project-version.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,32 +149,27 @@ export default class ProjectVersionController extends Controller {
149149
endingRoute = `classes/${className}`;
150150
break;
151151
}
152-
case 'project-version.classes.class.index': {
153-
let className = this._getEncodedNameForCurrentClass();
154-
endingRoute = `classes/${className}`;
155-
break;
156-
}
157-
case 'project-version.modules.module.index': {
152+
case 'project-version.modules.module': {
158153
let moduleName = encodeURIComponent(this.moduleController.model.name);
159154
endingRoute = `modules/${moduleName}`;
160155
break;
161156
}
162-
case 'project-version.namespaces.namespace.index': {
157+
case 'project-version.namespaces.namespace': {
163158
let namespaceName = this.namespaceController.model.name;
164159
endingRoute = `namespaces/${namespaceName}`;
165160
break;
166161
}
167-
case 'project-version.classes.class.methods.index': {
162+
case 'project-version.classes.class.methods': {
168163
let className = this._getEncodedNameForCurrentClass();
169164
endingRoute = `classes/${className}/methods`;
170165
break;
171166
}
172-
case 'project-version.classes.class.events.index': {
167+
case 'project-version.classes.class.events': {
173168
let className = this._getEncodedNameForCurrentClass();
174169
endingRoute = `classes/${className}/events`;
175170
break;
176171
}
177-
case 'project-version.classes.class.properties.index': {
172+
case 'project-version.classes.class.properties': {
178173
let className = this._getEncodedNameForCurrentClass();
179174
endingRoute = `classes/${className}/properties`;
180175
break;

app/router.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ AppRouter.map(function () {
4646
// project-version.classes-redirect => project-version.classes.index
4747
// project-version.class => project-version.classes.class
4848
this.route('classes', function () {
49-
this.route('class', { path: '/:class' }, itemRoutes);
49+
this.route('class', { path: '/:class' });
5050
});
5151
// this.route('class', {path: '/classes/:class'}, itemRoutes);
5252

@@ -58,7 +58,7 @@ AppRouter.map(function () {
5858
// project-version.namespace => project-version.namespaces.namespace
5959
// routes/project-version/namespace => routes/project-version/namespaces/namespace
6060
this.route('namespaces', function () {
61-
this.route('namespace', { path: '/:namespace' }, itemRoutes);
61+
this.route('namespace', { path: '/:namespace' });
6262
});
6363
// this.route('namespace', {path: '/namespaces/:namespace'}, itemRoutes);
6464

@@ -67,22 +67,9 @@ AppRouter.map(function () {
6767
// routes/project-version/module => routes/project-version/modules/module
6868
// routes/project-version/module/* => routes/project-version/modules/module/*
6969
this.route('modules', function () {
70-
this.route('module', { path: '/:module' }, itemRoutes);
70+
this.route('module', { path: '/:module' });
7171
});
7272
// this.route('module', {path: '/modules/:module'}, itemRoutes);
73-
74-
// Common sub-routes
75-
function itemRoutes() {
76-
this.route('methods', function () {
77-
this.route('method', { path: '/:method' });
78-
});
79-
this.route('properties', function () {
80-
this.route('property', { path: '/:property' });
81-
});
82-
this.route('events', function () {
83-
this.route('event', { path: '/:event' });
84-
});
85-
}
8673
}
8774
);
8875
this.route('class', { path: '/classes/:class' });

app/routes/project-version/classes/class/events.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/routes/project-version/classes/class/index.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/routes/project-version/classes/class/methods.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/routes/project-version/classes/class/properties.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/routes/project-version/modules/module/events.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/routes/project-version/modules/module/methods.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/routes/project-version/modules/module/properties.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/templates/class-index.hbs

Lines changed: 0 additions & 20 deletions
This file was deleted.

app/templates/class.hbs

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/templates/project-version/classes/class.hbs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,25 @@
126126
</section>
127127
<hr>
128128
</div>
129-
{{outlet}}
129+
<ApiIndexFilter @model={{this.model}} @filterData={{this.filterData}} as |filteredModel|>
130+
<ApiIndex @itemData={{filteredModel}} @classNames="api__index__content" as |sectionData|>
131+
{{#each sectionData.sections as |section|}}
132+
{{#if section.items}}
133+
<h3 class="api-index-section-title">{{section.title}}</h3>
134+
<ul class="{{section.class}}">
135+
{{#each section.items as |item|}}
136+
<li data-test-item={{item.name}}>
137+
<a
138+
href="#{{item.name}}"
139+
>
140+
{{item.name}}
141+
</a>
142+
</li>
143+
{{/each}}
144+
</ul>
145+
{{/if}}
146+
{{/each}}
147+
</ApiIndex>
148+
</ApiIndexFilter>
130149
{{/if}}
131150
</div>

prember-urls.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -100,30 +100,6 @@ module.exports = function () {
100100
entityData = require(requirePath);
101101
}
102102

103-
if (entityData.data.attributes.methods?.length) {
104-
addUrl(
105-
p,
106-
uniqVersion,
107-
`${entity}/${partialUrlEncode(cleanId)}/methods`
108-
);
109-
}
110-
111-
if (entityData.data.attributes.properties?.length) {
112-
addUrl(
113-
p,
114-
uniqVersion,
115-
`${entity}/${partialUrlEncode(cleanId)}/properties`
116-
);
117-
}
118-
119-
if (entityData.data.attributes.events?.length) {
120-
addUrl(
121-
p,
122-
uniqVersion,
123-
`${entity}/${partialUrlEncode(cleanId)}/events`
124-
);
125-
}
126-
127103
if (entity === 'modules' && entityData) {
128104
const staticFunctions = entityData.data.attributes.staticfunctions;
129105

tests/acceptance/analytics-page-tracking-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,23 @@ module('Acceptance | analytics page tracking', function (hooks) {
4141
assert.ok(
4242
serviceTrackPageSpy.calledWith({
4343
page: '/ember/2.11/namespaces/Ember',
44-
title: 'project-version.namespaces.namespace.index',
44+
title: 'project-version.namespaces.namespace',
4545
hostname,
4646
}),
4747
'service was called with expected arguments for ember namespace page'
4848
);
4949
assert.ok(
5050
serviceTrackPageSpy.calledWith({
5151
page: '/ember/2.11/modules/ember-metal',
52-
title: 'project-version.modules.module.index',
52+
title: 'project-version.modules.module',
5353
hostname,
5454
}),
5555
'service was called with expected arguments for ember metal module'
5656
);
5757
assert.ok(
5858
serviceTrackPageSpy.calledWith({
5959
page: '/ember/2.11/classes/Ember.Application',
60-
title: 'project-version.classes.class.index',
60+
title: 'project-version.classes.class',
6161
hostname,
6262
}),
6363
'service was called with expected arguments for ember application class'

0 commit comments

Comments
 (0)