@openmrs/esm-stock-management-app 1.0.1-pre.357 → 1.0.1-pre.361
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{304.js → 835.js} +2 -2
- package/dist/{304.js.map → 835.js.map} +1 -1
- package/dist/969.js +1 -1
- package/dist/969.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-stock-management-app.js +1 -1
- package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +33 -33
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/stock-lookups/stock-lookups.resource.ts +1 -1
- package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.component.tsx +32 -25
- /package/dist/{304.js.LICENSE.txt → 835.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
|
|
1
|
-
var _openmrs_esm_stock_management_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,s,u,f,p,c,d,h,m,v,g={1371:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(935),t.e(
|
1
|
+
var _openmrs_esm_stock_management_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,s,u,f,p,c,d,h,m,v,g={1371:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(935),t.e(835),t.e(672),t.e(969)]).then((()=>()=>t(2313)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},b={};function y(e){var r=b[e];if(void 0!==r)return r.exports;var t=b[e]={id:e,loaded:!1,exports:{}};return g[e].call(t.exports,t,t.exports,y),t.loaded=!0,t.exports}y.m=g,y.c=b,y.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return y.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,y.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);y.r(o);var a={};e=e||[null,r({}),r([]),r(r)];for(var i=2&n&&t;"object"==typeof i&&!~e.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((e=>a[e]=()=>t[e]));return a.default=()=>t,y.d(o,a),o},y.d=(e,r)=>{for(var t in r)y.o(r,t)&&!y.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},y.f={},y.e=e=>Promise.all(Object.keys(y.f).reduce(((r,t)=>(y.f[t](e,r),r)),[])),y.u=e=>e+".js",y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@openmrs/esm-stock-management-app:",y.l=(e,r,o,a)=>{if(t[e])t[e].push(r);else{var i,l;if(void 0!==o)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var f=s[u];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==n+o){i=f;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,y.nc&&i.setAttribute("nonce",y.nc),i.setAttribute("data-webpack",n+o),i.src=e),t[e]=[r];var p=(r,n)=>{i.onerror=i.onload=null,clearTimeout(c);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},c=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),l&&document.head.appendChild(i)}},y.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},y.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{y.S={};var e={},r={};y.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];y.o(y.S,t)||(y.S[t]={});var a=y.S[t],i="@openmrs/esm-stock-management-app",l=(e,r,t,n)=>{var o=a[e]=a[e]||{},l=o[r];(!l||!l.loaded&&(!n!=!l.eager?n:i>l.from))&&(o[r]={get:t,from:i,eager:!!n})},s=[];return"default"===t&&(l("@openmrs/esm-framework","5.4.1-pre.1561",(()=>Promise.all([y.e(800),y.e(672)]).then((()=>()=>y(4800))))),l("dayjs","1.11.10",(()=>y.e(484).then((()=>()=>y(7484))))),l("react-i18next","11.18.6",(()=>Promise.all([y.e(672),y.e(629)]).then((()=>()=>y(707))))),l("react-router-dom","6.21.1",(()=>Promise.all([y.e(26),y.e(935),y.e(672)]).then((()=>()=>y(8026))))),l("react","18.2.0",(()=>y.e(294).then((()=>()=>y(7294))))),l("swr/_internal","2.2.5",(()=>Promise.all([y.e(46),y.e(672)]).then((()=>()=>y(46)))))),e[t]=s.length?Promise.all(s).then((()=>e[t]=1)):1}}})(),(()=>{var e;y.g.importScripts&&(e=y.g.location+"");var r=y.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),y.p=e})(),o=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},a=(e,r)=>{e=o(e),r=o(r);for(var t=0;;){if(t>=e.length)return t<r.length&&"u"!=(typeof r[t])[0];var n=e[t],a=(typeof n)[0];if(t>=r.length)return"u"==a;var i=r[t],l=(typeof i)[0];if(a!=l)return"o"==a&&"n"==l||"s"==l||"u"==a;if("o"!=a&&"u"!=a&&n!=i)return n<i;t++}},i=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,o=1;o<e.length;o++)n--,t+="u"==(typeof(l=e[o]))[0]?"-":(n>0?".":"")+(n=2,l);return t}var a=[];for(o=1;o<e.length;o++){var l=e[o];a.push(0===l?"not("+s()+")":1===l?"("+s()+" || "+s()+")":2===l?a.pop()+" "+a.pop():i(l))}return s();function s(){return a.pop().replace(/^\((.+)\)$/,"$1")}},l=(e,r)=>{if(0 in e){r=o(r);var t=e[0],n=t<0;n&&(t=-t-1);for(var a=0,i=1,s=!0;;i++,a++){var u,f,p=i<e.length?(typeof e[i])[0]:"";if(a>=r.length||"o"==(f=(typeof(u=r[a]))[0]))return!s||("u"==p?i>t&&!n:""==p!=n);if("u"==f){if(!s||"u"!=p)return!1}else if(s)if(p==f)if(i<=t){if(u!=e[i])return!1}else{if(n?u>e[i]:u<e[i])return!1;u!=e[i]&&(s=!1)}else if("s"!=p&&"n"!=p){if(n||i<=t)return!1;s=!1,i--}else{if(i<=t||f<p!=n)return!1;s=!1}else"s"!=p&&"n"!=p&&(s=!1,i--)}}var c=[],d=c.pop.bind(c);for(a=1;a<e.length;a++){var h=e[a];c.push(1==h?d()|d():2==h?d()&d():h?l(h,r):!d())}return!!d()},s=(e,r)=>{var t=e[r];return Object.keys(t).reduce(((e,r)=>!e||!t[e].loaded&&a(e,r)?r:e),0)},u=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+i(n)+")",f=(e,r,t,n)=>{var o=s(e,t);return l(n,o)||p(u(e,t,o,n)),c(e[t][o])},p=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},c=e=>(e.loaded=1,e.get()),d=(e=>function(r,t,n,o){var a=y.I(r);return a&&a.then?a.then(e.bind(e,r,y.S[r],t,n,o)):e(0,y.S[r],t,n,o)})(((e,r,t,n,o)=>r&&y.o(r,t)?f(r,0,t,n):o())),h={},m={1672:()=>d("default","react",[1,18],(()=>y.e(294).then((()=>()=>y(7294))))),1914:()=>d("default","react-router-dom",[1,6],(()=>y.e(26).then((()=>()=>y(8026))))),2653:()=>d("default","dayjs",[1,1],(()=>y.e(484).then((()=>()=>y(7484))))),3397:()=>d("default","react-i18next",[1,11],(()=>y.e(707).then((()=>()=>y(707))))),5512:()=>d("default","swr/_internal",[1,2],(()=>y.e(46).then((()=>()=>y(46))))),7248:()=>d("default","@openmrs/esm-framework",[1,5],(()=>y.e(800).then((()=>()=>y(4800)))))},v={672:[1672],969:[1914,2653,3397,5512,7248]},y.f.consumes=(e,r)=>{y.o(v,e)&&v[e].forEach((e=>{if(y.o(h,e))return r.push(h[e]);var t=r=>{h[e]=0,y.m[e]=t=>{delete y.c[e],t.exports=r()}},n=r=>{delete h[e],y.m[e]=t=>{throw delete y.c[e],r}};try{var o=m[e]();o.then?r.push(h[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}))},(()=>{var e={122:0};y.f.j=(r,t)=>{var n=y.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(672!=r){var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=y.p+y.u(r),i=new Error;y.l(a,(t=>{if(y.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r,r)}else e[r]=0};var r=(r,t)=>{var n,o,[a,i,l]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in i)y.o(i,n)&&(y.m[n]=i[n]);l&&l(y)}for(r&&r(t);s<a.length;s++)o=a[s],y.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=globalThis.webpackChunk_openmrs_esm_stock_management_app=globalThis.webpackChunk_openmrs_esm_stock_management_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),y.nc=void 0;var _=y(1371);_openmrs_esm_stock_management_app=_})();
|
@@ -78,7 +78,7 @@
|
|
78
78
|
"auxiliaryFiles": [
|
79
79
|
"openmrs-esm-stock-management-app.js.map"
|
80
80
|
],
|
81
|
-
"hash": "
|
81
|
+
"hash": "2df9bd47da2239e3",
|
82
82
|
"childrenByOrder": {}
|
83
83
|
},
|
84
84
|
{
|
@@ -86,10 +86,10 @@
|
|
86
86
|
"initial": true,
|
87
87
|
"entry": true,
|
88
88
|
"recorded": false,
|
89
|
-
"size":
|
89
|
+
"size": 4724429,
|
90
90
|
"sizes": {
|
91
91
|
"consume-shared": 252,
|
92
|
-
"javascript":
|
92
|
+
"javascript": 4702480,
|
93
93
|
"share-init": 252,
|
94
94
|
"runtime": 21445
|
95
95
|
},
|
@@ -106,7 +106,7 @@
|
|
106
106
|
"auxiliaryFiles": [
|
107
107
|
"main.js.map"
|
108
108
|
],
|
109
|
-
"hash": "
|
109
|
+
"hash": "084f5e5129e54aaf",
|
110
110
|
"childrenByOrder": {}
|
111
111
|
},
|
112
112
|
{
|
@@ -133,32 +133,6 @@
|
|
133
133
|
"hash": "c1ce890cbedb6cf3",
|
134
134
|
"childrenByOrder": {}
|
135
135
|
},
|
136
|
-
{
|
137
|
-
"rendered": true,
|
138
|
-
"initial": false,
|
139
|
-
"entry": false,
|
140
|
-
"recorded": false,
|
141
|
-
"reason": "split chunk (cache group: defaultVendors)",
|
142
|
-
"size": 3598866,
|
143
|
-
"sizes": {
|
144
|
-
"javascript": 3598866
|
145
|
-
},
|
146
|
-
"names": [],
|
147
|
-
"idHints": [
|
148
|
-
"vendors"
|
149
|
-
],
|
150
|
-
"runtime": [
|
151
|
-
"@openmrs/esm-stock-management-app"
|
152
|
-
],
|
153
|
-
"files": [
|
154
|
-
"304.js"
|
155
|
-
],
|
156
|
-
"auxiliaryFiles": [
|
157
|
-
"304.js.map"
|
158
|
-
],
|
159
|
-
"hash": "8bcf539de0b31b14",
|
160
|
-
"childrenByOrder": {}
|
161
|
-
},
|
162
136
|
{
|
163
137
|
"rendered": true,
|
164
138
|
"initial": false,
|
@@ -301,6 +275,32 @@
|
|
301
275
|
"hash": "df22fba10e470419",
|
302
276
|
"childrenByOrder": {}
|
303
277
|
},
|
278
|
+
{
|
279
|
+
"rendered": true,
|
280
|
+
"initial": false,
|
281
|
+
"entry": false,
|
282
|
+
"recorded": false,
|
283
|
+
"reason": "split chunk (cache group: defaultVendors)",
|
284
|
+
"size": 3589778,
|
285
|
+
"sizes": {
|
286
|
+
"javascript": 3589778
|
287
|
+
},
|
288
|
+
"names": [],
|
289
|
+
"idHints": [
|
290
|
+
"vendors"
|
291
|
+
],
|
292
|
+
"runtime": [
|
293
|
+
"@openmrs/esm-stock-management-app"
|
294
|
+
],
|
295
|
+
"files": [
|
296
|
+
"835.js"
|
297
|
+
],
|
298
|
+
"auxiliaryFiles": [
|
299
|
+
"835.js.map"
|
300
|
+
],
|
301
|
+
"hash": "b85dc435ca33dcdf",
|
302
|
+
"childrenByOrder": {}
|
303
|
+
},
|
304
304
|
{
|
305
305
|
"rendered": true,
|
306
306
|
"initial": false,
|
@@ -333,9 +333,9 @@
|
|
333
333
|
"initial": false,
|
334
334
|
"entry": false,
|
335
335
|
"recorded": false,
|
336
|
-
"size":
|
336
|
+
"size": 975379,
|
337
337
|
"sizes": {
|
338
|
-
"javascript":
|
338
|
+
"javascript": 975169,
|
339
339
|
"consume-shared": 210
|
340
340
|
},
|
341
341
|
"names": [],
|
@@ -349,7 +349,7 @@
|
|
349
349
|
"auxiliaryFiles": [
|
350
350
|
"969.js.map"
|
351
351
|
],
|
352
|
-
"hash": "
|
352
|
+
"hash": "e9e7e1f78eb36418",
|
353
353
|
"childrenByOrder": {}
|
354
354
|
}
|
355
355
|
]
|
package/dist/routes.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"stock-management-dashboard","slot":"stock-management-dashboard-slot","component":"stockManagementDashboard"},{"name":"stock-management-admin-card-link","slot":"system-admin-page-card-link-slot","component":"stockManagementAdminCardLink"},{"name":"stock-operation-dialog","component":"stockOperationDialog"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsDialog"},{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"}],"pages":[{"component":"stockManagement","route":"stock-management"}],"version":"1.0.1-pre.
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"stock-management-dashboard","slot":"stock-management-dashboard-slot","component":"stockManagementDashboard"},{"name":"stock-management-admin-card-link","slot":"system-admin-page-card-link-slot","component":"stockManagementAdminCardLink"},{"name":"stock-operation-dialog","component":"stockOperationDialog"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsDialog"},{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"}],"pages":[{"component":"stockManagement","route":"stock-management"}],"version":"1.0.1-pre.361"}
|
package/package.json
CHANGED
@@ -178,7 +178,7 @@ export function useUsers(filter: UserFilterCriteria) {
|
|
178
178
|
|
179
179
|
// getUser
|
180
180
|
export function useUser(id: string) {
|
181
|
-
const apiUrl = `${restBaseUrl}/user
|
181
|
+
const apiUrl = `${restBaseUrl}/user/${id}`;
|
182
182
|
const { data, error, isLoading } = useSWR<
|
183
183
|
{
|
184
184
|
data: User;
|
package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.component.tsx
CHANGED
@@ -14,10 +14,9 @@ import {
|
|
14
14
|
Select,
|
15
15
|
SelectItem,
|
16
16
|
} from "@carbon/react";
|
17
|
-
import React, { ChangeEvent,
|
17
|
+
import React, { ChangeEvent, useState } from "react";
|
18
18
|
import styles from "./add-stock-user-role-scope.scss";
|
19
19
|
import {
|
20
|
-
UserFilterCriteria,
|
21
20
|
useRoles,
|
22
21
|
useStockOperationTypes,
|
23
22
|
useStockTagLocations,
|
@@ -64,7 +63,7 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({
|
|
64
63
|
|
65
64
|
const [roles, setRoles] = useState<Role[]>([]);
|
66
65
|
|
67
|
-
const
|
66
|
+
const [showItems, setShowItems] = useState(false);
|
68
67
|
|
69
68
|
// operation types
|
70
69
|
const {
|
@@ -79,6 +78,9 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({
|
|
79
78
|
isLoading: loadingUsers,
|
80
79
|
} = useUsers({ v: ResourceRepresentation.Default });
|
81
80
|
|
81
|
+
const [selectedUserUuid, setSelectedUserUuid] = useState<string | null>(null);
|
82
|
+
const { data: user, isError } = useUser(selectedUserUuid);
|
83
|
+
|
82
84
|
// get roles
|
83
85
|
const { items: rolesData, isLoading: loadingRoles } = useRoles({
|
84
86
|
v: ResourceRepresentation.Default,
|
@@ -110,6 +112,28 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({
|
|
110
112
|
});
|
111
113
|
};
|
112
114
|
|
115
|
+
const [searchQuery, setSearchQuery] = useState<string>("");
|
116
|
+
const [filteredItems, setFilteredItems] = useState<any[]>([]);
|
117
|
+
|
118
|
+
const usersResults = users?.results ?? [];
|
119
|
+
|
120
|
+
const filterItems = (query: string) => {
|
121
|
+
if (query.trim() === "") {
|
122
|
+
setShowItems(false);
|
123
|
+
} else {
|
124
|
+
setShowItems(true);
|
125
|
+
const filtered = usersResults.filter((item: any) => {
|
126
|
+
const displayName = item?.person?.display ?? item?.display ?? "";
|
127
|
+
return displayName.toLowerCase().includes(query.toLowerCase());
|
128
|
+
});
|
129
|
+
setFilteredItems(filtered);
|
130
|
+
}
|
131
|
+
};
|
132
|
+
|
133
|
+
const handleSearchQueryChange = (query: string) => {
|
134
|
+
setSearchQuery(query);
|
135
|
+
filterItems(query);
|
136
|
+
};
|
113
137
|
const onStockOperationTypeChanged = (
|
114
138
|
event: React.ChangeEvent<HTMLInputElement>,
|
115
139
|
uuid: string,
|
@@ -178,17 +202,6 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({
|
|
178
202
|
const onActiveDatesChange = (dates: Date[]): void => {
|
179
203
|
setFormModel({ ...formModel, activeFrom: dates[0], activeTo: dates[1] });
|
180
204
|
};
|
181
|
-
const handleUsersSearch = useMemo(
|
182
|
-
() =>
|
183
|
-
debounce((searchTerm) => {
|
184
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
185
|
-
useUsers({
|
186
|
-
v: ResourceRepresentation.Default,
|
187
|
-
q: searchTerm,
|
188
|
-
} as any as UserFilterCriteria);
|
189
|
-
}, 300),
|
190
|
-
[]
|
191
|
-
);
|
192
205
|
|
193
206
|
const onUserChanged = (data: { selectedItem: User }) => {
|
194
207
|
const stockRolesUUIDs = [
|
@@ -204,8 +217,7 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({
|
|
204
217
|
);
|
205
218
|
setFormModel({ ...formModel, userUuid: data.selectedItem?.uuid });
|
206
219
|
setRoles(filteredStockRoles ?? []);
|
207
|
-
|
208
|
-
console.info(roles);
|
220
|
+
setSelectedUserUuid(data?.selectedItem?.uuid);
|
209
221
|
};
|
210
222
|
|
211
223
|
const onRoleChange = (e: ChangeEvent<HTMLSelectElement>) => {
|
@@ -288,7 +300,6 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({
|
|
288
300
|
}
|
289
301
|
);
|
290
302
|
};
|
291
|
-
|
292
303
|
if (isLoading || loadingRoles || loadingUsers) {
|
293
304
|
return (
|
294
305
|
<InlineLoading
|
@@ -298,7 +309,6 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({
|
|
298
309
|
/>
|
299
310
|
);
|
300
311
|
}
|
301
|
-
|
302
312
|
return (
|
303
313
|
<div>
|
304
314
|
<Form>
|
@@ -313,16 +323,13 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({
|
|
313
323
|
id="userName"
|
314
324
|
size="md"
|
315
325
|
labelText={t("user", "User")}
|
316
|
-
items={
|
326
|
+
items={filteredItems}
|
317
327
|
onChange={onUserChanged}
|
318
|
-
shouldFilterItem={(
|
319
|
-
onFocus={() => users?.results || handleUsersSearch("")}
|
320
|
-
onToggleClick={() =>
|
321
|
-
users?.results || handleUsersSearch("")
|
322
|
-
}
|
328
|
+
shouldFilterItem={() => true}
|
323
329
|
itemToString={(item) =>
|
324
330
|
`${item?.person?.display ?? item?.display ?? ""}`
|
325
331
|
}
|
332
|
+
onInputChange={handleSearchQueryChange}
|
326
333
|
placeholder="Filter..."
|
327
334
|
/>
|
328
335
|
</>
|
@@ -429,6 +436,7 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({
|
|
429
436
|
<Checkbox
|
430
437
|
value={type.uuid}
|
431
438
|
checked={isOperationChecked(type)}
|
439
|
+
className={styles.checkbox}
|
432
440
|
onChange={(event) =>
|
433
441
|
onStockOperationTypeChanged(
|
434
442
|
event,
|
@@ -436,7 +444,6 @@ const AddStockUserRoleScope: React.FC<AddStockUserRoleScopeProps> = ({
|
|
436
444
|
isOperationChecked(type)
|
437
445
|
)
|
438
446
|
}
|
439
|
-
className={styles.checkbox}
|
440
447
|
labelText={type.name}
|
441
448
|
id={type.uuid}
|
442
449
|
/>
|
File without changes
|