mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Adds Namespace UI to Access Control - Also adds two step buttons to other Access Control pages --------- Co-authored-by: Phil Renaud <phil@riotindustries.com>
29 lines
723 B
JavaScript
29 lines
723 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Watchable from './watchable';
|
|
import codesForError from '../utils/codes-for-error';
|
|
import classic from 'ember-classic-decorator';
|
|
|
|
@classic
|
|
export default class NamespaceAdapter extends Watchable {
|
|
findRecord(store, modelClass, id) {
|
|
return super.findRecord(...arguments).catch((error) => {
|
|
const errorCodes = codesForError(error);
|
|
if (errorCodes.includes('501')) {
|
|
return { Name: id };
|
|
}
|
|
});
|
|
}
|
|
|
|
urlForCreateRecord(_modelName, model) {
|
|
return this.urlForUpdateRecord(model.attr('name'), 'namespace');
|
|
}
|
|
|
|
urlForDeleteRecord(id) {
|
|
return this.urlForUpdateRecord(id, 'namespace');
|
|
}
|
|
}
|