Skip to content

Commit

Permalink
Merge branch 'master' into file-adapater-remove-s3-required-params
Browse files Browse the repository at this point in the history
  • Loading branch information
intmainvoid authored May 20, 2020
2 parents 2f1107e + f493eec commit be17452
Show file tree
Hide file tree
Showing 118 changed files with 2,282 additions and 1,462 deletions.
10 changes: 10 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,16 @@
"contributions": [
"code"
]
},
{
"login": "wcalebgray",
"name": "Caleb Gray",
"avatar_url": "https://avatars2.githubusercontent.com/u/11668534?v=4",
"profile": "https://github.com/wcalebgray",
"contributions": [
"code",
"test"
]
}
],
"contributorsPerLine": 7,
Expand Down
7 changes: 7 additions & 0 deletions .changeset/calm-terms-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@keystonejs/app-admin-ui': patch
---

Fixed a few minor usability issues with item sorting:
- Fixed list view sort indicator pointing the wrong way. Previously, it would unintuitively point down for ascending down and vice-versa for descending.
- Fixed Sort Select popup losing focus when pressing Alt.
5 changes: 5 additions & 0 deletions .changeset/chilly-lobsters-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/list-plugins': patch
---

Improved at-tracking date display format.
6 changes: 6 additions & 0 deletions .changeset/dull-crabs-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@keystonejs/app-admin-ui': patch
'@keystonejs/fields': patch
---

Added a password field cell view.
6 changes: 6 additions & 0 deletions .changeset/dull-olives-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@keystonejs/app-admin-ui': patch
'@keystonejs/fields': patch
---

Simplifed ItemLink handling.
5 changes: 5 additions & 0 deletions .changeset/eleven-emus-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/auth-password': patch
---

Correct the config docs; the options are `identityField` & `secretField`.
8 changes: 8 additions & 0 deletions .changeset/few-bears-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@keystonejs/app-admin-ui': major
'@keystonejs/field-content': major
'@keystonejs/fields': major
'@keystonejs/fields-mongoid': major
---

Refactored how list and item queries and generated. Field controllers' `getFilterGraphQL` method now returns an object in the format { filter: value } rather than a GraphQL string.
5 changes: 5 additions & 0 deletions .changeset/five-lies-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/fields': patch
---

Fixed React warning about controlled handling in the Float field.
5 changes: 5 additions & 0 deletions .changeset/four-crabs-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/fields': minor
---

Added support for arguments being defined on `Virtual` fields.
12 changes: 12 additions & 0 deletions .changeset/good-pianos-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@keystonejs/demo-project-blog': patch
'@keystonejs/demo-project-meetup': patch
'@keystonejs/apollo-helpers': patch
'@keystonejs/app-admin-ui': patch
'@keystonejs/app-graphql': patch
'@keystonejs/app-graphql-playground': patch
'@keystonejs/fields': patch
'@keystonejs/keystone': patch
---

Updated various Apollo dependencies to their latest versions.
5 changes: 5 additions & 0 deletions .changeset/hungry-fans-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/app-admin-ui': patch
---

Fixed an issue with the no-lists-defined display.
5 changes: 5 additions & 0 deletions .changeset/little-poems-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/app-admin-ui': patch
---

Disable Update button in popout if no fields are selected.
7 changes: 7 additions & 0 deletions .changeset/lovely-humans-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@keystonejs/app-admin-ui': patch
'@keystonejs/fields': patch
'@keystonejs/keystone': patch
---

Removed some workarounds for issues with older graphql versions
34 changes: 34 additions & 0 deletions .changeset/nine-crews-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
'@keystonejs/access-control': major
'@keystonejs/keystone': major
'@keystonejs/logger': patch
---

Added async capability for all Access Control resolvers. This changes the below methods to async functions, returning Promises:

```
access-control
- validateCustomAccessControl
- validateListAccessControl
- validateFieldAccessControl
- validateAuthAccessControl
keystone/List
- checkFieldAccess
- checkListAccess
keystone/providers/custom
- computeAccess
keystone/providers/listAuth
- checkAccess
```

Changed `keystone/Keystone`'s `getGraphQlContext` return object (context) to include async resolvers for the following methods:
```
- context.getCustomAccessControlForUser
- context.getListAccessControlForUser
- context.getFieldAccessControlForUser
- context.getAuthAccessControlForUser
```
5 changes: 5 additions & 0 deletions .changeset/nine-poets-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/app-admin-ui': patch
---

