-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* UI: Namespace area fixes (#19799) * Revert model changes due to unavailable decorator
- Loading branch information
Showing
5 changed files
with
29 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
ui: Fix bad link to namespace when namespace name includes `.` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
import ApplicationAdapter from './application'; | ||
|
||
export default ApplicationAdapter.extend({ | ||
export default class NamespaceAdapter extends ApplicationAdapter { | ||
pathForType() { | ||
return 'namespaces'; | ||
}, | ||
} | ||
urlForFindAll(modelName, snapshot) { | ||
if (snapshot.adapterOptions && snapshot.adapterOptions.forUser) { | ||
return `/${this.urlPrefix()}/internal/ui/namespaces`; | ||
} | ||
return `/${this.urlPrefix()}/namespaces?list=true`; | ||
}, | ||
} | ||
|
||
urlForCreateRecord(modelName, snapshot) { | ||
const id = snapshot.attr('path'); | ||
return this.buildURL(modelName, id); | ||
}, | ||
} | ||
|
||
createRecord(store, type, snapshot) { | ||
const id = snapshot.attr('path'); | ||
return this._super(...arguments).then(() => { | ||
return super.createRecord(...arguments).then(() => { | ||
return { id }; | ||
}); | ||
}, | ||
} | ||
|
||
findAll(store, type, sinceToken, snapshot) { | ||
if (snapshot.adapterOptions && typeof snapshot.adapterOptions.namespace !== 'undefined') { | ||
return this.ajax(this.urlForFindAll('namespace', snapshot), 'GET', { | ||
namespace: snapshot.adapterOptions.namespace, | ||
}); | ||
} | ||
return this._super(...arguments); | ||
}, | ||
return super.findAll(...arguments); | ||
} | ||
query() { | ||
return this.ajax(`/${this.urlPrefix()}/namespaces?list=true`); | ||
}, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters