Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up references to views #5208

Merged
merged 2 commits into from
Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions .changeset/nervous-swans-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@keystone-next/fields-legacy': major
'@keystone-next/keystone-legacy': major
---

Removed legacy property `List.views` and method `Field.extendAdminViews()`.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@
"packages/**/*.js",
"!packages/**/dist/**",
"!packages/core/tests/default-entry/index.js",
"!packages/fields/**/views/**",
"!packages/fields/**/test-fixtures.js",
"!packages/fields/types.js"
]
Expand Down
3 changes: 0 additions & 3 deletions packages/fields/src/Implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,6 @@ class Field {
extendAdminMeta(meta) {
return meta;
}
extendAdminViews(views) {
return views;
}
getDefaultValue({ context, originalInput }) {
if (typeof this.defaultValue !== 'undefined') {
if (typeof this.defaultValue === 'function') {
Expand Down
3 changes: 0 additions & 3 deletions packages/keystone/lib/ListTypes/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,6 @@ module.exports = class List {
})
);
this.fields = Object.values(this.fieldsByPath);
this.views = mapKeys(sanitisedFieldsConfig, ({ type }, path) =>
this.fieldsByPath[path].extendAdminViews({ ...type.views })
);
this.hookManager = new HookManager({
fields: this.fields,
hooks: this._hooks,
Expand Down
4 changes: 0 additions & 4 deletions packages/keystone/lib/adapters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ The key to this mapping is the `KeystoneAdapter` instance's `.name` property.
var fieldTypeDef = {
type: 'Text',
implementation: Text,
views: {
Controller: path.resolve(__dirname, './Controller'),
Field: path.resolve(__dirname, './views/Field'),
},
adapters: {
mongoose: MongoTextInterface,
},
Expand Down
4 changes: 0 additions & 4 deletions packages/keystone/tests/Keystone.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@ class MockFieldImplementation {
getGqlAuxQueries() {
return ['getFoo: Boolean'];
}
extendAdminViews(views) {
return views;
}
}

const MockFieldType = {
implementation: MockFieldImplementation,
views: {},
adapters: { mock: MockFieldAdapter },
};

Expand Down
3 changes: 0 additions & 3 deletions packages/keystone/tests/List.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ class MockFieldImplementation {
gqlAuxFieldResolvers() {
return {};
}
extendAdminViews(views) {
return views;
}
getDefaultValue() {
return;
}
Expand Down