Phased out Emotion.styled in favor of Emotion's css prop.
5 changes: 5 additions & 0 deletions .changeset/pink-radios-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/app-admin-ui': patch
---

Refactored how query refetches are handled.
5 changes: 5 additions & 0 deletions .changeset/plenty-ladybugs-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/app-admin-ui': patch
---

Used fixed table layout.
5 changes: 5 additions & 0 deletions .changeset/plenty-ways-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/app-admin-ui': patch
---

Cleaned up TableRow and BodyCell styling.
5 changes: 0 additions & 5 deletions .changeset/popular-mayflies-doubt.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/shiny-fishes-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/app-admin-ui': patch
---

Fixed duplicate Access Denied errors appearing for lists.
5 changes: 5 additions & 0 deletions .changeset/stale-cats-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/app-admin-ui': patch
---

Converted more React components to functional form.
5 changes: 5 additions & 0 deletions .changeset/tasty-hats-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/app-admin-ui': patch
---

Include persistent search state when navigating back to list.
5 changes: 5 additions & 0 deletions .changeset/three-goats-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/build-field-types': patch
---

Removed unused @babel/plugin-transform-flow-strip-types dependency.
5 changes: 5 additions & 0 deletions .changeset/warm-toys-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/app-admin-ui': patch
---

Cleaned up on-create callback duplication.
5 changes: 5 additions & 0 deletions .changeset/wet-drinks-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/fields': patch
---

Added validation to ensure the CloudinaryImage field is used with CloudinaryAdapter.
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="https://atticus.dev"><img src="https://avatars1.githubusercontent.com/u/9361948?v=4" width="80px;" alt=""/><br /><sub><b>Liam Clarke</b></sub></a><br /><a href="https://github.com/keystonejs/keystone/commits?author=LiamAttClarke" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/wbarcovsky"><img src="https://avatars2.githubusercontent.com/u/5498761?v=4" width="80px;" alt=""/><br /><sub><b>Vladimir Barcovsky</b></sub></a><br /><a href="https://github.com/keystonejs/keystone/commits?author=wbarcovsky" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/wcalebgray"><img src="https://avatars2.githubusercontent.com/u/11668534?v=4" width="80px;" alt=""/><br /><sub><b>Caleb Gray</b></sub></a><br /><a href="https://github.com/keystonejs/keystone/commits?author=wcalebgray" title="Code">💻</a> <a href="https://github.com/keystonejs/keystone/commits?author=wcalebgray" title="Tests">⚠️</a></td>
</tr>
</table>

<!-- markdownlint-enable -->
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ We'd like to start by thanking all our wonderful contributors:
<td align="center"><a href="https://atticus.dev"><img src="https://avatars1.githubusercontent.com/u/9361948?v=4" width="80px;" alt=""/><br /><sub><b>Liam Clarke</b></sub></a><br /><a href="https://github.com/keystonejs/keystone/commits?author=LiamAttClarke" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/wbarcovsky"><img src="https://avatars2.githubusercontent.com/u/5498761?v=4" width="80px;" alt=""/><br /><sub><b>Vladimir Barcovsky</b></sub></a><br /><a href="https://github.com/keystonejs/keystone/commits?author=wbarcovsky" title="Code">💻</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/wcalebgray"><img src="https://avatars2.githubusercontent.com/u/11668534?v=4" width="80px;" alt=""/><br /><sub><b>Caleb Gray</b></sub></a><br /><a href="https://github.com/keystonejs/keystone/commits?author=wcalebgray" title="Code">💻</a> <a href="https://github.com/keystonejs/keystone/commits?author=wcalebgray" title="Tests">⚠️</a></td>
</tr>
</table>

<!-- markdownlint-enable -->
Expand Down
10 changes: 10 additions & 0 deletions api-tests/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @keystonejs/api-tests

## 5.4.5

### Patch Changes

