Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/adapters/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export default class Application extends JSONAPIAdapter {
let projectName = this.currentProject;

if (['namespace', 'class', 'module'].indexOf(modelName) > -1) {
let [version] = id.replace(`${projectName}-`, '').split('-');
let [version] =
id
.replace(`${projectName}-`, '')
.match(/^(\d+\.\d+\.\d+(?:-[a-z]+\.\d+)?)/i) || [];
let revId = this.metaStore.getRevId(projectName, version, modelName, id);

let modelNameToUse = modelName;
Expand Down
15 changes: 10 additions & 5 deletions app/controllers/project-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,20 @@ export default class ProjectVersionController extends Controller {
}

getRelationshipIDs(relationship) {
// eslint-disable-next-line
const splitPoint = 2 + this.get('model.project.id').split('-').length - 1;
// eslint-disable-next-line ember/classic-decorator-no-classic-methods
const projectId = this.get('model.project.id');
const classes = this.model.hasMany(relationship);
const sorted = A(classes.ids()).sort();
//ids come in as ember-2.16.0-@ember/object/promise-proxy-mixin
//so we take the string after the 2nd '-'
//ids come in as ember-2.16.0-@ember/object/promise-proxy-mixin or ember-4.12.0-alpha.23-@ember/object/promise-proxy-mixin
//so we remove the project name and version (including pre-release) to get the class name
return A(sorted)
.toArray()
.map((id) => id.split('-').slice(splitPoint).join('-'));
.map((id) => {
// Remove project name prefix
const withoutProject = id.replace(`${projectId}-`, '');
// Remove version (e.g., 2.16.0 or 4.12.0-alpha.23) and the following dash
return withoutProject.replace(/^\d+\.\d+\.\d+(?:-[a-z]+\.\d+)?-/i, '');
});
}

@computed('showPrivateClasses', 'classesIDs', 'publicClassesIDs')
Expand Down
3 changes: 3 additions & 0 deletions app/utils/get-compact-version.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export default function getCompactVersion(fullVersion) {
if (fullVersion.includes('-')) {
return fullVersion;
}
return fullVersion.split('.').slice(0, 2).join('.');
}
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,5 @@
"paths": [
"lib/api-docs-data"
]
},
"pnpm": {
"overrides": {
"node-sass": "^9.0.0"
}
}
}
Loading