@strapi/admin 4.0.0-next.11 → 4.0.0-next.12

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.
Files changed (28) hide show
  1. package/admin/src/content-manager/components/CustomTable/index.js +2 -2
  2. package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +2 -2
  3. package/admin/src/content-manager/components/SelectMany/ListItem.js +1 -1
  4. package/admin/src/content-manager/components/SelectMany/Relation.js +1 -1
  5. package/admin/src/content-manager/components/SelectOne/SingleValue.js +2 -2
  6. package/admin/src/content-manager/components/SelectWrapper/Option.js +2 -2
  7. package/admin/src/content-manager/pages/EditView/DeleteLink/utils/select.js +1 -1
  8. package/admin/src/content-manager/pages/EditView/Header/index.js +1 -1
  9. package/admin/src/content-manager/pages/EditView/Header/utils/getDraftRelations.js +3 -3
  10. package/admin/src/content-manager/pages/EditView/InformationCard.js +5 -5
  11. package/admin/src/content-manager/pages/ListView/index.js +1 -1
  12. package/admin/src/content-manager/testUtils/data.js +6 -6
  13. package/admin/src/utils/getAttributesToDisplay.js +1 -1
  14. package/build/3742.123667cd.chunk.js +1 -0
  15. package/build/Admin-authenticatedApp.53bff43e.chunk.js +1 -0
  16. package/build/content-manager.c202efb6.chunk.js +1 -0
  17. package/build/content-type-builder.44a5dd4d.chunk.js +1 -0
  18. package/build/index.html +1 -1
  19. package/build/main.f2173f94.js +2 -0
  20. package/build/main.f2173f94.js.LICENSE.txt +120 -0
  21. package/build/runtime~main.b3de276f.js +1 -0
  22. package/ee/server/controllers/authentication/utils.js +1 -1
  23. package/ee/server/services/role.js +2 -1
  24. package/package.json +5 -5
  25. package/server/bootstrap.js +1 -1
  26. package/server/config/admin-conditions.js +2 -2
  27. package/server/register.js +1 -7
  28. package/server/config/migrations/permissions-fields-to-properties.js +0 -104
