@vidispine/vdt-materialui 26.2.0-pre.3 → 26.2.3
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/dist/cjs/collection/CollectionSearchPicker/CollectionSearchPicker.js +1 -1
- package/dist/cjs/entity/EntityAccessAdd.js +1 -1
- package/dist/cjs/search/SavedSearch/SavedSearch.js +1 -1
- package/dist/cjs/search/SavedSearch/SavedSearchList.js +1 -1
- package/dist/cjs/search/SavedSearchFolder/FolderRow.js +1 -1
- package/dist/es/collection/CollectionSearchPicker/CollectionSearchPicker.js +74 -67
- package/dist/es/entity/EntityAccessAdd.js +112 -110
- package/dist/es/search/SavedSearch/SavedSearch.js +51 -43
- package/dist/es/search/SavedSearch/SavedSearchList.js +40 -35
- package/dist/es/search/SavedSearchFolder/FolderRow.js +62 -58
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),d=require("react"),$=require("clsx"),e=require("prop-types"),h=require("@vidispine/vdt-react"),D=require("../../search/Pagination.js"),E=require("../../search/SearchInput/index.js"),V=require("../CollectionTable/index.js");function z({PaginationComponent:n=D.default,...a}){const{collectionListType:{hits:s=0}}=a;return o.jsx(n,{count:s,...a})}function A(n){const{isLoading:a}=n;return o.jsx(E.default,{submitting:a,...n})}const B=()=>({root:{}});function l({className:n,classes:a,onChange:s,onCheck:P,CollectionTableComponent:p,CollectionTableProps:b,searchProps:f,idLabelText:g,titleLabelText:x,ownerLabelText:C,searchPlaceholder:S,SearchInputProps:m,PaginationProps:T,SearchCollectionProps:j,enableSearch2:i}){const y=h.useSearch({queryParams:{field:["collectionId","title","__user"],content:"metadata"}},i),{state:q,setSearchText:v,onChangeRowsPerPage:k,onChangePage:L}=f||y,{matrixParams:O,queryParams:w,itemSearchDocument:R,page:_,rowsPerPage:I}=q,[c,u]=d.useState([]),N=t=>{c.includes(t)?u(r=>r.filter(W=>W!==t)):u(r=>[...r,t])};d.useEffect(()=>s&&s(c),[c]);const M=({id:t})=>N(t);return o.jsx("div",{className:$(a.root,"VdtCollectionSearchPicker",n),children:o.jsxs(h.SearchCollection,{itemSearchDocument:R,matrixParams:O,queryParams:w,enableSearch2:i,...j,children:[o.jsx(A,{onSubmit:t=>v(`*${t}*`),searchPlaceholder:S,...m}),o.jsx(p,{onRowClick:M,onCheck:P,selected:c,options:[{label:x,value:"title"},{label:g,value:"collectionId"},{label:C,value:"__user"}],...b}),o.jsx(z,{onChangePage:L,onChangeRowsPerPage:k,page:_,rowsPerPage:I,...T})]})})}l.propTypes={classes:e.objectOf(e.string),className:e.string,onChange:e.func,onCheck:e.func,CollectionTableComponent:e.elementType,CollectionTableProps:e.objectOf(e.any),searchProps:e.objectOf(e.any),idLabelText:e.string,titleLabelText:e.string,ownerLabelText:e.string,searchPlaceholder:e.string,SearchInputProps:e.objectOf(e.any),PaginationProps:e.objectOf(e.any),SearchCollectionProps:e.objectOf(e.any),enableSearch2:e.bool};l.defaultProps={className:void 0,classes:{},onChange:void 0,onCheck:()=>{},CollectionTableComponent:V.default,CollectionTableProps:{},searchProps:void 0,idLabelText:"Id",titleLabelText:"Title",ownerLabelText:"Owner",searchPlaceholder:"Search collections",SearchInputProps:{},PaginationProps:{},SearchCollectionProps:{},enableSearch2:!1};exports.default=l;exports.styles=B;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),d=require("react"),p=require("@material-ui/core"),E=require("@material-ui/lab"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),d=require("react"),p=require("@material-ui/core"),E=require("@material-ui/lab"),b=require("@vidispine/vdt-api"),c={GROUP:"group",USER:"user"},D={ALL:"ALL",WRITE:"WRITE",READ:"READ",NONE:"NONE"},H=e=>({root:{},recipientRoot:{display:"flex",width:"100%"},recipientType:{flexGrow:1},actions:{display:"flex",alignItems:"center",padding:e.spacing(2),justifyContent:"flex-end",flex:"0 0 auto","& > :not(:first-child)":{marginLeft:e.spacing(2)}},actionsSubmit:{}}),M=(e,n)=>{switch(n.type){case"CHANGE_PERMISSION":return{...e,permission:n.value};case"CHANGE_RECIPIENT":return e[c.USER]!==void 0?{...e,[c.USER]:n.value}:e[c.GROUP]!==void 0?{...e,[c.GROUP]:n.value}:e;case"CHANGE_RECIPIENTTYPE":{const{[c.USER]:r,[c.GROUP]:o,...s}=e;return{...s,[n.value]:null}}default:throw new Error(`Unhandled action type: ${n.type}`)}},k=e=>{const[n,r]=d.useReducer(M,e),o=d.useCallback(a=>r({value:a,type:"CHANGE_PERMISSION"}),[]),s=d.useCallback(a=>r({value:a,type:"CHANGE_RECIPIENT"}),[]),i=d.useCallback(a=>r({value:a,type:"CHANGE_RECIPIENTTYPE"}),[]);return{accessControlDocument:n,onChangePermission:o,onChangeRecipient:s,onChangeRecipientType:i}};async function B({searchText:e,hideDefaultGroups:n,searchOperator:r}){const{data:{group:o=[]}}=await b.group.searchGroup({groupSearchDocument:{field:[{name:"groupname",value:e}],...r?{operator:r}:{}},queryParams:{number:100,role:!n}});return n?o.map(s=>({groupName:s.groupName})).filter(s=>!s.groupName.startsWith("_")):o.map(s=>({groupName:s.groupName}))}async function F({searchText:e,displayRealName:n=!0}){const{data:{user:r=[]}}=await b.user.searchUser({userSearchDocument:{operator:{field:[{name:"username",value:e},{name:"realname",value:e}],operation:"OR"}},queryParams:{number:100,ignoreCase:!0}});return r.map(o=>({userName:o.userName,...n&&{realName:o.realName}}))}function A({onSearch:e,onChange:n,displayRealName:r=!0,label:o,hideDefaultGroups:s,searchOperator:i}){const[a,f]=d.useState([]),[R,v]=d.useState(""),[C,x]=d.useState(null),h=d.useCallback(u=>{e({searchText:u,hideDefaultGroups:s,displayRealName:r,searchOperator:i}).then(f)},[e,s,r,i]),j=(u,l,m)=>{v(l),m==="input"&&h(l)},N=(u,l)=>{const{groupName:m,userName:P}=l||{};x(l),n(l?P||m:null)};d.useEffect(()=>{h("")},[h]);const y=E.createFilterOptions({stringify:u=>u.groupName?u.groupName:u.realName+u.userName});return t.jsx(E.Autocomplete,{value:C,inputValue:R,options:a,filterOptions:y,onChange:N,onInputChange:j,renderInput:u=>t.jsx(p.TextField,{...u,label:o,variant:"outlined"}),getOptionLabel:({realName:u,userName:l,groupName:m})=>r&&u||l||m})}function W({value:e,label:n,onChange:r,choices:o=D,selected:s}){return t.jsxs(p.FormControl,{margin:"normal",fullWidth:!0,children:[t.jsx(p.FormLabel,{children:n}),t.jsx(p.RadioGroup,{value:e,onChange:i=>r(i.target.value),children:Object.entries(o).map(([i,a])=>t.jsx(p.FormControlLabel,{value:i,control:t.jsx(p.Radio,{}),label:a,disabled:!s},i))})]})}function Y({onChange:e,value:n,userText:r,groupText:o}){const s=(i,a)=>{a!==null&&e(a)};return t.jsxs(E.ToggleButtonGroup,{value:n,exclusive:!0,onChange:s,children:[t.jsx(E.ToggleButton,{value:c.USER,children:r}),t.jsx(E.ToggleButton,{value:c.GROUP,children:o})]})}function V({classes:e,entityType:n,entityId:r,onSuccess:o=()=>{},onError:s=()=>{},onSubmit:i=b.access.createEntityAccess,onCancel:a,initialAccessControlDocument:f={user:null},UserPickerComponent:R=A,UserPickerProps:v={},GroupPickerComponent:C=A,GroupPickerProps:x={},PermissionPickerComponent:h=W,PermissionPickerProps:j,RecipientTypePickerComponent:N=Y,RecipientTypePickerProps:y,permissionText:u="Permission",grantAccessText:l="Grant Access",userText:m="User",groupText:P="Group",searchText:I="Search",cancelText:G="Cancel",hideDefaultGroups:T=!0}){const{accessControlDocument:g,onChangePermission:_,onChangeRecipient:O,onChangeRecipientType:L}=k(f),q=()=>Promise.resolve(i({entityType:n,entityId:r,accessControlDocument:g})).then(o).catch(s),{permission:U=""}=g,S=d.useMemo(()=>{if(g[c.USER]!==void 0)return c.USER;if(g[c.GROUP]!==void 0)return c.GROUP},[g]),[w]=Object.values(g);return t.jsxs("div",{className:e.root,children:[t.jsxs("div",{className:e.recipientRoot,children:[N?t.jsx(N,{value:S,onChange:L,userText:m,groupText:P,...y}):null,t.jsxs("div",{className:e.recipientType,children:[R&&S===c.USER?t.jsx(R,{onSearch:F,onChange:O,label:I,...v}):null,C&&S===c.GROUP?t.jsx(C,{onSearch:B,onChange:O,label:I,...x,hideDefaultGroups:T}):null]})]}),h?t.jsx(h,{value:U,onChange:_,selected:w,label:u,...j}):null,t.jsxs("div",{className:e.actions,children:[a?t.jsx(p.Button,{className:e.actionsCancel,onClick:a,children:G}):null,t.jsx(p.Button,{className:e.actionsSubmit,onClick:q,disabled:!g[S]||!U,variant:"outlined",color:"primary",children:l})]})]})}const $=p.withStyles(H,{name:"VdtEntityAccessEdit"})(V);exports.default=$;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),D=require("clsx"),R=require("@material-ui/core"),V=require("@vidispine/vdt-react"),_=require("./SavedSearchList.js"),b=require("./SaveSearchForm.js"),E=e=>({root:{padding:e.spacing(2)}});function G({classes:e,className:o,markerField:n,markerValue:S,itemSearchDocument:d,onSelect:i,onSaveSuccess:u=()=>{},onSaveError:l=()=>{},SearchListComponent:a=_.default,SearchListProps:h={},SearchFormComponent:r=b.default,SearchFormProps:v={},accessTranslate:f,extraMenuItems:g,isLoading:q=!1,onDeleteError:j=()=>{},enableSearch2:s=!1}){const{onDeleteSearch:x,onUpdateSearchMetadata:P,onGetSavedSearchSettings:p,onSaveSearch:y,searchProps:M}=V.useSavedSearch({markerField:n,markerValue:S,initialSearchState:{rowsPerPage:5}},s),m=({collectionId:c})=>p({collectionId:c}).then(w=>i(w,c));return t.jsxs("div",{className:D(e.root,"VdtSavedSearch-root",o),children:[r&&t.jsx(r,{itemSearchDocument:d,onSuccess:u,onError:l,onSaveSearch:y,...v}),a&&t.jsx(a,{onSelect:m,onDelete:x,onUpdateSearchMetadata:P,searchProps:M,accessTranslate:f,extraMenuItems:g,isLoading:q,onDeleteError:j,enableSearch2:s,...h})]})}const L=R.withStyles(E,{name:"VdtSavedSearchList"})(G);exports.default=L;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),o=require("@material-ui/core"),x=require("../../collection/CollectionSearchPicker/index.js"),f=require("./SavedSearchRow.js"),g={};function q({searchProps:i,searchPlaceholderText:n="Find searches",onSelect:d,onDelete:c,onUpdateSearchMetadata:l,RowComponent:u=f.default,RowProps:S={},accessTranslate:h,extraMenuItems:v,isLoading:P,onDeleteError:m,...j}){return a.jsx(x.default,{searchProps:i,searchPlaceholder:n,CollectionTableComponent:({collectionListType:t,onRefresh:s})=>a.jsx(o.List,{children:t&&t.collection&&t.collection.map(e=>a.jsx(u,{collectionType:e,onSelect:()=>d({collectionId:e.id}),onDelete:()=>Promise.resolve(c({collectionId:e.id}).catch(r=>{m(r)}).then(s)),onUpdateSearchMetadata:r=>Promise.resolve(l({collectionId:e.id,metadataDocument:r}).then(s)),accessTranslate:h,extraMenuItems:v,isLoading:P,...S},e.id))}),PaginationProps:{rowsPerPageOptions:[5,10]},...j})}const b=o.withStyles(g,{name:"VdtSavedSearchList"})(q);exports.default=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),b=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),b=require("react"),Z=require("clsx"),k=require("@material-ui/core"),P=require("@vidispine/vdt-js"),g=require("@vidispine/vdt-react"),C=require("../SavedSearch/SavedSearchRow.js"),ee=require("./AddFolderRow.js"),$={markerValue:"savedSearch",markerField:"eidr_referentType"},te={indentationWidth:20,indentationDepthStart:1,defaultRowIndentationOffset:15,defalutNewRowIndentation:10},ne=()=>({root:{display:"flex",width:"100%",flexWrap:"wrap"},indentationContainer:{display:"flex",width:"100%"}}),ae=a=>({root:{display:"flex",width:"100%"},indentation:{height:25,borderLeft:`1px solid ${a.palette.primary.main}`,borderBottom:`1px solid ${a.palette.primary.main}`,marginRight:5}});function de({className:a,classes:t,children:c,indentationWidth:u,hideWrapper:x,folderDepth:o,indentationDepthStart:h,isAddRow:d,rowIndentation:l,addNewRowIndentation:I}){const w=d?!0:o>=h,i=d?I:l;return x?null:n.jsxs("div",{className:Z(a,t.root),children:[w&&n.jsx("div",{className:t.indentation,style:{marginLeft:i,minWidth:u}}),c]})}const ie=g.compose(k.withStyles(ae,{name:"VdtFolderRowContentWrapper"}))(de);function z({classes:a,id:t,queryParams:c,markerProps:u=$,childFolders:x=[],metadata:o={},itemSearchDocument:h={},folderDepth:d=0,type:l="folder",hideSubFolderSharing:I,onSelect:w,onRemoveItem:i,indentationValues:q={},indentationProps:s=te,FolderRowContentComponent:y=C.default,FolderRowContentProps:R={},AddRowComponent:F=ee.default,AddRowProps:M={},FolderRowContentWrapperComponent:S=ie,FolderRowContentWrapperProps:f={},isLoading:v,onDeleteError:_,...A}){const[j,V]=b.useState(),[p,N]=b.useState({id:null,type:null}),{createFolder:G,saveSearch:B,deleteFolder:D,removeItem:E,subFolders:m=[]}=g.useGetSavedSearchFolders({childFolders:x,expand:j,queryParams:c,markerProps:u}),{onDeleteSearch:J,onUpdateSearchMetadata:T,onGetSavedSearchSettings:W}=g.useSavedSearch({...$}),O=({collectionId:e})=>W({collectionId:e}).then(Y=>w(Y,e)),U=P.parseMetadataType(o,{joinValue:"_",flat:!0}),H=b.useMemo(()=>{const{__child_collection_size:e=0}=U;return m.length>0||!j&&e>0},[m.length,j,U]),{defalutNewRowIndentation:K,defaultRowIndentationOffset:L,indentationWidth:Q}=s,r={rowIndentation:q.rowIndentation||0,addNewRowIndentation:q.addNewRowIndentation||K},X={rowIndentation:r.addNewRowIndentation,addNewRowIndentation:r.addNewRowIndentation+Q+L};return n.jsxs("div",{className:a.root,children:[{folder:n.jsx(S,{folderDepth:d,...r,...s,...f,children:n.jsx(y,{isFolderRow:!0,hideSubFolderSharing:I,type:l,collectionType:{id:t,metadata:o},disableDeletion:H,onDelete:()=>Promise.resolve(D(t)).then(()=>{i&&i(t)}),onUpdateSearchMetadata:e=>T({collectionId:t,metadataDocument:e}),onExpand:()=>V(e=>!e),onAddRow:N,isLoading:v,...R})}),query:n.jsx(S,{folderDepth:d,...r,...s,...f,children:n.jsx(y,{isFolderRow:!0,type:l,collectionType:{id:t,metadata:o},onSelect:()=>O({collectionId:t}),onDelete:()=>Promise.resolve(J({collectionId:t})).then(()=>{i&&i(t)}).catch(e=>{_(e)}),onUpdateSearchMetadata:e=>T({collectionId:t,metadataDocument:e}),onAddRow:N,isLoading:v,...R})})}[l],n.jsx(S,{isAddRow:!0,folderDepth:d,...r,...s,hideWrapper:!p.id,...f,children:n.jsx(F,{id:t,setExpand:V,saveSearch:B,onAddRow:N,createFolder:G,itemSearchDocument:h,newField:p,...M})}),m.map(e=>n.jsx(z,{classes:a,id:e.id,queryParams:c,markerProps:u,childFolders:e.subFolders,metadata:e.metadata,itemSearchDocument:h,folderDepth:d+1,type:e.type,hideSubFolderSharing:!0,handleSelect:O,onSelect:w,onRemoveItem:()=>E(e.id),indentationProps:s,FolderRowContentComponent:y,FolderRowContentProps:R,AddRowComponent:F,AddRowProps:M,FolderRowContentWrapperComponent:S,FolderRowContentWrapperProps:f,indentationValues:X,isLoading:v,onDeleteError:_,props:A},e.id))]})}const oe=k.withStyles(ne,{name:"VdtFolderRow"})(z);exports.default=oe;
|
|
@@ -1,95 +1,100 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as n, jsxs as W } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $, useEffect as D } from "react";
|
|
3
|
+
import E from "clsx";
|
|
4
4
|
import e from "prop-types";
|
|
5
|
-
import { useSearch as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
function
|
|
5
|
+
import { useSearch as V, SearchCollection as z } from "@vidispine/vdt-react";
|
|
6
|
+
import A from "../../search/Pagination.js";
|
|
7
|
+
import B from "../../search/SearchInput/index.js";
|
|
8
|
+
import F from "../CollectionTable/index.js";
|
|
9
|
+
function G({ PaginationComponent: t = A, ...a }) {
|
|
10
10
|
const {
|
|
11
|
-
collectionListType: { hits:
|
|
12
|
-
} =
|
|
13
|
-
return /* @__PURE__ */
|
|
11
|
+
collectionListType: { hits: r = 0 }
|
|
12
|
+
} = a;
|
|
13
|
+
return /* @__PURE__ */ n(t, { count: r, ...a });
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const { isLoading:
|
|
17
|
-
return /* @__PURE__ */
|
|
15
|
+
function H(t) {
|
|
16
|
+
const { isLoading: a } = t;
|
|
17
|
+
return /* @__PURE__ */ n(B, { submitting: a, ...t });
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const ee = () => ({
|
|
20
20
|
root: {}
|
|
21
21
|
});
|
|
22
|
-
function
|
|
22
|
+
function p({
|
|
23
23
|
className: t,
|
|
24
|
-
classes:
|
|
25
|
-
onChange:
|
|
26
|
-
onCheck:
|
|
24
|
+
classes: a,
|
|
25
|
+
onChange: r,
|
|
26
|
+
onCheck: h,
|
|
27
27
|
CollectionTableComponent: m,
|
|
28
|
-
CollectionTableProps:
|
|
29
|
-
searchProps:
|
|
30
|
-
idLabelText:
|
|
31
|
-
titleLabelText:
|
|
28
|
+
CollectionTableProps: u,
|
|
29
|
+
searchProps: P,
|
|
30
|
+
idLabelText: f,
|
|
31
|
+
titleLabelText: b,
|
|
32
32
|
ownerLabelText: d,
|
|
33
|
-
searchPlaceholder:
|
|
34
|
-
SearchInputProps:
|
|
35
|
-
PaginationProps:
|
|
36
|
-
SearchCollectionProps:
|
|
33
|
+
searchPlaceholder: C,
|
|
34
|
+
SearchInputProps: g,
|
|
35
|
+
PaginationProps: S,
|
|
36
|
+
SearchCollectionProps: T,
|
|
37
|
+
enableSearch2: s
|
|
37
38
|
}) {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
const x = V(
|
|
40
|
+
{
|
|
41
|
+
queryParams: {
|
|
42
|
+
field: ["collectionId", "title", "__user"],
|
|
43
|
+
content: "metadata"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
s
|
|
47
|
+
), { state: y, setSearchText: k, onChangeRowsPerPage: j, onChangePage: L } = P || x, { matrixParams: v, queryParams: w, itemSearchDocument: O, page: I, rowsPerPage: _ } = y, [c, i] = $([]), N = (o) => {
|
|
48
|
+
c.includes(o) ? i((l) => l.filter((q) => q !== o)) : i((l) => [...l, o]);
|
|
45
49
|
};
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
|
|
50
|
+
D(() => r && r(c), [c]);
|
|
51
|
+
const R = ({ id: o }) => N(o);
|
|
52
|
+
return /* @__PURE__ */ n("div", { className: E(a.root, "VdtCollectionSearchPicker", t), children: /* @__PURE__ */ W(
|
|
53
|
+
z,
|
|
50
54
|
{
|
|
51
|
-
itemSearchDocument:
|
|
52
|
-
matrixParams:
|
|
53
|
-
queryParams:
|
|
54
|
-
|
|
55
|
+
itemSearchDocument: O,
|
|
56
|
+
matrixParams: v,
|
|
57
|
+
queryParams: w,
|
|
58
|
+
enableSearch2: s,
|
|
59
|
+
...T,
|
|
55
60
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
61
|
+
/* @__PURE__ */ n(
|
|
62
|
+
H,
|
|
58
63
|
{
|
|
59
|
-
onSubmit: (o) =>
|
|
60
|
-
searchPlaceholder:
|
|
61
|
-
...
|
|
64
|
+
onSubmit: (o) => k(`*${o}*`),
|
|
65
|
+
searchPlaceholder: C,
|
|
66
|
+
...g
|
|
62
67
|
}
|
|
63
68
|
),
|
|
64
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ n(
|
|
65
70
|
m,
|
|
66
71
|
{
|
|
67
|
-
onRowClick:
|
|
68
|
-
onCheck:
|
|
72
|
+
onRowClick: R,
|
|
73
|
+
onCheck: h,
|
|
69
74
|
selected: c,
|
|
70
75
|
options: [
|
|
71
|
-
{ label:
|
|
72
|
-
{ label:
|
|
76
|
+
{ label: b, value: "title" },
|
|
77
|
+
{ label: f, value: "collectionId" },
|
|
73
78
|
{ label: d, value: "__user" }
|
|
74
79
|
],
|
|
75
|
-
...
|
|
80
|
+
...u
|
|
76
81
|
}
|
|
77
82
|
),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
83
|
+
/* @__PURE__ */ n(
|
|
84
|
+
G,
|
|
80
85
|
{
|
|
81
|
-
onChangePage:
|
|
82
|
-
onChangeRowsPerPage:
|
|
83
|
-
page:
|
|
84
|
-
rowsPerPage:
|
|
85
|
-
...
|
|
86
|
+
onChangePage: L,
|
|
87
|
+
onChangeRowsPerPage: j,
|
|
88
|
+
page: I,
|
|
89
|
+
rowsPerPage: _,
|
|
90
|
+
...S
|
|
86
91
|
}
|
|
87
92
|
)
|
|
88
93
|
]
|
|
89
94
|
}
|
|
90
95
|
) });
|
|
91
96
|
}
|
|
92
|
-
|
|
97
|
+
p.propTypes = {
|
|
93
98
|
/**
|
|
94
99
|
* Override or extend the styles applied to the component.
|
|
95
100
|
*/
|
|
@@ -109,15 +114,16 @@ i.propTypes = {
|
|
|
109
114
|
searchPlaceholder: e.string,
|
|
110
115
|
SearchInputProps: e.objectOf(e.any),
|
|
111
116
|
PaginationProps: e.objectOf(e.any),
|
|
112
|
-
SearchCollectionProps: e.objectOf(e.any)
|
|
117
|
+
SearchCollectionProps: e.objectOf(e.any),
|
|
118
|
+
enableSearch2: e.bool
|
|
113
119
|
};
|
|
114
|
-
|
|
120
|
+
p.defaultProps = {
|
|
115
121
|
className: void 0,
|
|
116
122
|
classes: {},
|
|
117
123
|
onChange: void 0,
|
|
118
124
|
onCheck: () => {
|
|
119
125
|
},
|
|
120
|
-
CollectionTableComponent:
|
|
126
|
+
CollectionTableComponent: F,
|
|
121
127
|
CollectionTableProps: {},
|
|
122
128
|
searchProps: void 0,
|
|
123
129
|
idLabelText: "Id",
|
|
@@ -126,9 +132,10 @@ i.defaultProps = {
|
|
|
126
132
|
searchPlaceholder: "Search collections",
|
|
127
133
|
SearchInputProps: {},
|
|
128
134
|
PaginationProps: {},
|
|
129
|
-
SearchCollectionProps: {}
|
|
135
|
+
SearchCollectionProps: {},
|
|
136
|
+
enableSearch2: !1
|
|
130
137
|
};
|
|
131
138
|
export {
|
|
132
|
-
|
|
133
|
-
|
|
139
|
+
p as default,
|
|
140
|
+
ee as styles
|
|
134
141
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as F, useReducer as M, useCallback as
|
|
3
|
-
import { withStyles as $, Button as
|
|
4
|
-
import { createFilterOptions as J, Autocomplete as K, ToggleButtonGroup as Q, ToggleButton as
|
|
1
|
+
import { jsxs as h, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as F, useReducer as M, useCallback as N, useState as U, useEffect as W } from "react";
|
|
3
|
+
import { withStyles as $, Button as A, TextField as B, FormControl as Y, FormLabel as k, RadioGroup as q, FormControlLabel as V, Radio as z } from "@material-ui/core";
|
|
4
|
+
import { createFilterOptions as J, Autocomplete as K, ToggleButtonGroup as Q, ToggleButton as T } from "@material-ui/lab";
|
|
5
5
|
import { access as X, group as Z, user as ee } from "@vidispine/vdt-api";
|
|
6
6
|
const c = {
|
|
7
7
|
GROUP: "group",
|
|
@@ -11,7 +11,7 @@ const c = {
|
|
|
11
11
|
WRITE: "WRITE",
|
|
12
12
|
READ: "READ",
|
|
13
13
|
NONE: "NONE"
|
|
14
|
-
},
|
|
14
|
+
}, te = (e) => ({
|
|
15
15
|
root: {},
|
|
16
16
|
recipientRoot: {
|
|
17
17
|
display: "flex",
|
|
@@ -31,52 +31,53 @@ const c = {
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
actionsSubmit: {}
|
|
34
|
-
}),
|
|
34
|
+
}), re = (e, n) => {
|
|
35
35
|
switch (n.type) {
|
|
36
36
|
case "CHANGE_PERMISSION":
|
|
37
37
|
return { ...e, permission: n.value };
|
|
38
38
|
case "CHANGE_RECIPIENT":
|
|
39
39
|
return e[c.USER] !== void 0 ? { ...e, [c.USER]: n.value } : e[c.GROUP] !== void 0 ? { ...e, [c.GROUP]: n.value } : e;
|
|
40
40
|
case "CHANGE_RECIPIENTTYPE": {
|
|
41
|
-
const { [c.USER]:
|
|
42
|
-
return { ...
|
|
41
|
+
const { [c.USER]: t, [c.GROUP]: o, ...r } = e;
|
|
42
|
+
return { ...r, [n.value]: null };
|
|
43
43
|
}
|
|
44
44
|
default:
|
|
45
45
|
throw new Error(`Unhandled action type: ${n.type}`);
|
|
46
46
|
}
|
|
47
47
|
}, oe = (e) => {
|
|
48
|
-
const [n,
|
|
49
|
-
(
|
|
48
|
+
const [n, t] = M(re, e), o = N(
|
|
49
|
+
(a) => t({ value: a, type: "CHANGE_PERMISSION" }),
|
|
50
50
|
[]
|
|
51
|
-
),
|
|
52
|
-
(
|
|
51
|
+
), r = N(
|
|
52
|
+
(a) => t({ value: a, type: "CHANGE_RECIPIENT" }),
|
|
53
53
|
[]
|
|
54
|
-
), s =
|
|
55
|
-
(
|
|
54
|
+
), s = N(
|
|
55
|
+
(a) => t({ value: a, type: "CHANGE_RECIPIENTTYPE" }),
|
|
56
56
|
[]
|
|
57
57
|
);
|
|
58
58
|
return {
|
|
59
59
|
accessControlDocument: n,
|
|
60
|
-
onChangePermission:
|
|
61
|
-
onChangeRecipient:
|
|
60
|
+
onChangePermission: o,
|
|
61
|
+
onChangeRecipient: r,
|
|
62
62
|
onChangeRecipientType: s
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
-
async function ae({ searchText: e, hideDefaultGroups: n }) {
|
|
65
|
+
async function ae({ searchText: e, hideDefaultGroups: n, searchOperator: t }) {
|
|
66
66
|
const {
|
|
67
|
-
data: { group:
|
|
67
|
+
data: { group: o = [] }
|
|
68
68
|
} = await Z.searchGroup({
|
|
69
69
|
groupSearchDocument: {
|
|
70
|
-
field: [{ name: "groupname", value: e }]
|
|
70
|
+
field: [{ name: "groupname", value: e }],
|
|
71
|
+
...t ? { operator: t } : {}
|
|
71
72
|
},
|
|
72
73
|
// Doesn't have ignoreCase param
|
|
73
74
|
queryParams: { number: 100, role: !n }
|
|
74
75
|
});
|
|
75
|
-
return n ?
|
|
76
|
+
return n ? o.map((r) => ({ groupName: r.groupName })).filter((r) => !r.groupName.startsWith("_")) : o.map((r) => ({ groupName: r.groupName }));
|
|
76
77
|
}
|
|
77
78
|
async function ie({ searchText: e, displayRealName: n = !0 }) {
|
|
78
79
|
const {
|
|
79
|
-
data: { user:
|
|
80
|
+
data: { user: t = [] }
|
|
80
81
|
} = await ee.searchUser({
|
|
81
82
|
userSearchDocument: {
|
|
82
83
|
operator: {
|
|
@@ -95,172 +96,173 @@ async function ie({ searchText: e, displayRealName: n = !0 }) {
|
|
|
95
96
|
},
|
|
96
97
|
queryParams: { number: 100, ignoreCase: !0 }
|
|
97
98
|
});
|
|
98
|
-
return
|
|
99
|
-
userName:
|
|
100
|
-
...n && { realName:
|
|
99
|
+
return t.map((o) => ({
|
|
100
|
+
userName: o.userName,
|
|
101
|
+
...n && { realName: o.realName }
|
|
101
102
|
}));
|
|
102
103
|
}
|
|
103
|
-
function
|
|
104
|
+
function _({
|
|
104
105
|
onSearch: e,
|
|
105
106
|
onChange: n,
|
|
106
|
-
displayRealName:
|
|
107
|
-
label:
|
|
108
|
-
hideDefaultGroups:
|
|
107
|
+
displayRealName: t = !0,
|
|
108
|
+
label: o,
|
|
109
|
+
hideDefaultGroups: r,
|
|
110
|
+
searchOperator: s
|
|
109
111
|
}) {
|
|
110
|
-
const [
|
|
111
|
-
(
|
|
112
|
-
e({ searchText:
|
|
112
|
+
const [a, f] = U([]), [g, S] = U(""), [E, v] = U(null), d = N(
|
|
113
|
+
(i) => {
|
|
114
|
+
e({ searchText: i, hideDefaultGroups: r, displayRealName: t, searchOperator: s }).then(f);
|
|
113
115
|
},
|
|
114
|
-
[e,
|
|
115
|
-
),
|
|
116
|
-
|
|
117
|
-
},
|
|
118
|
-
const { groupName: m, userName:
|
|
119
|
-
|
|
116
|
+
[e, r, t, s]
|
|
117
|
+
), y = (i, l, m) => {
|
|
118
|
+
S(l), m === "input" && d(l);
|
|
119
|
+
}, R = (i, l) => {
|
|
120
|
+
const { groupName: m, userName: I } = l || {};
|
|
121
|
+
v(l), n(l ? I || m : null);
|
|
120
122
|
};
|
|
121
123
|
W(() => {
|
|
122
|
-
|
|
123
|
-
}, [
|
|
124
|
-
const
|
|
125
|
-
stringify: (
|
|
124
|
+
d("");
|
|
125
|
+
}, [d]);
|
|
126
|
+
const P = J({
|
|
127
|
+
stringify: (i) => i.groupName ? i.groupName : i.realName + i.userName
|
|
126
128
|
});
|
|
127
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ u(
|
|
128
130
|
K,
|
|
129
131
|
{
|
|
130
|
-
value:
|
|
131
|
-
inputValue:
|
|
132
|
-
options:
|
|
133
|
-
filterOptions:
|
|
134
|
-
onChange:
|
|
135
|
-
onInputChange:
|
|
136
|
-
renderInput: (
|
|
137
|
-
getOptionLabel: ({ realName:
|
|
132
|
+
value: E,
|
|
133
|
+
inputValue: g,
|
|
134
|
+
options: a,
|
|
135
|
+
filterOptions: P,
|
|
136
|
+
onChange: R,
|
|
137
|
+
onInputChange: y,
|
|
138
|
+
renderInput: (i) => /* @__PURE__ */ u(B, { ...i, label: o, variant: "outlined" }),
|
|
139
|
+
getOptionLabel: ({ realName: i, userName: l, groupName: m }) => t && i || l || m
|
|
138
140
|
}
|
|
139
141
|
);
|
|
140
142
|
}
|
|
141
|
-
function
|
|
142
|
-
return /* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
/* @__PURE__ */
|
|
143
|
+
function ue({ value: e, label: n, onChange: t, choices: o = ne, selected: r }) {
|
|
144
|
+
return /* @__PURE__ */ h(Y, { margin: "normal", fullWidth: !0, children: [
|
|
145
|
+
/* @__PURE__ */ u(k, { children: n }),
|
|
146
|
+
/* @__PURE__ */ u(q, { value: e, onChange: (s) => t(s.target.value), children: Object.entries(o).map(([s, a]) => /* @__PURE__ */ u(
|
|
145
147
|
V,
|
|
146
148
|
{
|
|
147
149
|
value: s,
|
|
148
|
-
control: /* @__PURE__ */
|
|
149
|
-
label:
|
|
150
|
-
disabled: !
|
|
150
|
+
control: /* @__PURE__ */ u(z, {}),
|
|
151
|
+
label: a,
|
|
152
|
+
disabled: !r
|
|
151
153
|
},
|
|
152
154
|
s
|
|
153
155
|
)) })
|
|
154
156
|
] });
|
|
155
157
|
}
|
|
156
|
-
function
|
|
157
|
-
return /* @__PURE__ */
|
|
158
|
-
|
|
158
|
+
function ce({ onChange: e, value: n, userText: t, groupText: o }) {
|
|
159
|
+
return /* @__PURE__ */ h(Q, { value: n, exclusive: !0, onChange: (s, a) => {
|
|
160
|
+
a !== null && e(a);
|
|
159
161
|
}, children: [
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ u(T, { value: c.USER, children: t }),
|
|
163
|
+
/* @__PURE__ */ u(T, { value: c.GROUP, children: o })
|
|
162
164
|
] });
|
|
163
165
|
}
|
|
164
166
|
function se({
|
|
165
167
|
classes: e,
|
|
166
168
|
entityType: n,
|
|
167
|
-
entityId:
|
|
168
|
-
onSuccess:
|
|
169
|
+
entityId: t,
|
|
170
|
+
onSuccess: o = () => {
|
|
169
171
|
},
|
|
170
|
-
onError:
|
|
172
|
+
onError: r = () => {
|
|
171
173
|
},
|
|
172
174
|
onSubmit: s = X.createEntityAccess,
|
|
173
|
-
onCancel:
|
|
174
|
-
initialAccessControlDocument:
|
|
175
|
-
UserPickerComponent: g =
|
|
176
|
-
UserPickerProps:
|
|
177
|
-
GroupPickerComponent: E =
|
|
178
|
-
GroupPickerProps:
|
|
179
|
-
PermissionPickerComponent:
|
|
175
|
+
onCancel: a,
|
|
176
|
+
initialAccessControlDocument: f = { user: null },
|
|
177
|
+
UserPickerComponent: g = _,
|
|
178
|
+
UserPickerProps: S = {},
|
|
179
|
+
GroupPickerComponent: E = _,
|
|
180
|
+
GroupPickerProps: v = {},
|
|
181
|
+
PermissionPickerComponent: d = ue,
|
|
180
182
|
PermissionPickerProps: y,
|
|
181
|
-
RecipientTypePickerComponent:
|
|
182
|
-
RecipientTypePickerProps:
|
|
183
|
-
permissionText:
|
|
184
|
-
grantAccessText:
|
|
185
|
-
userText:
|
|
186
|
-
groupText:
|
|
187
|
-
searchText:
|
|
183
|
+
RecipientTypePickerComponent: R = ce,
|
|
184
|
+
RecipientTypePickerProps: P,
|
|
185
|
+
permissionText: i = "Permission",
|
|
186
|
+
grantAccessText: l = "Grant Access",
|
|
187
|
+
userText: m = "User",
|
|
188
|
+
groupText: I = "Group",
|
|
189
|
+
searchText: G = "Search",
|
|
188
190
|
cancelText: x = "Cancel",
|
|
189
191
|
hideDefaultGroups: L = !0
|
|
190
192
|
}) {
|
|
191
|
-
const { accessControlDocument: p, onChangePermission: w, onChangeRecipient:
|
|
193
|
+
const { accessControlDocument: p, onChangePermission: w, onChangeRecipient: O, onChangeRecipientType: D } = oe(f), H = () => Promise.resolve(
|
|
192
194
|
s({
|
|
193
195
|
entityType: n,
|
|
194
|
-
entityId:
|
|
196
|
+
entityId: t,
|
|
195
197
|
accessControlDocument: p
|
|
196
198
|
})
|
|
197
|
-
).then(
|
|
199
|
+
).then(o).catch(r), { permission: b = "" } = p, C = F(() => {
|
|
198
200
|
if (p[c.USER] !== void 0)
|
|
199
201
|
return c.USER;
|
|
200
202
|
if (p[c.GROUP] !== void 0)
|
|
201
203
|
return c.GROUP;
|
|
202
204
|
}, [p]), [j] = Object.values(p);
|
|
203
|
-
return /* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
return /* @__PURE__ */ h("div", { className: e.root, children: [
|
|
206
|
+
/* @__PURE__ */ h("div", { className: e.recipientRoot, children: [
|
|
207
|
+
R ? /* @__PURE__ */ u(
|
|
208
|
+
R,
|
|
207
209
|
{
|
|
208
|
-
value:
|
|
210
|
+
value: C,
|
|
209
211
|
onChange: D,
|
|
210
|
-
userText:
|
|
211
|
-
groupText:
|
|
212
|
-
...
|
|
212
|
+
userText: m,
|
|
213
|
+
groupText: I,
|
|
214
|
+
...P
|
|
213
215
|
}
|
|
214
216
|
) : null,
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
g &&
|
|
217
|
+
/* @__PURE__ */ h("div", { className: e.recipientType, children: [
|
|
218
|
+
g && C === c.USER ? /* @__PURE__ */ u(
|
|
217
219
|
g,
|
|
218
220
|
{
|
|
219
221
|
onSearch: ie,
|
|
220
|
-
onChange:
|
|
221
|
-
label:
|
|
222
|
-
...
|
|
222
|
+
onChange: O,
|
|
223
|
+
label: G,
|
|
224
|
+
...S
|
|
223
225
|
}
|
|
224
226
|
) : null,
|
|
225
|
-
E &&
|
|
227
|
+
E && C === c.GROUP ? /* @__PURE__ */ u(
|
|
226
228
|
E,
|
|
227
229
|
{
|
|
228
230
|
onSearch: ae,
|
|
229
|
-
onChange:
|
|
230
|
-
label:
|
|
231
|
-
...
|
|
231
|
+
onChange: O,
|
|
232
|
+
label: G,
|
|
233
|
+
...v,
|
|
232
234
|
hideDefaultGroups: L
|
|
233
235
|
}
|
|
234
236
|
) : null
|
|
235
237
|
] })
|
|
236
238
|
] }),
|
|
237
|
-
|
|
238
|
-
|
|
239
|
+
d ? /* @__PURE__ */ u(
|
|
240
|
+
d,
|
|
239
241
|
{
|
|
240
|
-
value:
|
|
242
|
+
value: b,
|
|
241
243
|
onChange: w,
|
|
242
244
|
selected: j,
|
|
243
|
-
label:
|
|
245
|
+
label: i,
|
|
244
246
|
...y
|
|
245
247
|
}
|
|
246
248
|
) : null,
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
|
|
249
|
+
/* @__PURE__ */ h("div", { className: e.actions, children: [
|
|
250
|
+
a ? /* @__PURE__ */ u(A, { className: e.actionsCancel, onClick: a, children: x }) : null,
|
|
251
|
+
/* @__PURE__ */ u(
|
|
252
|
+
A,
|
|
251
253
|
{
|
|
252
254
|
className: e.actionsSubmit,
|
|
253
255
|
onClick: H,
|
|
254
|
-
disabled: !p[
|
|
256
|
+
disabled: !p[C] || !b,
|
|
255
257
|
variant: "outlined",
|
|
256
258
|
color: "primary",
|
|
257
|
-
children:
|
|
259
|
+
children: l
|
|
258
260
|
}
|
|
259
261
|
)
|
|
260
262
|
] })
|
|
261
263
|
] });
|
|
262
264
|
}
|
|
263
|
-
const ge = $(
|
|
265
|
+
const ge = $(te, { name: "VdtEntityAccessEdit" })(se);
|
|
264
266
|
export {
|
|
265
267
|
ge as default
|
|
266
268
|
};
|
|
@@ -1,67 +1,75 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { withStyles as
|
|
4
|
-
import { useSavedSearch as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as E, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import G from "clsx";
|
|
3
|
+
import { withStyles as L } from "@material-ui/core";
|
|
4
|
+
import { useSavedSearch as M } from "@vidispine/vdt-react";
|
|
5
|
+
import N from "./SavedSearchList.js";
|
|
6
|
+
import U from "./SaveSearchForm.js";
|
|
7
|
+
const $ = (e) => ({
|
|
8
8
|
root: {
|
|
9
9
|
padding: e.spacing(2)
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
function
|
|
12
|
+
function k({
|
|
13
13
|
classes: e,
|
|
14
14
|
className: S,
|
|
15
|
-
markerField:
|
|
16
|
-
markerValue:
|
|
17
|
-
itemSearchDocument:
|
|
18
|
-
onSelect:
|
|
19
|
-
onSaveSuccess:
|
|
15
|
+
markerField: c,
|
|
16
|
+
markerValue: n,
|
|
17
|
+
itemSearchDocument: d,
|
|
18
|
+
onSelect: i,
|
|
19
|
+
onSaveSuccess: h = () => {
|
|
20
20
|
},
|
|
21
|
-
onSaveError:
|
|
21
|
+
onSaveError: m = () => {
|
|
22
22
|
},
|
|
23
|
-
SearchListComponent: a =
|
|
24
|
-
SearchListProps:
|
|
25
|
-
SearchFormComponent: r =
|
|
26
|
-
SearchFormProps:
|
|
23
|
+
SearchListComponent: a = N,
|
|
24
|
+
SearchListProps: l = {},
|
|
25
|
+
SearchFormComponent: r = U,
|
|
26
|
+
SearchFormProps: f = {},
|
|
27
27
|
accessTranslate: v,
|
|
28
|
-
extraMenuItems:
|
|
29
|
-
isLoading:
|
|
28
|
+
extraMenuItems: p,
|
|
29
|
+
isLoading: u = !1,
|
|
30
|
+
onDeleteError: g = () => {
|
|
31
|
+
},
|
|
32
|
+
enableSearch2: t = !1
|
|
30
33
|
}) {
|
|
31
34
|
const {
|
|
32
|
-
onDeleteSearch:
|
|
33
|
-
onUpdateSearchMetadata:
|
|
34
|
-
onGetSavedSearchSettings:
|
|
35
|
-
onSaveSearch:
|
|
36
|
-
searchProps:
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
onDeleteSearch: x,
|
|
36
|
+
onUpdateSearchMetadata: P,
|
|
37
|
+
onGetSavedSearchSettings: j,
|
|
38
|
+
onSaveSearch: w,
|
|
39
|
+
searchProps: y
|
|
40
|
+
} = M(
|
|
41
|
+
{ markerField: c, markerValue: n, initialSearchState: { rowsPerPage: 5 } },
|
|
42
|
+
t
|
|
43
|
+
), D = ({ collectionId: o }) => j({ collectionId: o }).then((V) => i(V, o));
|
|
44
|
+
return /* @__PURE__ */ E("div", { className: G(e.root, "VdtSavedSearch-root", S), children: [
|
|
45
|
+
r && /* @__PURE__ */ s(
|
|
40
46
|
r,
|
|
41
47
|
{
|
|
42
|
-
itemSearchDocument:
|
|
43
|
-
onSuccess:
|
|
44
|
-
onError:
|
|
45
|
-
onSaveSearch:
|
|
46
|
-
...
|
|
48
|
+
itemSearchDocument: d,
|
|
49
|
+
onSuccess: h,
|
|
50
|
+
onError: m,
|
|
51
|
+
onSaveSearch: w,
|
|
52
|
+
...f
|
|
47
53
|
}
|
|
48
54
|
),
|
|
49
|
-
a && /* @__PURE__ */
|
|
55
|
+
a && /* @__PURE__ */ s(
|
|
50
56
|
a,
|
|
51
57
|
{
|
|
52
|
-
onSelect:
|
|
53
|
-
onDelete:
|
|
54
|
-
onUpdateSearchMetadata:
|
|
55
|
-
searchProps:
|
|
58
|
+
onSelect: D,
|
|
59
|
+
onDelete: x,
|
|
60
|
+
onUpdateSearchMetadata: P,
|
|
61
|
+
searchProps: y,
|
|
56
62
|
accessTranslate: v,
|
|
57
|
-
extraMenuItems:
|
|
58
|
-
isLoading:
|
|
59
|
-
|
|
63
|
+
extraMenuItems: p,
|
|
64
|
+
isLoading: u,
|
|
65
|
+
onDeleteError: g,
|
|
66
|
+
enableSearch2: t,
|
|
67
|
+
...l
|
|
60
68
|
}
|
|
61
69
|
)
|
|
62
70
|
] });
|
|
63
71
|
}
|
|
64
|
-
const
|
|
72
|
+
const J = L($, { name: "VdtSavedSearchList" })(k);
|
|
65
73
|
export {
|
|
66
|
-
|
|
74
|
+
J as default
|
|
67
75
|
};
|
|
@@ -1,51 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { withStyles as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
searchProps:
|
|
8
|
-
searchPlaceholderText:
|
|
9
|
-
onSelect:
|
|
10
|
-
onDelete:
|
|
11
|
-
onUpdateSearchMetadata:
|
|
12
|
-
RowComponent: m =
|
|
13
|
-
RowProps:
|
|
14
|
-
accessTranslate:
|
|
15
|
-
extraMenuItems:
|
|
16
|
-
isLoading:
|
|
17
|
-
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { withStyles as p, List as u } from "@material-ui/core";
|
|
3
|
+
import w from "../../collection/CollectionSearchPicker/index.js";
|
|
4
|
+
import C from "./SavedSearchRow.js";
|
|
5
|
+
const I = {};
|
|
6
|
+
function g({
|
|
7
|
+
searchProps: i,
|
|
8
|
+
searchPlaceholderText: n = "Find searches",
|
|
9
|
+
onSelect: d,
|
|
10
|
+
onDelete: s,
|
|
11
|
+
onUpdateSearchMetadata: c,
|
|
12
|
+
RowComponent: m = C,
|
|
13
|
+
RowProps: h = {},
|
|
14
|
+
accessTranslate: l,
|
|
15
|
+
extraMenuItems: S,
|
|
16
|
+
isLoading: P,
|
|
17
|
+
onDeleteError: v,
|
|
18
|
+
...f
|
|
18
19
|
}) {
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
20
|
+
return /* @__PURE__ */ r(
|
|
21
|
+
w,
|
|
21
22
|
{
|
|
22
|
-
searchProps:
|
|
23
|
-
searchPlaceholder:
|
|
24
|
-
CollectionTableComponent: ({ collectionListType: o, onRefresh:
|
|
23
|
+
searchProps: i,
|
|
24
|
+
searchPlaceholder: n,
|
|
25
|
+
CollectionTableComponent: ({ collectionListType: o, onRefresh: a }) => /* @__PURE__ */ r(u, { children: o && o.collection && o.collection.map((e) => /* @__PURE__ */ r(
|
|
25
26
|
m,
|
|
26
27
|
{
|
|
27
28
|
collectionType: e,
|
|
28
|
-
onSelect: () =>
|
|
29
|
-
onDelete: () => Promise.resolve(
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
onSelect: () => d({ collectionId: e.id }),
|
|
30
|
+
onDelete: () => Promise.resolve(
|
|
31
|
+
s({ collectionId: e.id }).catch((t) => {
|
|
32
|
+
v(t);
|
|
33
|
+
}).then(a)
|
|
34
|
+
),
|
|
35
|
+
onUpdateSearchMetadata: (t) => Promise.resolve(
|
|
36
|
+
c({
|
|
32
37
|
collectionId: e.id,
|
|
33
|
-
metadataDocument:
|
|
34
|
-
}).then(
|
|
38
|
+
metadataDocument: t
|
|
39
|
+
}).then(a)
|
|
35
40
|
),
|
|
36
|
-
accessTranslate:
|
|
37
|
-
extraMenuItems:
|
|
38
|
-
isLoading:
|
|
39
|
-
...
|
|
41
|
+
accessTranslate: l,
|
|
42
|
+
extraMenuItems: S,
|
|
43
|
+
isLoading: P,
|
|
44
|
+
...h
|
|
40
45
|
},
|
|
41
46
|
e.id
|
|
42
47
|
)) }),
|
|
43
48
|
PaginationProps: { rowsPerPageOptions: [5, 10] },
|
|
44
|
-
...
|
|
49
|
+
...f
|
|
45
50
|
}
|
|
46
51
|
);
|
|
47
52
|
}
|
|
48
|
-
const
|
|
53
|
+
const D = p(I, { name: "VdtSavedSearchList" })(g);
|
|
49
54
|
export {
|
|
50
|
-
|
|
55
|
+
D as default
|
|
51
56
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { withStyles as
|
|
5
|
-
import { parseMetadataType as
|
|
6
|
-
import { compose as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { jsxs as z, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $, useMemo as Z } from "react";
|
|
3
|
+
import P from "clsx";
|
|
4
|
+
import { withStyles as A } from "@material-ui/core";
|
|
5
|
+
import { parseMetadataType as C } from "@vidispine/vdt-js";
|
|
6
|
+
import { compose as ee, useGetSavedSearchFolders as te, useSavedSearch as ne } from "@vidispine/vdt-react";
|
|
7
|
+
import ae from "../SavedSearch/SavedSearchRow.js";
|
|
8
|
+
import de from "./AddFolderRow.js";
|
|
9
|
+
const k = {
|
|
10
10
|
markerValue: "savedSearch",
|
|
11
11
|
markerField: "eidr_referentType"
|
|
12
|
-
},
|
|
12
|
+
}, oe = {
|
|
13
13
|
indentationWidth: 20,
|
|
14
14
|
indentationDepthStart: 1,
|
|
15
15
|
defaultRowIndentationOffset: 15,
|
|
16
16
|
defalutNewRowIndentation: 10
|
|
17
|
-
},
|
|
17
|
+
}, ie = () => ({
|
|
18
18
|
root: {
|
|
19
19
|
display: "flex",
|
|
20
20
|
width: "100%",
|
|
@@ -24,7 +24,7 @@ const $ = {
|
|
|
24
24
|
display: "flex",
|
|
25
25
|
width: "100%"
|
|
26
26
|
}
|
|
27
|
-
}),
|
|
27
|
+
}), le = (a) => ({
|
|
28
28
|
root: {
|
|
29
29
|
display: "flex",
|
|
30
30
|
width: "100%"
|
|
@@ -36,7 +36,7 @@ const $ = {
|
|
|
36
36
|
marginRight: 5
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
function
|
|
39
|
+
function re({
|
|
40
40
|
className: a,
|
|
41
41
|
classes: t,
|
|
42
42
|
children: s,
|
|
@@ -49,7 +49,7 @@ function le({
|
|
|
49
49
|
addNewRowIndentation: I
|
|
50
50
|
}) {
|
|
51
51
|
const w = d ? !0 : i >= u, o = d ? I : l;
|
|
52
|
-
return S ? null : /* @__PURE__ */
|
|
52
|
+
return S ? null : /* @__PURE__ */ z("div", { className: P(a, t.root), children: [
|
|
53
53
|
w && /* @__PURE__ */ n(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
@@ -63,14 +63,14 @@ function le({
|
|
|
63
63
|
s
|
|
64
64
|
] });
|
|
65
65
|
}
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
)(
|
|
69
|
-
function
|
|
66
|
+
const ce = ee(
|
|
67
|
+
A(le, { name: "VdtFolderRowContentWrapper" })
|
|
68
|
+
)(re);
|
|
69
|
+
function G({
|
|
70
70
|
classes: a,
|
|
71
71
|
id: t,
|
|
72
72
|
queryParams: s,
|
|
73
|
-
markerProps: h =
|
|
73
|
+
markerProps: h = k,
|
|
74
74
|
childFolders: S = [],
|
|
75
75
|
metadata: i = {},
|
|
76
76
|
itemSearchDocument: u = {},
|
|
@@ -80,40 +80,41 @@ function A({
|
|
|
80
80
|
onSelect: w,
|
|
81
81
|
onRemoveItem: o,
|
|
82
82
|
indentationValues: F = {},
|
|
83
|
-
indentationProps: r =
|
|
84
|
-
FolderRowContentComponent: y =
|
|
83
|
+
indentationProps: r = oe,
|
|
84
|
+
FolderRowContentComponent: y = ae,
|
|
85
85
|
FolderRowContentProps: p = {},
|
|
86
|
-
AddRowComponent: b =
|
|
86
|
+
AddRowComponent: b = de,
|
|
87
87
|
AddRowProps: g = {},
|
|
88
|
-
FolderRowContentWrapperComponent: f =
|
|
88
|
+
FolderRowContentWrapperComponent: f = ce,
|
|
89
89
|
FolderRowContentWrapperProps: m = {},
|
|
90
90
|
isLoading: x,
|
|
91
|
-
|
|
91
|
+
onDeleteError: M,
|
|
92
|
+
...O
|
|
92
93
|
}) {
|
|
93
|
-
const [R,
|
|
94
|
-
createFolder:
|
|
95
|
-
saveSearch:
|
|
96
|
-
deleteFolder:
|
|
97
|
-
removeItem:
|
|
94
|
+
const [R, V] = $(), [_, N] = $({ id: null, type: null }), {
|
|
95
|
+
createFolder: B,
|
|
96
|
+
saveSearch: D,
|
|
97
|
+
deleteFolder: E,
|
|
98
|
+
removeItem: W,
|
|
98
99
|
subFolders: v = []
|
|
99
|
-
} =
|
|
100
|
+
} = te({
|
|
100
101
|
childFolders: S,
|
|
101
102
|
expand: R,
|
|
102
103
|
queryParams: s,
|
|
103
104
|
markerProps: h
|
|
104
|
-
}), { onDeleteSearch:
|
|
105
|
-
|
|
106
|
-
}),
|
|
107
|
-
const { __child_collection_size: e = 0 } =
|
|
105
|
+
}), { onDeleteSearch: q, onUpdateSearchMetadata: T, onGetSavedSearchSettings: H } = ne({
|
|
106
|
+
...k
|
|
107
|
+
}), j = ({ collectionId: e }) => H({ collectionId: e }).then((Y) => w(Y, e)), U = C(i, { joinValue: "_", flat: !0 }), J = Z(() => {
|
|
108
|
+
const { __child_collection_size: e = 0 } = U;
|
|
108
109
|
return v.length > 0 || !R && e > 0;
|
|
109
|
-
}, [v.length, R,
|
|
110
|
+
}, [v.length, R, U]), { defalutNewRowIndentation: K, defaultRowIndentationOffset: L, indentationWidth: Q } = r, c = {
|
|
110
111
|
rowIndentation: F.rowIndentation || 0,
|
|
111
|
-
addNewRowIndentation: F.addNewRowIndentation ||
|
|
112
|
-
},
|
|
112
|
+
addNewRowIndentation: F.addNewRowIndentation || K
|
|
113
|
+
}, X = {
|
|
113
114
|
rowIndentation: c.addNewRowIndentation,
|
|
114
|
-
addNewRowIndentation: c.addNewRowIndentation +
|
|
115
|
+
addNewRowIndentation: c.addNewRowIndentation + Q + L
|
|
115
116
|
};
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ z("div", { className: a.root, children: [
|
|
117
118
|
{
|
|
118
119
|
folder: /* @__PURE__ */ n(
|
|
119
120
|
f,
|
|
@@ -129,15 +130,15 @@ function A({
|
|
|
129
130
|
hideSubFolderSharing: I,
|
|
130
131
|
type: l,
|
|
131
132
|
collectionType: { id: t, metadata: i },
|
|
132
|
-
disableDeletion:
|
|
133
|
-
onDelete: () => Promise.resolve(
|
|
133
|
+
disableDeletion: J,
|
|
134
|
+
onDelete: () => Promise.resolve(E(t)).then(() => {
|
|
134
135
|
o && o(t);
|
|
135
136
|
}),
|
|
136
|
-
onUpdateSearchMetadata: (e) =>
|
|
137
|
+
onUpdateSearchMetadata: (e) => T({
|
|
137
138
|
collectionId: t,
|
|
138
139
|
metadataDocument: e
|
|
139
140
|
}),
|
|
140
|
-
onExpand: () =>
|
|
141
|
+
onExpand: () => V((e) => !e),
|
|
141
142
|
onAddRow: N,
|
|
142
143
|
isLoading: x,
|
|
143
144
|
...p
|
|
@@ -158,11 +159,13 @@ function A({
|
|
|
158
159
|
isFolderRow: !0,
|
|
159
160
|
type: l,
|
|
160
161
|
collectionType: { id: t, metadata: i },
|
|
161
|
-
onSelect: () =>
|
|
162
|
-
onDelete: () => Promise.resolve(
|
|
162
|
+
onSelect: () => j({ collectionId: t }),
|
|
163
|
+
onDelete: () => Promise.resolve(q({ collectionId: t })).then(() => {
|
|
163
164
|
o && o(t);
|
|
165
|
+
}).catch((e) => {
|
|
166
|
+
M(e);
|
|
164
167
|
}),
|
|
165
|
-
onUpdateSearchMetadata: (e) =>
|
|
168
|
+
onUpdateSearchMetadata: (e) => T({
|
|
166
169
|
collectionId: t,
|
|
167
170
|
metadataDocument: e
|
|
168
171
|
}),
|
|
@@ -181,25 +184,25 @@ function A({
|
|
|
181
184
|
folderDepth: d,
|
|
182
185
|
...c,
|
|
183
186
|
...r,
|
|
184
|
-
hideWrapper: !
|
|
187
|
+
hideWrapper: !_.id,
|
|
185
188
|
...m,
|
|
186
189
|
children: /* @__PURE__ */ n(
|
|
187
190
|
b,
|
|
188
191
|
{
|
|
189
192
|
id: t,
|
|
190
|
-
setExpand:
|
|
191
|
-
saveSearch:
|
|
193
|
+
setExpand: V,
|
|
194
|
+
saveSearch: D,
|
|
192
195
|
onAddRow: N,
|
|
193
|
-
createFolder:
|
|
196
|
+
createFolder: B,
|
|
194
197
|
itemSearchDocument: u,
|
|
195
|
-
newField:
|
|
198
|
+
newField: _,
|
|
196
199
|
...g
|
|
197
200
|
}
|
|
198
201
|
)
|
|
199
202
|
}
|
|
200
203
|
),
|
|
201
204
|
v.map((e) => /* @__PURE__ */ n(
|
|
202
|
-
|
|
205
|
+
G,
|
|
203
206
|
{
|
|
204
207
|
classes: a,
|
|
205
208
|
id: e.id,
|
|
@@ -211,9 +214,9 @@ function A({
|
|
|
211
214
|
folderDepth: d + 1,
|
|
212
215
|
type: e.type,
|
|
213
216
|
hideSubFolderSharing: !0,
|
|
214
|
-
handleSelect:
|
|
217
|
+
handleSelect: j,
|
|
215
218
|
onSelect: w,
|
|
216
|
-
onRemoveItem: () =>
|
|
219
|
+
onRemoveItem: () => W(e.id),
|
|
217
220
|
indentationProps: r,
|
|
218
221
|
FolderRowContentComponent: y,
|
|
219
222
|
FolderRowContentProps: p,
|
|
@@ -221,15 +224,16 @@ function A({
|
|
|
221
224
|
AddRowProps: g,
|
|
222
225
|
FolderRowContentWrapperComponent: f,
|
|
223
226
|
FolderRowContentWrapperProps: m,
|
|
224
|
-
indentationValues:
|
|
227
|
+
indentationValues: X,
|
|
225
228
|
isLoading: x,
|
|
226
|
-
|
|
229
|
+
onDeleteError: M,
|
|
230
|
+
props: O
|
|
227
231
|
},
|
|
228
232
|
e.id
|
|
229
233
|
))
|
|
230
234
|
] });
|
|
231
235
|
}
|
|
232
|
-
const
|
|
236
|
+
const ye = A(ie, { name: "VdtFolderRow" })(G);
|
|
233
237
|
export {
|
|
234
|
-
|
|
238
|
+
ye as default
|
|
235
239
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vidispine/vdt-materialui",
|
|
3
|
-
"version": "26.2.
|
|
3
|
+
"version": "26.2.3",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@babel/runtime": "7.26.10",
|
|
39
|
-
"@vidispine/proptypes": "26.2.
|
|
40
|
-
"@vidispine/vdt-api": "26.2.
|
|
41
|
-
"@vidispine/vdt-js": "26.2.
|
|
42
|
-
"@vidispine/vdt-react": "26.2.
|
|
43
|
-
"@vidispine/vdt-videojs-react": "26.2.
|
|
39
|
+
"@vidispine/proptypes": "26.2.3",
|
|
40
|
+
"@vidispine/vdt-api": "26.2.3",
|
|
41
|
+
"@vidispine/vdt-js": "26.2.3",
|
|
42
|
+
"@vidispine/vdt-react": "26.2.3",
|
|
43
|
+
"@vidispine/vdt-videojs-react": "26.2.3",
|
|
44
44
|
"clsx": "1.2.1",
|
|
45
45
|
"filesize": "10.1.0",
|
|
46
46
|
"final-form": "4.20.10",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"@material-ui/icons": "4.11.3",
|
|
75
75
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
76
76
|
"@types/jest": "29.5.11",
|
|
77
|
-
"@vidispine/eslint-config-mdx": "26.2.
|
|
78
|
-
"@vidispine/eslint-config-react": "26.2.
|
|
79
|
-
"@vidispine/eslint-config-storybook": "26.2.
|
|
80
|
-
"@vidispine/prettier-config": "26.2.
|
|
81
|
-
"@vidispine/proptypes": "26.2.
|
|
77
|
+
"@vidispine/eslint-config-mdx": "26.2.3",
|
|
78
|
+
"@vidispine/eslint-config-react": "26.2.3",
|
|
79
|
+
"@vidispine/eslint-config-storybook": "26.2.3",
|
|
80
|
+
"@vidispine/prettier-config": "26.2.3",
|
|
81
|
+
"@vidispine/proptypes": "26.2.3",
|
|
82
82
|
"@vitejs/plugin-react": "4.2.1",
|
|
83
83
|
"@wojtekmaj/enzyme-adapter-react-17": "0.8.0",
|
|
84
84
|
"axios": "1.13.5",
|