- [`63e00d80`](https://github.com/keystonejs/keystone/commit/63e00d805f3653863002befdaeda74c711f36f6b) [#2973](https://github.com/keystonejs/keystone/pull/2973) Thanks [@timleslie](https://github.com/timleslie)! - Fixed a bug which could lead to data loss (knex adapter only) when deleting items from a list which was the `1` side of a `1:N` relationship.

- Updated dependencies [[`63e00d80`](https://github.com/keystonejs/keystone/commit/63e00d805f3653863002befdaeda74c711f36f6b)]:
- @keystonejs/adapter-knex@10.0.1
- @keystonejs/adapter-mongoose@8.1.1

## 5.4.4

### Patch Changes
Expand Down
147 changes: 147 additions & 0 deletions api-tests/Virtual.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
const { multiAdapterRunners, setupServer, graphqlRequest } = require('@keystonejs/test-utils');
const { Integer, Virtual } = require('@keystonejs/fields');
const cuid = require('cuid');

function makeSetupKeystone(fields) {
return function setupKeystone(adapterName) {
return setupServer({
adapterName,
name: `ks5-testdb-${cuid()}`,
createLists: keystone => {
keystone.createList('Post', {
fields: {
value: { type: Integer },
...fields,
},
});
},
});
};
}

multiAdapterRunners().map(({ runner, adapterName }) =>
describe(`Adapter: ${adapterName}`, () => {
describe('Virtual field type', () => {
test(
'Default - resolver returns a string',
runner(
makeSetupKeystone({
foo: { type: Virtual, resolver: () => 'Hello world!' },
}),
async ({ keystone }) => {
const { data, errors } = await graphqlRequest({
keystone,
query: `mutation {
createPost(data: { value: 1 }) { value, foo }
}`,
});
expect(errors).toBe(undefined);
expect(data.createPost.value).toEqual(1);
expect(data.createPost.foo).toEqual('Hello world!');
}
)
);

test(
'graphQLReturnType',
runner(
makeSetupKeystone({
foo: { type: Virtual, graphQLReturnType: 'Int', resolver: () => 42 },
}),
async ({ keystone }) => {
const { data, errors } = await graphqlRequest({
keystone,
query: `mutation {
createPost(data: { value: 1 }) { value, foo }
}`,
});
expect(errors).toBe(undefined);
expect(data.createPost.value).toEqual(1);
expect(data.createPost.foo).toEqual(42);
}
)
);

test(
'args',
runner(
makeSetupKeystone({
foo: {
type: Virtual,
graphQLReturnType: 'Int',
args: [
{ name: 'x', type: 'Int' },
{ name: 'y', type: 'Int' },
],
resolver: (item, { x = 5, y = 6 }) => x * y,
},
}),
async ({ keystone }) => {
const { data, errors } = await graphqlRequest({
keystone,
query: `mutation {
createPost(data: { value: 1 }) { value, foo(x: 10, y: 20) }
}`,
});
expect(errors).toBe(undefined);
expect(data.createPost.value).toEqual(1);
expect(data.createPost.foo).toEqual(200);
}
)
);

test(
'args - use defaults',
runner(
makeSetupKeystone({
foo: {
type: Virtual,
graphQLReturnType: 'Int',
args: [
{ name: 'x', type: 'Int' },
{ name: 'y', type: 'Int' },
],
resolver: (item, { x = 5, y = 6 }) => x * y,
},
}),
async ({ keystone }) => {
const { data, errors } = await graphqlRequest({
keystone,
query: `mutation {
createPost(data: { value: 1 }) { value, foo }
}`,
});
expect(errors).toBe(undefined);
expect(data.createPost.value).toEqual(1);
expect(data.createPost.foo).toEqual(30);
}
)
);

test(
'graphQLReturnFragment',
runner(
makeSetupKeystone({
foo: {
type: Virtual,
extendGraphQLTypes: [`type Movie { title: String, rating: Int }`],
graphQLReturnType: '[Movie]',
resolver: () => [{ title: 'CATS!', rating: 100 }],
},
}),
async ({ keystone }) => {
const { data, errors } = await graphqlRequest({
keystone,
query: `mutation {
createPost(data: { value: 1 }) { value, foo { title rating } }
}`,
});
expect(errors).toBe(undefined);
expect(data.createPost.value).toEqual(1);
expect(data.createPost.foo).toEqual([{ title: 'CATS!', rating: 100 }]);
}
)
);
});
})
);
2 changes: 1 addition & 1 deletion api-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@keystonejs/api-tests",
"description": "A set of tests for running against the KeystoneJS API.",
"private": true,
"version": "5.4.4",
"version": "5.4.5",
"author": "The KeystoneJS Development Team",
"license": "MIT",
"engines": {
Expand Down
Loading

0 comments on commit be17452

Please sign in to comment.