@@ -0,0 +1,120 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+
7
+ /*!
8
+ Copyright (c) 2018 Jed Watson.
9
+ Licensed under the MIT License (MIT), see
10
+ http://jedwatson.github.io/classnames
11
+ */
12
+
13
+ /*!
14
+ * Cropper.js v1.5.12
15
+ * https://fengyuanchen.github.io/cropperjs
16
+ *
17
+ * Copyright 2015-present Chen Fengyuan
18
+ * Released under the MIT license
19
+ *
20
+ * Date: 2021-06-12T08:00:17.411Z
21
+ */
22
+
23
+ /*!
24
+ * Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com
25
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
26
+ */
27
+
28
+ /*!
29
+ * The buffer module from node.js, for the browser.
30
+ *
31
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
32
+ * @license MIT
33
+ */
34
+
35
+ /*! *****************************************************************************
36
+ Copyright (c) Microsoft Corporation.
37
+
38
+ Permission to use, copy, modify, and/or distribute this software for any
39
+ purpose with or without fee is hereby granted.
40
+
41
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
42
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
43
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
44
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
45
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
46
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
47
+ PERFORMANCE OF THIS SOFTWARE.
48
+ ***************************************************************************** */
49
+
50
+ /** @license React v0.20.2
51
+ * scheduler.production.min.js
52
+ *
53
+ * Copyright (c) Facebook, Inc. and its affiliates.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE file in the root directory of this source tree.
57
+ */
58
+
59
+ /** @license React v16.13.1
60
+ * react-is.production.min.js
61
+ *
62
+ * Copyright (c) Facebook, Inc. and its affiliates.
63
+ *
64
+ * This source code is licensed under the MIT license found in the
65
+ * LICENSE file in the root directory of this source tree.
66
+ */
67
+
68
+ /** @license React v17.0.2
69
+ * react-dom.production.min.js
70
+ *
71
+ * Copyright (c) Facebook, Inc. and its affiliates.
72
+ *
73
+ * This source code is licensed under the MIT license found in the
74
+ * LICENSE file in the root directory of this source tree.
75
+ */
76
+
77
+ /** @license React v17.0.2
78
+ * react-jsx-runtime.production.min.js
79
+ *
80
+ * Copyright (c) Facebook, Inc. and its affiliates.
81
+ *
82
+ * This source code is licensed under the MIT license found in the
83
+ * LICENSE file in the root directory of this source tree.
84
+ */
85
+
86
+ /** @license React v17.0.2
87
+ * react.production.min.js
88
+ *
89
+ * Copyright (c) Facebook, Inc. and its affiliates.
90
+ *
91
+ * This source code is licensed under the MIT license found in the
92
+ * LICENSE file in the root directory of this source tree.
93
+ */
94
+
95
+ /**!
96
+ * @fileOverview Kickass library to create and place poppers near their reference elements.
97
+ * @version 1.16.1
98
+ * @license
99
+ * Copyright (c) 2016 Federico Zivolo and contributors
100
+ *
101
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
102
+ * of this software and associated documentation files (the "Software"), to deal
103
+ * in the Software without restriction, including without limitation the rights
104
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
105
+ * copies of the Software, and to permit persons to whom the Software is
106
+ * furnished to do so, subject to the following conditions:
107
+ *
108
+ * The above copyright notice and this permission notice shall be included in all
109
+ * copies or substantial portions of the Software.
110
+ *
111
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
112
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
113
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
114
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
115
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
116
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
117
+ * SOFTWARE.
118
+ */
119
+
120
+ //! moment.js
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var n={},t={};function a(s){var e=t[s];if(void 0!==e)return e.exports;var o=t[s]={id:s,loaded:!1,exports:{}};return n[s](o,o.exports,a),o.loaded=!0,o.exports}a.m=n,a.amdO={},(()=>{var n=[];a.O=(t,s,e,o)=>{if(!s){var r=1/0;for(d=0;d<n.length;d++){for(var[s,e,o]=n[d],i=!0,l=0;l<s.length;l++)(!1&o||r>=o)&&Object.keys(a.O).every((n=>a.O[n](s[l])))?s.splice(l--,1):(i=!1,o<r&&(r=o));i&&(n.splice(d--,1),t=e())}return t}o=o||0;for(var d=n.length;d>0&&n[d-1][2]>o;d--)n[d]=n[d-1];n[d]=[s,e,o]}})(),a.n=n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return a.d(t,{a:t}),t},(()=>{var n,t=Object.getPrototypeOf?n=>Object.getPrototypeOf(n):n=>n.__proto__;a.t=function(s,e){if(1&e&&(s=this(s)),8&e)return s;if("object"===typeof s&&s){if(4&e&&s.__esModule)return s;if(16&e&&"function"===typeof s.then)return s}var o=Object.create(null);a.r(o);var r={};n=n||[null,t({}),t([]),t(t)];for(var i=2&e&&s;"object"==typeof i&&!~n.indexOf(i);i=t(i))Object.getOwnPropertyNames(i).forEach((n=>r[n]=()=>s[n]));return r.default=()=>s,a.d(o,r),o}})(),a.d=(n,t)=>{for(var s in t)a.o(t,s)&&!a.o(n,s)&&Object.defineProperty(n,s,{enumerable:!0,get:t[s]})},a.f={},a.e=n=>Promise.all(Object.keys(a.f).reduce(((t,s)=>(a.f[s](n,t),t)),[])),a.u=n=>(({46:"content-type-builder-translation-zh-Hans-json",47:"sentry-translation-es-json",96:"email-translation-de-json",123:"ru-json",197:"documentation-translation-en-json",223:"sentry-translation-fr-json",302:"sso-settings-page",320:"en-json",395:"tr-json",435:"email-translation-it-json",456:"documentation-translation-zh-json",562:"no-json",587:"sanitize-css",606:"sk-json",615:"upload-translation-uk-json",695:"upload-settings",742:"content-type-builder-translation-th-json",744:"email-translation-cs-json",749:"th-json",801:"Admin-authenticatedApp",830:"he-json",931:"content-type-builder-translation-en-json",953:"codemirror-addon-lint-js",994:"content-manager",1001:"content-type-builder-translation-nl-json",1009:"upload-translation-ms-json",1011:"zh-json",1018:"email-translation-ko-json",1023:"content-type-builder-translation-it-json",1157:"email-translation-pt-BR-json",1167:"users-permissions-translation-ko-json",1312:"ja-json",1331:"upload-translation-es-json",1375:"upload-translation-pt-BR-json",1377:"ko-json",1442:"users-permissions-translation-cs-json",1495:"email-settings-page",1674:"users-permissions-translation-ru-json",1930:"users-permissions-translation-pt-json",1989:"graphql-translation-zh-Hans-json",2110:"sentry-translation-uk-json",2137:"i18n-translation-fr-json",2151:"content-type-builder-translation-id-json",2218:"codemirror-theme",2246:"content-type-builder-translation-dk-json",2268:"documentation-translation-ms-json",2282:"users-providers-settings-page",2294:"sentry-translation-zh-Hans-json",2380:"users-permissions-translation-tr-json",2394:"documentation-translation-pt-json",2411:"email-translation-tr-json",2412:"sentry-translation-nl-json",2427:"sentry-translation-pt-json",2464:"users-permissions-translation-de-json",2544:"admin-edit-roles-page",2553:"zh-Hans-json",2567:"content-type-builder-translation-ko-json",2603:"email-translation-en-json",2629:"documentation-translation-es-json",2648:"email-translation-ar-json",2657:"content-type-builder-translation-cs-json",2671:"nl-json",2742:"users-permissions-translation-zh-Hans-json",2781:"codemirror-addon-lint",2960:"sentry-translation-id-json",3025:"ms-json",3038:"upload-translation-sk-json",3043:"email-translation-zh-Hans-json",3048:"documentation-translation-pt-BR-json",3095:"users-permissions-translation-sk-json",3098:"users-permissions-translation-fr-json",3166:"email-translation-pt-json",3206:"email-translation-nl-json",3217:"sentry-translation-de-json",3278:"vi-json",3304:"content-type-builder-translation-tr-json",3340:"pt-json",3442:"sentry-translation-pl-json",3530:"users-permissions-translation-vi-json",3552:"i18n-settings-page",3650:"upload",3660:"documentation-translation-pl-json",3677:"Admin_pluginsPage",3702:"users-permissions-translation-pl-json",3825:"email-translation-dk-json",3860:"codemirror-javacript",3948:"content-type-builder-translation-pl-json",3964:"content-type-builder-translation-ms-json",3973:"codemirror-css",3981:"Admin_homePage",4010:"documentation-translation-cs-json",4021:"upload-translation-de-json",4121:"webhook-list-page",4179:"users-permissions-translation-id-json",4263:"admin-edit-users",4290:"sentry-translation-vi-json",4302:"content-type-builder-translation-zh-json",4327:"documentation-translation-sk-json",4379:"sentry-translation-en-json",4587:"email-translation-th-json",4674:"documentation-translation-th-json",4693:"email-translation-fr-json",4698:"documentation-translation-tr-json",4802:"documentation-translation-zh-Hans-json",4804:"upload-translation-ru-json",4828:"documentation-translation-ru-json",4869:"documentation-translation-ko-json",4987:"upload-translation-pl-json",5053:"upload-translation-zh-json",5162:"webhook-edit-page",5178:"codemirror-addon-closebrackets",5199:"admin-users",5222:"upload-translation-it-json",5388:"email-translation-ru-json",5396:"users-permissions-translation-zh-json",5398:"sentry-translation-zh-json",5509:"codemirror-addon-mark-selection",5516:"Admin_marketplace",5672:"bootstrap",5751:"email-translation-es-json",5880:"upload-translation-ja-json",5895:"Admin_settingsPage",5906:"content-type-builder-translation-pt-BR-json",5984:"sentry-translation-ar-json",6178:"documentation-translation-vi-json",6211:"documentation-translation-id-json",6232:"upload-translation-th-json",6377:"users-permissions-translation-dk-json",6434:"upload-translation-en-json",6460:"users-permissions-translation-en-json",6688:"documentation-translation-de-json",6745:"email-translation-uk-json",6784:"email-translation-ms-json",6803:"sentry-translation-ru-json",6804:"graphql-translation-fr-json",6814:"documentation-translation-nl-json",6817:"it-json",6831:"upload-translation-zh-Hans-json",6836:"users-permissions-translation-uk-json",6848:"email-translation-zh-json",6901:"de-json",7048:"users-permissions-translation-nl-json",7094:"users-permissions-translation-ar-json",7155:"content-type-builder-translation-de-json",7186:"content-type-builder-translation-ru-json",7327:"email-translation-vi-json",7347:"highlight.js",7403:"uk-json",7409:"documentation-translation-it-json",7465:"upload-translation-dk-json",7519:"cs-json",7566:"fontawesome-css-all",7574:"sentry-translation-it-json",7663:"email-translation-id-json",7723:"fontawesome-css",7758:"sentry-translation-sk-json",7784:"sentry-translation-pt-BR-json",7817:"users-permissions-translation-es-json",7819:"sentry-translation-th-json",7828:"users-permissions-translation-th-json",7833:"upload-translation-fr-json",7846:"pl-json",7898:"dk-json",7934:"content-type-builder-translation-pt-json",7958:"ar-json",7976:"sentry-translation-tr-json",7997:"content-type-builder-translation-sk-json",8e3:"fontawesome-js",8006:"fr-json",8125:"documentation-translation-uk-json",8175:"i18n-translation-en-json",8178:"email-translation-ja-json",8342:"content-type-builder-translation-es-json",8367:"es-json",8418:"users-email-settings-page",8461:"documentation-translation-fr-json",8467:"users-permissions-translation-sv-json",8481:"email-translation-pl-json",8535:"documentation-translation-ar-json",8573:"content-type-builder-translation-uk-json",8736:"users-permissions-translation-pt-BR-json",8824:"sentry-translation-ms-json",8853:"users-roles-settings-page",8880:"content-type-builder",8897:"id-json",8907:"content-type-builder-translation-ja-json",8965:"content-type-builder-translation-fr-json",9220:"users-permissions-translation-ms-json",9231:"sentry-translation-cs-json",9303:"sv-json",9322:"sentry-translation-ko-json",9412:"email-translation-sk-json",9460:"users-advanced-settings-page",9497:"Admin_profilePage",9502:"users-permissions-translation-ja-json",9511:"content-type-builder-translation-ar-json",9605:"graphql-translation-en-json",9647:"pt-BR-json",9762:"i18n-translation-zh-Hans-json",9789:"documentation-page",9797:"upload-translation-he-json",9905:"users-permissions-translation-it-json"}[n]||n)+"."+{46:"70812b36",47:"992d338d",96:"bf146049",123:"e69a821b",197:"f3389cb5",223:"ef6d9b89",302:"b30c14bd",320:"18462604",395:"9ea79242",435:"bb97831b",456:"1fd6063a",562:"f8838a06",587:"55e5ecf7",606:"c516f594",615:"912313bb",695:"977da85f",742:"e0fdeae8",744:"b49b6dce",749:"225b400f",755:"82c8858c",801:"53bff43e",830:"3e5db662",931:"c0075158",953:"2f760678",994:"c202efb6",1001:"4ff07b61",1009:"78ecf0a2",1011:"2e88077c",1018:"fcd6c704",1023:"e1a78be2",1157:"fad76973",1167:"ced08793",1312:"28bd9b2e",1331:"d1e7bcdf",1375:"cc3c672e",1377:"e9ca2110",1442:"4abd6541",1495:"a86ccbb3",1497:"16d9d744",1498:"5f1be810",1549:"db739632",1674:"32f5ce4d",1930:"092f2866",1989:"7a5aede1",2110:"59ee4665",2137:"482f6933",2151:"830424aa",2218:"566843f5",2246:"f12a6585",2268:"b582c1dd",2282:"4b42ab25",2294:"27227284",2380:"4c95f20b",2394:"40589471",2411:"02ba026e",2412:"caea2f28",2427:"36e1ef2a",2464:"38feac1f",2544:"6144ac5b",2553:"1b0c541f",2567:"e0415aea",2603:"b44701b0",2629:"6d90a09d",2648:"fe6d50c4",2657:"cbf194bb",2671:"9375efd8",2742:"238cb27c",2781:"3ad7f1b8",2960:"cfb5d3b5",3025:"6ca39b48",3038:"bd181a95",3043:"59add2d6",3048:"5b73fe48",3095:"dbd3071d",3098:"390bafc8",3166:"e282cd5b",3206:"3924a247",3217:"8530e9c8",3278:"aaa8a311",3304:"0130bb2d",3340:"5b9c33a6",3442:"22d316e1",3530:"d02cb840",3552:"ba3d12ea",3650:"8308075d",3653:"6d4a4b98",3660:"3d63b43c",3677:"089b3778",3702:"5a4c015a",3742:"123667cd",3825:"b0a75b3c",3860:"22f1c1da",3948:"6e1fa6e5",3964:"695fd324",3973:"a04469d4",3981:"80ca7b97",4010:"97ab0df1",4021:"3d331e9a",4045:"f6a67d0d",4121:"5d8e6b6f",4179:"04bea954",4263:"ac8b90c6",4290:"9d1cf971",4302:"9296a29d",4327:"6eaad457",4379:"47f9eb76",4587:"533a795c",4674:"77899e1c",4693:"16456950",4698:"11fad1e3",4802:"c26d97e4",4804:"8ae2fa7e",4828:"b8baff67",4869:"7b8e1c09",4987:"a768716a",5053:"d1f89579",5162:"c1fa006c",5178:"8032b42a",5199:"1b4bbd32",5222:"39f616b2",5388:"e5c65800",5396:"dd0d9997",5398:"c4e5c08f",5509:"db7b80ae",5516:"cf9adf94",5672:"bc3572b4",5751:"e0c4377c",5880:"c55c1c24",5895:"82b0716b",5906:"18fa9f5e",5984:"3d4fbd17",6113:"e32a2e8c",6178:"4783d1b9",6211:"26473050",6232:"a4c82684",6377:"94573b86",6434:"c37cb3f6",6460:"205b3202",6688:"b29e286a",6745:"2e6ba7cc",6784:"04f1b07a",6803:"8515bae4",6804:"f0926dcd",6814:"21840691",6817:"83c5e381",6831:"a653328d",6836:"c02f0a22",6848:"f5b6e276",6901:"8dee05ae",7048:"90c764fd",7094:"1da88ce9",7155:"2e4d0819",7186:"2440d295",7327:"8a8efdcd",7347:"bccc5b7a",7403:"f5d8ce41",7409:"62608277",7465:"4e03ddf4",7519:"4db1184b",7566:"b3df0e1c",7574:"160a3127",7663:"193b2674",7723:"46296ea3",7758:"d1310e19",7784:"18ca6748",7817:"eaa0e959",7819:"85a0a04f",7828:"b5bbfedb",7833:"b66262c8",7846:"3e98997c",7898:"888517f4",7934:"b4065798",7958:"af38c03b",7976:"d326a112",7997:"6df2d918",8e3:"242757b5",8006:"ef4fe2b3",8125:"2aa119c7",8175:"02c63421",8178:"e9580dc0",8342:"e246d121",8367:"be2e5dee",8418:"1d46118b",8461:"e0758918",8467:"1eba8f97",8481:"6dd9a57a",8535:"07e6918b",8573:"930fbfbb",8630:"b13b523b",8736:"e5f7399d",8778:"4a6e9b28",8824:"e71d91ac",8853:"618a56a6",8880:"44a5dd4d",8897:"d3040842",8907:"062cb4b3",8965:"e193f36d",9220:"1500af80",9231:"e02e4329",9303:"1c3ed00d",9322:"f31fb1d0",9412:"8aa9e085",9460:"5a091e4b",9497:"8aabba6d",9502:"0f06f8c4",9511:"5b15a45a",9605:"ce13e360",9647:"f0f5e800",9733:"b73f2224",9762:"d9512909",9789:"823a7efa",9797:"18809a91",9905:"79aac9f7",9944:"4cd02802"}[n]+".chunk.js"),a.miniCssF=n=>{},a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"===typeof window)return window}}(),a.o=(n,t)=>Object.prototype.hasOwnProperty.call(n,t),(()=>{var n={},t="@strapi/admin:";a.l=(s,e,o,r)=>{if(n[s])n[s].push(e);else{var i,l;if(void 0!==o)for(var d=document.getElementsByTagName("script"),c=0;c<d.length;c++){var j=d[c];if(j.getAttribute("src")==s||j.getAttribute("data-webpack")==t+o){i=j;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.setAttribute("data-webpack",t+o),i.src=s),n[s]=[e];var u=(t,a)=>{i.onerror=i.onload=null,clearTimeout(f);var e=n[s];if(delete n[s],i.parentNode&&i.parentNode.removeChild(i),e&&e.forEach((n=>n(a))),t)return t(a)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),l&&document.head.appendChild(i)}}})(),a.r=n=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},a.nmd=n=>(n.paths=[],n.children||(n.children=[]),n),a.p="/admin/",(()=>{var n={1303:0};a.f.j=(t,s)=>{var e=a.o(n,t)?n[t]:void 0;if(0!==e)if(e)s.push(e[2]);else if(1303!=t){var o=new Promise(((a,s)=>e=n[t]=[a,s]));s.push(e[2]=o);var r=a.p+a.u(t),i=new Error;a.l(r,(s=>{if(a.o(n,t)&&(0!==(e=n[t])&&(n[t]=void 0),e)){var o=s&&("load"===s.type?"missing":s.type),r=s&&s.target&&s.target.src;i.message="Loading chunk "+t+" failed.\n("+o+": "+r+")",i.name="ChunkLoadError",i.type=o,i.request=r,e[1](i)}}),"chunk-"+t,t)}else n[t]=0},a.O.j=t=>0===n[t];var t=(t,s)=>{var e,o,[r,i,l]=s,d=0;for(e in i)a.o(i,e)&&(a.m[e]=i[e]);if(l)var c=l(a);for(t&&t(s);d<r.length;d++)o=r[d],a.o(n,o)&&n[o]&&n[o][0](),n[r[d]]=0;return a.O(c)},s=self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})()})();
@@ -8,7 +8,7 @@ const PROVIDER_URLS_MAP = {
8
8
  error: PROVIDER_REDIRECT_ERROR,
9
9
  };
