From e66d542605484f5418c4fe8f7e65cb5de9480512 Mon Sep 17 00:00:00 2001 From: Andrew Plummer Date: Wed, 8 May 2024 09:49:37 +0800 Subject: [PATCH] isDeveloper -> isTester --- services/api/openapi.json | 595 ++++++++++++++++-- services/api/src/models/definitions/user.json | 2 +- services/web/src/modals/EditUser.js | 6 +- services/web/src/screens/Users/List/index.js | 10 +- 4 files changed, 540 insertions(+), 73 deletions(-) diff --git a/services/api/openapi.json b/services/api/openapi.json index c67810d5..d89ae290 100644 --- a/services/api/openapi.json +++ b/services/api/openapi.json @@ -939,7 +939,7 @@ } ] }, - "isDeveloper": { + "isTester": { "type": "boolean" }, "createdAt": { @@ -1135,37 +1135,116 @@ "phone": { "format": "phone", "description": "A phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.", - "type": "string", - "x-generated": true + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "string" + } + ] }, "emailVerified": { - "type": "boolean" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "boolean" + } + ] }, "phoneVerified": { - "type": "boolean" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "boolean" + } + ] }, "roles": { - "type": "array", - "items": { - "type": "object", - "properties": { - "role": { - "required": true, - "type": "string" - }, - "scope": { - "required": true, - "type": "string", - "enum": [ - "global", - "organization" - ] - }, - "scopeRef": { - "$ref": "#/components/schemas/Reference" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { + "required": true, + "type": "string" + }, + "scope": { + "required": true, + "type": "string", + "enum": [ + "global", + "organization" + ] + }, + "scopeRef": { + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "$ref": "#/components/schemas/Reference" + } + ] + } + } } } - } + ] }, "theme": { "type": "string", @@ -1175,8 +1254,24 @@ "system" ] }, - "isDeveloper": { - "type": "boolean" + "isTester": { + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "boolean" + } + ] } } } @@ -1289,7 +1384,7 @@ "system" ] }, - "isDeveloper": { + "isTester": { "type": "boolean" }, "password": { @@ -1398,31 +1493,159 @@ "type": "string" }, "description": { - "type": "string" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "string" + } + ] }, "isFeatured": { - "type": "boolean" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "boolean" + } + ] }, "priceUsd": { - "type": "number" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "number" + } + ] }, "expiresAt": { - "$ref": "#/components/schemas/DateTime" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "$ref": "#/components/schemas/DateTime" + } + ] }, "sellingPoints": { - "type": "array", - "items": { - "type": "string" - } + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "string" + } + ] + } + } + ] }, "shop": { "$ref": "#/components/schemas/Reference" }, "images": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Reference" - } + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "$ref": "#/components/schemas/Reference" + } + ] + } + } + ] } } } @@ -1835,58 +2058,274 @@ "type": "string" }, "description": { - "type": "string" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "string" + } + ] }, "images": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Reference" - } + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "$ref": "#/components/schemas/Reference" + } + ] + } + } + ] }, "categories": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Reference" - } + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "$ref": "#/components/schemas/Reference" + } + ] + } + } + ] }, "country": { - "type": "string" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "string" + } + ] }, "address": { "type": "object", "properties": { "line1": { - "type": "string" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "string" + } + ] }, "line2": { - "type": "string" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "string" + } + ] }, "city": { - "type": "string" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "string" + } + ] }, "postalCode": { - "type": "string" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "string" + } + ] }, "region": { - "type": "string" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "string" + } + ] }, "countryCode": { - "type": "string" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "string" + } + ] }, "geometry": { "type": "object", "properties": { "type": { - "type": "string" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "string" + } + ] }, "coordinates": { - "type": "array", "oneOf": [ { - "type": "number" + "type": "object", + "enum": [ + null + ] }, { - "type": "number" + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "array" } ] } @@ -1895,7 +2334,23 @@ } }, "owner": { - "$ref": "#/components/schemas/Reference" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "$ref": "#/components/schemas/Reference" + } + ] } } } @@ -3947,7 +4402,23 @@ "type": "string" }, "description": { - "type": "string" + "oneOf": [ + { + "type": "object", + "enum": [ + null + ] + }, + { + "type": "string", + "enum": [ + "" + ] + }, + { + "type": "string" + } + ] } } } @@ -4090,7 +4561,7 @@ "system" ] }, - "isDeveloper": { + "isTester": { "type": "boolean" }, "createdAt": { diff --git a/services/api/src/models/definitions/user.json b/services/api/src/models/definitions/user.json index 48ed0ff3..2e5694e4 100644 --- a/services/api/src/models/definitions/user.json +++ b/services/api/src/models/definitions/user.json @@ -56,7 +56,7 @@ "system" ] }, - "isDeveloper": { + "isTester": { "type": "Boolean", "default": false }, diff --git a/services/web/src/modals/EditUser.js b/services/web/src/modals/EditUser.js index a7204cb1..ccb2b48a 100644 --- a/services/web/src/modals/EditUser.js +++ b/services/web/src/modals/EditUser.js @@ -123,10 +123,10 @@ export default class EditUser extends React.Component { onChange={(e, { value }) => this.setField('roles', value)} /> - this.setField('isDeveloper', checked) + this.setField('isTester', checked) } /> diff --git a/services/web/src/screens/Users/List/index.js b/services/web/src/screens/Users/List/index.js index 628a53c9..862e4544 100644 --- a/services/web/src/screens/Users/List/index.js +++ b/services/web/src/screens/Users/List/index.js @@ -19,7 +19,6 @@ import { formatDateTime } from 'utils/date'; import { request } from 'utils/api'; import { formatRoles } from 'utils/permissions'; - import Actions from '../Actions'; @screen @@ -76,8 +75,8 @@ export default class UserList extends React.Component { .join(', '); }, }, - isDeveloper: { - label: 'Is Developer', + isTester: { + label: 'Is Tester', type: 'boolean', }, createdAt: { @@ -119,10 +118,7 @@ export default class UserList extends React.Component { onDataNeeded={this.fetchRoles} /> - +