@webiny/app-headless-cms 5.35.0 → 5.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/plugins/index.d.ts +2 -2
- package/allPlugins.d.ts +2 -2
- package/package.json +29 -29
- package/admin/plugins/upgrades/5.19.0/UpgradeItemsInfo.d.ts +0 -7
- package/admin/plugins/upgrades/5.19.0/UpgradeItemsInfo.js +0 -65
- package/admin/plugins/upgrades/5.19.0/UpgradeItemsInfo.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/createCmsApolloClient.d.ts +0 -7
- package/admin/plugins/upgrades/5.19.0/createCmsApolloClient.js +0 -67
- package/admin/plugins/upgrades/5.19.0/createCmsApolloClient.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/createListEntriesQuery.d.ts +0 -2
- package/admin/plugins/upgrades/5.19.0/createListEntriesQuery.js +0 -26
- package/admin/plugins/upgrades/5.19.0/createListEntriesQuery.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/createListModelsQuery.d.ts +0 -1
- package/admin/plugins/upgrades/5.19.0/createListModelsQuery.js +0 -20
- package/admin/plugins/upgrades/5.19.0/createListModelsQuery.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/createRepublishMutation.d.ts +0 -2
- package/admin/plugins/upgrades/5.19.0/createRepublishMutation.js +0 -23
- package/admin/plugins/upgrades/5.19.0/createRepublishMutation.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/createUpgradeMutation.d.ts +0 -1
- package/admin/plugins/upgrades/5.19.0/createUpgradeMutation.js +0 -20
- package/admin/plugins/upgrades/5.19.0/createUpgradeMutation.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/fetchModelEntries.d.ts +0 -7
- package/admin/plugins/upgrades/5.19.0/fetchModelEntries.js +0 -137
- package/admin/plugins/upgrades/5.19.0/fetchModelEntries.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/types.d.ts +0 -47
- package/admin/plugins/upgrades/5.19.0/types.js +0 -5
- package/admin/plugins/upgrades/5.19.0/types.js.map +0 -1
- package/admin/plugins/upgrades/5.33.0/locales.d.ts +0 -7
- package/admin/plugins/upgrades/5.33.0/locales.js +0 -65
- package/admin/plugins/upgrades/5.33.0/locales.js.map +0 -1
- package/admin/plugins/upgrades/5.33.0/types.d.ts +0 -7
- package/admin/plugins/upgrades/5.33.0/types.js +0 -5
- package/admin/plugins/upgrades/5.33.0/types.js.map +0 -1
- package/admin/plugins/upgrades/5.33.0/upgrade.d.ts +0 -8
- package/admin/plugins/upgrades/5.33.0/upgrade.js +0 -81
- package/admin/plugins/upgrades/5.33.0/upgrade.js.map +0 -1
- package/admin/plugins/upgrades/v5.0.0.d.ts +0 -5
- package/admin/plugins/upgrades/v5.0.0.js +0 -111
- package/admin/plugins/upgrades/v5.0.0.js.map +0 -1
- package/admin/plugins/upgrades/v5.19.0.d.ts +0 -5
- package/admin/plugins/upgrades/v5.19.0.js +0 -684
- package/admin/plugins/upgrades/v5.19.0.js.map +0 -1
- package/admin/plugins/upgrades/v5.33.0.d.ts +0 -6
- package/admin/plugins/upgrades/v5.33.0.js +0 -191
- package/admin/plugins/upgrades/v5.33.0.js.map +0 -1
- package/admin/plugins/upgrades/v5.5.0.d.ts +0 -5
- package/admin/plugins/upgrades/v5.5.0.js +0 -111
- package/admin/plugins/upgrades/v5.5.0.js.map +0 -1
- package/admin/plugins/upgrades/v5.8.0.d.ts +0 -5
- package/admin/plugins/upgrades/v5.8.0.js +0 -111
- package/admin/plugins/upgrades/v5.8.0.js.map +0 -1
- package/admin/views/contentEntries/experiment/Property.d.ts +0 -34
- package/admin/views/contentEntries/experiment/Property.js +0 -248
- package/admin/views/contentEntries/experiment/Property.js.map +0 -1
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { I18NLocaleItem } from "@webiny/app-i18n/types";
|
|
2
|
-
import { ApolloClient } from "apollo-client";
|
|
3
|
-
interface FetchLocaleParams {
|
|
4
|
-
client: ApolloClient<any>;
|
|
5
|
-
}
|
|
6
|
-
export declare const fetchLocales: (params: FetchLocaleParams) => Promise<I18NLocaleItem[]>;
|
|
7
|
-
export {};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.fetchLocales = void 0;
|
|
9
|
-
|
|
10
|
-
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
11
|
-
|
|
12
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
|
-
var _graphql = require("@webiny/app-i18n/admin/views/locales/hooks/graphql");
|
|
15
|
-
|
|
16
|
-
var fetchLocales = /*#__PURE__*/function () {
|
|
17
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(params) {
|
|
18
|
-
var _response$data, _response$data$i18n;
|
|
19
|
-
|
|
20
|
-
var client, response;
|
|
21
|
-
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
22
|
-
while (1) {
|
|
23
|
-
switch (_context.prev = _context.next) {
|
|
24
|
-
case 0:
|
|
25
|
-
client = params.client;
|
|
26
|
-
_context.next = 3;
|
|
27
|
-
return client.query({
|
|
28
|
-
query: _graphql.LIST_LOCALES
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
case 3:
|
|
32
|
-
response = _context.sent;
|
|
33
|
-
|
|
34
|
-
if ((_response$data = response.data) !== null && _response$data !== void 0 && (_response$data$i18n = _response$data.i18n) !== null && _response$data$i18n !== void 0 && _response$data$i18n.listI18NLocales) {
|
|
35
|
-
_context.next = 8;
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
throw new Error("Missing response when fetching locales.");
|
|
40
|
-
|
|
41
|
-
case 8:
|
|
42
|
-
if (!response.data.i18n.listI18NLocales.error) {
|
|
43
|
-
_context.next = 10;
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
throw new Error(response.data.i18n.listI18NLocales.error.message);
|
|
48
|
-
|
|
49
|
-
case 10:
|
|
50
|
-
return _context.abrupt("return", response.data.i18n.listI18NLocales.data || []);
|
|
51
|
-
|
|
52
|
-
case 11:
|
|
53
|
-
case "end":
|
|
54
|
-
return _context.stop();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}, _callee);
|
|
58
|
-
}));
|
|
59
|
-
|
|
60
|
-
return function fetchLocales(_x) {
|
|
61
|
-
return _ref.apply(this, arguments);
|
|
62
|
-
};
|
|
63
|
-
}();
|
|
64
|
-
|
|
65
|
-
exports.fetchLocales = fetchLocales;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["fetchLocales","params","client","query","LIST_LOCALES","response","data","i18n","listI18NLocales","Error","error","message"],"sources":["locales.ts"],"sourcesContent":["import { I18NLocaleItem } from \"@webiny/app-i18n/types\";\nimport { ApolloClient } from \"apollo-client\";\nimport { LIST_LOCALES } from \"@webiny/app-i18n/admin/views/locales/hooks/graphql\";\n\ninterface FetchLocaleParams {\n client: ApolloClient<any>;\n}\n\nexport const fetchLocales = async (params: FetchLocaleParams): Promise<I18NLocaleItem[]> => {\n const { client } = params;\n\n const response = await client.query({\n query: LIST_LOCALES\n });\n if (!response.data?.i18n?.listI18NLocales) {\n throw new Error(\"Missing response when fetching locales.\");\n } else if (response.data.i18n.listI18NLocales.error) {\n throw new Error(response.data.i18n.listI18NLocales.error.message);\n }\n\n return response.data.i18n.listI18NLocales.data || [];\n};\n"],"mappings":";;;;;;;;;;;;;AAEA;;AAMO,IAAMA,YAAY;EAAA,kGAAG,iBAAOC,MAAP;IAAA;;IAAA;IAAA;MAAA;QAAA;UAAA;YAChBC,MADgB,GACLD,MADK,CAChBC,MADgB;YAAA;YAAA,OAGDA,MAAM,CAACC,KAAP,CAAa;cAChCA,KAAK,EAAEC;YADyB,CAAb,CAHC;;UAAA;YAGlBC,QAHkB;;YAAA,sBAMnBA,QAAQ,CAACC,IANU,kEAMnB,eAAeC,IANI,gDAMnB,oBAAqBC,eANF;cAAA;cAAA;YAAA;;YAAA,MAOd,IAAIC,KAAJ,CAAU,yCAAV,CAPc;;UAAA;YAAA,KAQbJ,QAAQ,CAACC,IAAT,CAAcC,IAAd,CAAmBC,eAAnB,CAAmCE,KARtB;cAAA;cAAA;YAAA;;YAAA,MASd,IAAID,KAAJ,CAAUJ,QAAQ,CAACC,IAAT,CAAcC,IAAd,CAAmBC,eAAnB,CAAmCE,KAAnC,CAAyCC,OAAnD,CATc;;UAAA;YAAA,iCAYjBN,QAAQ,CAACC,IAAT,CAAcC,IAAd,CAAmBC,eAAnB,CAAmCF,IAAnC,IAA2C,EAZ1B;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAAH;;EAAA,gBAAZN,YAAY;IAAA;EAAA;AAAA,GAAlB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { I18NLocaleItem } from \"@webiny/app-i18n/types\";\n\nexport interface UpgradeLocaleItem {\n locale: I18NLocaleItem;\n upgrading: boolean;\n done: boolean;\n error?: string | null;\n}\n"],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ApolloClient } from "apollo-client";
|
|
2
|
-
import { I18NLocaleItem } from "@webiny/app-i18n/types";
|
|
3
|
-
interface UpgradeParams {
|
|
4
|
-
locales?: I18NLocaleItem[] | null;
|
|
5
|
-
client: ApolloClient<any>;
|
|
6
|
-
}
|
|
7
|
-
export declare const runUpgrade: (params: UpgradeParams) => Promise<void>;
|
|
8
|
-
export {};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.runUpgrade = void 0;
|
|
9
|
-
|
|
10
|
-
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
11
|
-
|
|
12
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
|
-
var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
|
|
17
|
-
|
|
18
|
-
var _templateObject;
|
|
19
|
-
|
|
20
|
-
var UPGRADE_MUTATION = (0, _graphqlTag.default)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n mutation UpgradeCMS($version: String!) {\n cms {\n upgrade(version: $version) {\n data\n error {\n code\n message\n data\n }\n }\n }\n }\n"])));
|
|
21
|
-
|
|
22
|
-
var runUpgrade = /*#__PURE__*/function () {
|
|
23
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(params) {
|
|
24
|
-
var locales, client, response, error;
|
|
25
|
-
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
26
|
-
while (1) {
|
|
27
|
-
switch (_context.prev = _context.next) {
|
|
28
|
-
case 0:
|
|
29
|
-
locales = params.locales, client = params.client;
|
|
30
|
-
|
|
31
|
-
if (!(!locales || locales.length === 0)) {
|
|
32
|
-
_context.next = 3;
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
throw new Error("There are no locales to be upgraded. Please check the log and report this to the Webiny team.");
|
|
37
|
-
|
|
38
|
-
case 3:
|
|
39
|
-
_context.next = 5;
|
|
40
|
-
return client.mutate({
|
|
41
|
-
mutation: UPGRADE_MUTATION,
|
|
42
|
-
variables: {
|
|
43
|
-
version: "5.33.0"
|
|
44
|
-
},
|
|
45
|
-
fetchPolicy: "no-cache"
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
case 5:
|
|
49
|
-
response = _context.sent;
|
|
50
|
-
|
|
51
|
-
if (response.data) {
|
|
52
|
-
_context.next = 8;
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
throw new Error("Missing response when trying to upgrade the system. Please contact the Webiny team.");
|
|
57
|
-
|
|
58
|
-
case 8:
|
|
59
|
-
error = response.data.cms.upgrade.error;
|
|
60
|
-
|
|
61
|
-
if (!error) {
|
|
62
|
-
_context.next = 11;
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
throw new Error(error.message);
|
|
67
|
-
|
|
68
|
-
case 11:
|
|
69
|
-
case "end":
|
|
70
|
-
return _context.stop();
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}, _callee);
|
|
74
|
-
}));
|
|
75
|
-
|
|
76
|
-
return function runUpgrade(_x) {
|
|
77
|
-
return _ref.apply(this, arguments);
|
|
78
|
-
};
|
|
79
|
-
}();
|
|
80
|
-
|
|
81
|
-
exports.runUpgrade = runUpgrade;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["UPGRADE_MUTATION","gql","runUpgrade","params","locales","client","length","Error","mutate","mutation","variables","version","fetchPolicy","response","data","error","cms","upgrade","message"],"sources":["upgrade.ts"],"sourcesContent":["import { ApolloClient } from \"apollo-client\";\nimport gql from \"graphql-tag\";\nimport { CmsErrorResponse } from \"~/types\";\nimport { I18NLocaleItem } from \"@webiny/app-i18n/types\";\n\ninterface UpgradeMutationResponse {\n cms: {\n upgrade: {\n data: boolean | null;\n error?: CmsErrorResponse;\n };\n };\n}\ninterface UpgradeMutationVariables {\n version: string;\n}\nconst UPGRADE_MUTATION = gql`\n mutation UpgradeCMS($version: String!) {\n cms {\n upgrade(version: $version) {\n data\n error {\n code\n message\n data\n }\n }\n }\n }\n`;\n\ninterface UpgradeParams {\n locales?: I18NLocaleItem[] | null;\n client: ApolloClient<any>;\n}\nexport const runUpgrade = async (params: UpgradeParams): Promise<void> => {\n const { locales, client } = params;\n if (!locales || locales.length === 0) {\n throw new Error(\n `There are no locales to be upgraded. Please check the log and report this to the Webiny team.`\n );\n }\n\n const response = await client.mutate<UpgradeMutationResponse, UpgradeMutationVariables>({\n mutation: UPGRADE_MUTATION,\n variables: {\n version: \"5.33.0\"\n },\n fetchPolicy: \"no-cache\"\n });\n\n if (!response.data) {\n throw new Error(\n \"Missing response when trying to upgrade the system. Please contact the Webiny team.\"\n );\n }\n const error = response.data.cms.upgrade.error;\n if (error) {\n throw new Error(error.message);\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;AACA;;;;AAeA,IAAMA,gBAAgB,OAAGC,mBAAH,iXAAtB;;AAmBO,IAAMC,UAAU;EAAA,kGAAG,iBAAOC,MAAP;IAAA;IAAA;MAAA;QAAA;UAAA;YACdC,OADc,GACMD,MADN,CACdC,OADc,EACLC,MADK,GACMF,MADN,CACLE,MADK;;YAAA,MAElB,CAACD,OAAD,IAAYA,OAAO,CAACE,MAAR,KAAmB,CAFb;cAAA;cAAA;YAAA;;YAAA,MAGZ,IAAIC,KAAJ,iGAHY;;UAAA;YAAA;YAAA,OAQCF,MAAM,CAACG,MAAP,CAAiE;cACpFC,QAAQ,EAAET,gBAD0E;cAEpFU,SAAS,EAAE;gBACPC,OAAO,EAAE;cADF,CAFyE;cAKpFC,WAAW,EAAE;YALuE,CAAjE,CARD;;UAAA;YAQhBC,QARgB;;YAAA,IAgBjBA,QAAQ,CAACC,IAhBQ;cAAA;cAAA;YAAA;;YAAA,MAiBZ,IAAIP,KAAJ,CACF,qFADE,CAjBY;;UAAA;YAqBhBQ,KArBgB,GAqBRF,QAAQ,CAACC,IAAT,CAAcE,GAAd,CAAkBC,OAAlB,CAA0BF,KArBlB;;YAAA,KAsBlBA,KAtBkB;cAAA;cAAA;YAAA;;YAAA,MAuBZ,IAAIR,KAAJ,CAAUQ,KAAK,CAACG,OAAhB,CAvBY;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAAH;;EAAA,gBAAVhB,UAAU;IAAA;EAAA;AAAA,GAAhB"}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.default = void 0;
|
|
11
|
-
|
|
12
|
-
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
13
|
-
|
|
14
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
-
|
|
16
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
-
|
|
18
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
|
-
var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
|
|
23
|
-
|
|
24
|
-
var _i18n = require("@webiny/app/i18n");
|
|
25
|
-
|
|
26
|
-
var _SimpleForm = require("@webiny/app-admin/components/SimpleForm");
|
|
27
|
-
|
|
28
|
-
var _reactHooks = require("@apollo/react-hooks");
|
|
29
|
-
|
|
30
|
-
var _Alert = require("@webiny/ui/Alert");
|
|
31
|
-
|
|
32
|
-
var _Progress = require("@webiny/ui/Progress");
|
|
33
|
-
|
|
34
|
-
var _Grid = require("@webiny/ui/Grid");
|
|
35
|
-
|
|
36
|
-
var _Button = require("@webiny/ui/Button");
|
|
37
|
-
|
|
38
|
-
var _Typography = require("@webiny/ui/Typography");
|
|
39
|
-
|
|
40
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
41
|
-
|
|
42
|
-
var t = _i18n.i18n.ns("app-headless-cms/admin/installation");
|
|
43
|
-
|
|
44
|
-
var UPGRADE = (0, _graphqlTag.default)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n mutation UpgradeCMS($version: String!) {\n cms {\n upgrade(version: $version) {\n data\n error {\n code\n message\n data\n }\n }\n }\n }\n"])));
|
|
45
|
-
|
|
46
|
-
var Upgrade = function Upgrade(_ref) {
|
|
47
|
-
var onInstalled = _ref.onInstalled;
|
|
48
|
-
var client = (0, _reactHooks.useApolloClient)();
|
|
49
|
-
|
|
50
|
-
var _useState = (0, _react.useState)(null),
|
|
51
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
52
|
-
error = _useState2[0],
|
|
53
|
-
setError = _useState2[1];
|
|
54
|
-
|
|
55
|
-
var _useState3 = (0, _react.useState)(false),
|
|
56
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
57
|
-
loading = _useState4[0],
|
|
58
|
-
setLoading = _useState4[1];
|
|
59
|
-
|
|
60
|
-
var startUpgrade = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
61
|
-
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
62
|
-
while (1) {
|
|
63
|
-
switch (_context.prev = _context.next) {
|
|
64
|
-
case 0:
|
|
65
|
-
setLoading(true);
|
|
66
|
-
_context.next = 3;
|
|
67
|
-
return client.mutate({
|
|
68
|
-
mutation: UPGRADE,
|
|
69
|
-
variables: {
|
|
70
|
-
version: "5.0.0"
|
|
71
|
-
}
|
|
72
|
-
}).then(function (_ref3) {
|
|
73
|
-
var data = _ref3.data;
|
|
74
|
-
setLoading(false);
|
|
75
|
-
var error = data.cms.upgrade.error;
|
|
76
|
-
|
|
77
|
-
if (error) {
|
|
78
|
-
setError(error.message);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
onInstalled();
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
case 3:
|
|
86
|
-
case "end":
|
|
87
|
-
return _context.stop();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}, _callee);
|
|
91
|
-
})), []);
|
|
92
|
-
var label = error ? /*#__PURE__*/_react.default.createElement(_Alert.Alert, {
|
|
93
|
-
title: t(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["Something went wrong"]))),
|
|
94
|
-
type: "danger"
|
|
95
|
-
}, error) : t(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["Upgrading Headless CMS..."])));
|
|
96
|
-
return /*#__PURE__*/_react.default.createElement(_SimpleForm.SimpleForm, null, loading && /*#__PURE__*/_react.default.createElement(_Progress.CircularProgress, {
|
|
97
|
-
label: label
|
|
98
|
-
}), /*#__PURE__*/_react.default.createElement(_SimpleForm.SimpleFormHeader, {
|
|
99
|
-
title: "Upgrade Headless CMS"
|
|
100
|
-
}), /*#__PURE__*/_react.default.createElement(_SimpleForm.SimpleFormContent, null, /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
101
|
-
span: 12
|
|
102
|
-
}, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
103
|
-
use: "body1",
|
|
104
|
-
tag: "div"
|
|
105
|
-
}, "This upgrade will do the following:", /*#__PURE__*/_react.default.createElement("ul", null, /*#__PURE__*/_react.default.createElement("li", null, "create a separate Elasticsearch index for each content model"), /*#__PURE__*/_react.default.createElement("li", null, "upgrade data stored into Elasticsearch for certain data types"), /*#__PURE__*/_react.default.createElement("li", null, "insert Elasticsearch records into a dedicated DynamoDB table")))))), /*#__PURE__*/_react.default.createElement(_SimpleForm.SimpleFormFooter, null, /*#__PURE__*/_react.default.createElement(_Button.ButtonPrimary, {
|
|
106
|
-
onClick: startUpgrade
|
|
107
|
-
}, "Upgrade")));
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
var _default = Upgrade;
|
|
111
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["t","i18n","ns","UPGRADE","gql","Upgrade","onInstalled","client","useApolloClient","useState","error","setError","loading","setLoading","startUpgrade","useCallback","mutate","mutation","variables","version","then","data","cms","upgrade","message","label"],"sources":["v5.0.0.tsx"],"sourcesContent":["// @ts-nocheck\nimport React, { useCallback, useState } from \"react\";\nimport gql from \"graphql-tag\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport {\n SimpleForm,\n SimpleFormContent,\n SimpleFormFooter,\n SimpleFormHeader\n} from \"@webiny/app-admin/components/SimpleForm\";\nimport { useApolloClient } from \"@apollo/react-hooks\";\nimport { Alert } from \"@webiny/ui/Alert\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { Cell, Grid } from \"@webiny/ui/Grid\";\nimport { ButtonPrimary } from \"@webiny/ui/Button\";\nimport { Typography } from \"@webiny/ui/Typography\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/installation\");\n\nconst UPGRADE = gql`\n mutation UpgradeCMS($version: String!) {\n cms {\n upgrade(version: $version) {\n data\n error {\n code\n message\n data\n }\n }\n }\n }\n`;\n\nconst Upgrade = ({ onInstalled }) => {\n const client = useApolloClient();\n const [error, setError] = useState(null);\n const [loading, setLoading] = useState(false);\n\n const startUpgrade = useCallback(async () => {\n setLoading(true);\n await client\n .mutate({\n mutation: UPGRADE,\n variables: {\n version: \"5.0.0\"\n }\n })\n .then(({ data }) => {\n setLoading(false);\n const { error } = data.cms.upgrade;\n if (error) {\n setError(error.message);\n return;\n }\n\n onInstalled();\n });\n }, []);\n\n const label = error ? (\n <Alert title={t`Something went wrong`} type={\"danger\"}>\n {error}\n </Alert>\n ) : (\n t`Upgrading Headless CMS...`\n );\n\n return (\n <SimpleForm>\n {loading && <CircularProgress label={label} />}\n <SimpleFormHeader title={\"Upgrade Headless CMS\"} />\n <SimpleFormContent>\n <Grid>\n <Cell span={12}>\n <Typography use={\"body1\"} tag={\"div\"}>\n This upgrade will do the following:\n <ul>\n <li>\n create a separate Elasticsearch index for each content model\n </li>\n <li>\n upgrade data stored into Elasticsearch for certain data types\n </li>\n <li>\n insert Elasticsearch records into a dedicated DynamoDB table\n </li>\n </ul>\n </Typography>\n </Cell>\n </Grid>\n </SimpleFormContent>\n <SimpleFormFooter>\n <ButtonPrimary onClick={startUpgrade}>Upgrade</ButtonPrimary>\n </SimpleFormFooter>\n </SimpleForm>\n );\n};\n\nexport default Upgrade;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,CAAC,GAAGC,UAAA,CAAKC,EAAL,CAAQ,qCAAR,CAAV;;AAEA,IAAMC,OAAO,OAAGC,mBAAH,iXAAb;;AAeA,IAAMC,OAAO,GAAG,SAAVA,OAAU,OAAqB;EAAA,IAAlBC,WAAkB,QAAlBA,WAAkB;EACjC,IAAMC,MAAM,GAAG,IAAAC,2BAAA,GAAf;;EACA,gBAA0B,IAAAC,eAAA,EAAS,IAAT,CAA1B;EAAA;EAAA,IAAOC,KAAP;EAAA,IAAcC,QAAd;;EACA,iBAA8B,IAAAF,eAAA,EAAS,KAAT,CAA9B;EAAA;EAAA,IAAOG,OAAP;EAAA,IAAgBC,UAAhB;;EAEA,IAAMC,YAAY,GAAG,IAAAC,kBAAA,uGAAY;IAAA;MAAA;QAAA;UAAA;YAC7BF,UAAU,CAAC,IAAD,CAAV;YAD6B;YAAA,OAEvBN,MAAM,CACPS,MADC,CACM;cACJC,QAAQ,EAAEd,OADN;cAEJe,SAAS,EAAE;gBACPC,OAAO,EAAE;cADF;YAFP,CADN,EAODC,IAPC,CAOI,iBAAc;cAAA,IAAXC,IAAW,SAAXA,IAAW;cAChBR,UAAU,CAAC,KAAD,CAAV;cACA,IAAQH,KAAR,GAAkBW,IAAI,CAACC,GAAL,CAASC,OAA3B,CAAQb,KAAR;;cACA,IAAIA,KAAJ,EAAW;gBACPC,QAAQ,CAACD,KAAK,CAACc,OAAP,CAAR;gBACA;cACH;;cAEDlB,WAAW;YACd,CAhBC,CAFuB;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAAZ,IAmBlB,EAnBkB,CAArB;EAqBA,IAAMmB,KAAK,GAAGf,KAAK,gBACf,6BAAC,YAAD;IAAO,KAAK,EAAEV,CAAF,yGAAZ;IAAuC,IAAI,EAAE;EAA7C,GACKU,KADL,CADe,GAKfV,CALe,8GAAnB;EAQA,oBACI,6BAAC,sBAAD,QACKY,OAAO,iBAAI,6BAAC,0BAAD;IAAkB,KAAK,EAAEa;EAAzB,EADhB,eAEI,6BAAC,4BAAD;IAAkB,KAAK,EAAE;EAAzB,EAFJ,eAGI,6BAAC,6BAAD,qBACI,6BAAC,UAAD,qBACI,6BAAC,UAAD;IAAM,IAAI,EAAE;EAAZ,gBACI,6BAAC,sBAAD;IAAY,GAAG,EAAE,OAAjB;IAA0B,GAAG,EAAE;EAA/B,GAAsC,qCAAtC,eAEI,sDACI,yCAAI,8DAAJ,CADJ,eAII,yCAAI,+DAAJ,CAJJ,eAOI,yCAAI,8DAAJ,CAPJ,CAFJ,CADJ,CADJ,CADJ,CAHJ,eAuBI,6BAAC,4BAAD,qBACI,6BAAC,qBAAD;IAAe,OAAO,EAAEX;EAAxB,GAAsC,SAAtC,CADJ,CAvBJ,CADJ;AA6BH,CA/DD;;eAiEeT,O"}
|