10
10
 
11
- const getAdminStore = async () => strapi.store({ type: 'core', environment: '', name: 'admin' });
11
+ const getAdminStore = async () => strapi.store({ type: 'core', name: 'admin' });
12
12
 
13
13
  const getPrefixedRedirectUrls = () => {
14
14
  const { url: adminUrl } = strapi.config.get('admin');
@@ -3,7 +3,8 @@
3
3
  const { toString } = require('lodash/fp');
4
4
 
5
5
  const ssoCheckRolesIdForDeletion = async ids => {
6
- const adminStore = await strapi.store({ type: 'core', environment: '', name: 'admin' });
6
+ const adminStore = await strapi.store({ type: 'core', name: 'admin' });
7
+
7
8
  const {
8
9
  providers: { defaultRole },
9
10
  } = await adminStore.get({ key: 'auth' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/admin",
3
- "version": "4.0.0-next.11",
3
+ "version": "4.0.0-next.12",
4
4
  "description": "Strapi Admin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,9 +38,9 @@
38
38
  "@fortawesome/free-brands-svg-icons": "^5.15.3",
39
39
  "@fortawesome/free-solid-svg-icons": "^5.15.3",
40
40
  "@fortawesome/react-fontawesome": "^0.1.14",
41
- "@strapi/babel-plugin-switch-ee-ce": "4.0.0-next.11",
42
- "@strapi/helper-plugin": "4.0.0-next.11",
43
- "@strapi/utils": "4.0.0-next.11",
41
+ "@strapi/babel-plugin-switch-ee-ce": "4.0.0-next.12",
42
+ "@strapi/helper-plugin": "4.0.0-next.12",
43
+ "@strapi/utils": "4.0.0-next.12",
44
44
  "axios": "^0.21.1",
45
45
  "babel-loader": "8.2.2",
46
46
  "babel-plugin-styled-components": "1.12.0",
@@ -146,7 +146,7 @@
146
146
  "npm": ">=6.0.0"
147
147
  },
148
148
  "license": "SEE LICENSE IN LICENSE",
149
- "gitHead": "3d8950e29d465a0917db9bbd0e034e5227506716",
149
+ "gitHead": "67af23d827fd48e7782e509a78d0ba66e67e2215",
150
150
  "devDependencies": {
151
151
  "duplicate-dependencies-webpack-plugin": "0.2.0",
152
152
  "webpack-bundle-analyzer": "4.4.1"
@@ -21,7 +21,7 @@ const registerAdminConditions = () => {
21
21
  };
22
22
 
23
23
  const syncAuthSettings = async () => {
24
- const adminStore = await strapi.store({ type: 'core', environment: '', name: 'admin' });
24
+ const adminStore = await strapi.store({ type: 'core', name: 'admin' });
25
25
  const adminAuthSettings = await adminStore.get({ key: 'auth' });
26
26
  const newAuthSettings = merge(defaultAdminAuthSettings, adminAuthSettings);
27
27
 
@@ -6,14 +6,14 @@ module.exports = {
6
6
  displayName: 'Is creator',
7
7
  name: 'is-creator',
8
8
  plugin: 'admin',
9
- handler: user => ({ 'created_by.id': user.id }),
9
+ handler: user => ({ 'createdBy.id': user.id }),
10
10
  },
11
11
  {
12
12
  displayName: 'Has same role as creator',
13
13
  name: 'has-same-role-as-creator',
14
14
  plugin: 'admin',
15
15
  handler: user => ({
16
- 'created_by.roles': {
16
+ 'createdBy.roles': {
17
17
  $elemMatch: {
18
18
  id: {
19
19
  $in: user.roles.map(r => r.id),
@@ -1,8 +1,5 @@
1
- /* eslint-disable no-unused-vars */
2
1
  'use strict';
3
2
 
4
- // const permissionsFieldsToPropertiesMigration = require('../migrations/permissions-fields-to-properties');
5
-
6
3
  const adminAuthStrategy = {
7
4
  name: 'admin',
8
5
  async authenticate(ctx) {
@@ -34,13 +31,13 @@ const adminAuthStrategy = {
34
31
 
35
32
  ctx.state.userAbility = userAbility;
36
33
  ctx.state.user = user;
34
+ ctx.state.isAuthenticatedAdmin = true;
37
35
 
38
36
  return { authenticated: true, credentials: user };
39
37
  }
40
38
 
41
39
  return { error: 'Invalid credentials' };
42
40
  },
43
- // async verify() {},
44
41
  };
45
42
 
46
43
  module.exports = () => {
@@ -48,7 +45,4 @@ module.exports = () => {
48
45
 
49
46
  strapi.server.api('admin').use(passportMiddleware);
50
47
  strapi.container.get('auth').register('admin', adminAuthStrategy);
51
-
52
- // FIXME: to implement
53
- // strapi.db.migrations.register(permissionsFieldsToPropertiesMigration);
54
48
  };
@@ -1,104 +0,0 @@
1
- 'use strict';
2
-
3
- const { has, isObject } = require('lodash/fp');
4
-
5
- const permissionModelUID = 'admin::permission';
6
-
7
- const hasAttribute = attribute => has(`attributes.${attribute}`);
8
- const hasFieldsAttribute = hasAttribute('fields');
9
- const hasPropertiesAttribute = hasAttribute('properties');
10
-
11
- const shouldRunMigration = (definition, previousDefinition) => {
12
- const isAdminPermissionModel = definition.uid === permissionModelUID;
13
-
14
- const hadFieldsButNotProperties =
15
- hasFieldsAttribute(previousDefinition) && !hasPropertiesAttribute(previousDefinition);
16
-
17
- const hasPropertiesButNotFields =
18
- !hasFieldsAttribute(definition) && hasPropertiesAttribute(definition);
19
-
20
- const targetedFieldsHaveChanged = hadFieldsButNotProperties && hasPropertiesButNotFields;
21
-
22
- return isAdminPermissionModel && targetedFieldsHaveChanged;
23
- };
24
-
25
- const permissionsFinderByORM = {
26
- async bookshelf(model) {
27
- const permissions = await model.fetchAll();
28
-
29
- return permissions.toJSON().map(permission => {
30
- const fields = permission.fields;
31
-
32
- return {
33
- ...permission,
34
- fields: isObject(fields) ? fields : JSON.parse(fields),
35
- };
36
- });
37
- },
38
-
39
- async mongoose(model) {
40
- return model.find().lean();
41
- },
42
- };
43
-
44
- module.exports = {
45
- shouldRun: {
46
- before(options) {
47
- const { definition, previousDefinition } = options;
48
-
49
- return shouldRunMigration(definition, previousDefinition);
50
- },
51
-
52
- after(options, context) {
53
- const { definition, previousDefinition } = options;
54
- const { permissionsFieldsToProperties = {} } = context;
55
- const { permissions = [] } = permissionsFieldsToProperties;
56
-
57
- return shouldRunMigration(definition, previousDefinition) && permissions.length > 0;
58
- },
59
- },
60
-
61
- // Here we make a backup of the permission objects in the database, then we store it into the migration context
62
- async before(options, context) {
63
- const { model } = options;
64
-
65
- const permissions = await permissionsFinderByORM[model.orm](model);
66
-
67
- Object.assign(context, { permissionsFieldsToProperties: { permissions } });
68
- },
69
-
70
- // Based on the permissions sent in the context, we perform an update. { fields } => { properties: { fields } }
71
- async after(options, context) {
72
- const { model, ORM } = options;
73
- const { permissionsFieldsToProperties = {} } = context;
74
- const { permissions = [] } = permissionsFieldsToProperties;
75
-
76
- if (model.orm === 'bookshelf') {
77
- const update = async transacting => {
78
- for (const permission of permissions) {
79
- const { fields, ...rest } = permission;
80
-
81
- await model
82
- .forge({ id: rest.id })
83
- .save({ properties: { fields } }, { patch: true, transacting });
84
- }
85
- };
86
-
87
- await ORM.transaction(transacting => update(transacting));
88
- }
89
-
90
- if (model.orm === 'mongoose') {
91
- for (const permission of permissions) {
92
- const { fields, _id } = permission;
93
-
94
- await model.updateOne(
95
- { _id },
96
- {
97
- $set: { properties: { fields } },
98
- $unset: { fields: true },
99
- }
100
- );
101
- }
102
- }
103
- },
104
- };