Skip to content

Commit

Permalink
improvement: remove not needed BaseResource#name
Browse files Browse the repository at this point in the history
BREAKING CHANGE: now base resource does not have a name() property
  • Loading branch information
wojtek-krysiak committed Aug 5, 2020
1 parent af863c7 commit 4848a2d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
1 change: 0 additions & 1 deletion spec/backend/helpers/resource-stub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default (): BaseResource => ({
_decorated: {} as ResourceDecorator,
id: sinon.stub().returns(expectedResult.id),
properties: sinon.stub().returns(expectedResult.properties),
name: sinon.stub().returns(expectedResult.resourceName),
property: sinon.stub().returns(new BaseProperty({ path: 'prop', type: 'string' })),
databaseName: sinon.stub().returns(expectedResult.databaseName),
databaseType: sinon.stub().returns(expectedResult.databaseType),
Expand Down
6 changes: 0 additions & 6 deletions src/backend/adapters/base-resource.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ describe('BaseResource', function () {
})
})

describe('#name', function () {
it('throws NotImplementedError', async function () {
expect(() => resource.name()).to.throw(NotImplementedError)
})
})

describe('#id', function () {
it('throws NotImplementedError', async function () {
expect(() => resource.id()).to.throw(NotImplementedError)
Expand Down
13 changes: 0 additions & 13 deletions src/backend/adapters/base-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,6 @@ class BaseResource {
return 'database'
}

/**
* Return name of the resource.
* It could be a table name in SQL database, or collection name in mongoDB.
*
* Visually it will be shown as the name of the resource in the UI.
* @return {String}
* @abstract
*/
name(): string {
throw new NotImplementedError('BaseResource#name')
}


/**
* Each resource has to have uniq id which will be put to an URL of AdminBro routes.
* For instance in {@link Router} path for the `new` form is `/resources/{resourceId}/new`
Expand Down

0 comments on commit 4848a2d

Please sign in to comment.