SharedResourcesTable.js.map 9.2 KB

1
  1. {"version":3,"sources":["../../../src/app/content/my-resources-page/SharedResourcesTable.tsx"],"names":["React","DataList","DataListItem","DataListItemRow","DataListCell","DataListItemCells","ChipGroup","ChipGroupToolbarItem","Chip","RepositoryIcon","Msg","AbstractResourcesTable","EmptyMessageState","SharedResourcesTable","constructor","props","state","permissions","Map","render","resources","data","length","localize","map","resource","row","name","client","baseUrl","getClientName","scopes","scope","displayName","shareRequests"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ;AAEA,SACIC,QADJ,EAEIC,YAFJ,EAGIC,eAHJ,EAIIC,YAJJ,EAKIC,iBALJ,EAMIC,SANJ,EAOIC,oBAPJ,EAQIC,IARJ;AAUA,SAASC,cAAT;AAIA,SAASC,GAAT;AACA,SAASC,sBAAT;AACA,OAAOC,iBAAP;AAOA,OAAO,MAAMC,oBAAN,SAAmCF,sBAAnC,CAA+E;AAE3EG,EAAAA,WAAW,CAACC,KAAD,EAA6B;AAC3C,UAAMA,KAAN;AACA,SAAKC,KAAL,GAAa;AACTC,MAAAA,WAAW,EAAE,IAAIC,GAAJ;AADJ,KAAb;AAGH;;AAEMC,EAAAA,MAAM,GAAoB;AAC7B,QAAI,KAAKJ,KAAL,CAAWK,SAAX,CAAqBC,IAArB,CAA0BC,MAA1B,KAAqC,CAAzC,EAA4C;AACxC,aACI,oBAAC,iBAAD;AAAmB,QAAA,IAAI,EAAEb,cAAzB;AAAyC,QAAA,UAAU,EAAC;AAApD,QADJ;AAGH;;AACD,WACI,oBAAC,QAAD;AAAU,oBAAYC,GAAG,CAACa,QAAJ,CAAa,WAAb,CAAtB;AAAiD,MAAA,EAAE,EAAC;AAApD,OACI,oBAAC,YAAD;AAAc,MAAA,GAAG,EAAC,iBAAlB;AAAoC,yBAAgB;AAApD,OACI,oBAAC,eAAD,QACI,oBAAC,iBAAD;AACI,MAAA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ApC;AAAyC,QAAA,KAAK,EAAE;AAAhD,SACMD,QAAQ,CAACM,MAAT,CAAgBT,MAAhB,GAAyB,CAAzB,IACF,oBAAC,SAAD;AAAW,QAAA,WAAW;AAAtB,SACI,oBAAC,oBAAD;AAAsB,QAAA,GAAG,EAAC,aAA1B;AAAwC,QAAA,YAAY,EAAEZ,GAAG,CAACa,QAAJ,CAAa,aAAb;AAAtD,SAEQE,QAAQ,CAACM,MAAT,CAAgBP,GAAhB,CAAoBQ,KAAK,IACrB,oBAAC,IAAD;AAAM,QAAA,GAAG,EAAEA,KAAK,CAACL,IAAjB;AAAuB,QAAA,UAAU;AAAjC,SACKK,KAAK,CAACC,WAAN,IAAqBD,KAAK,CAACL,IADhC,CADJ,CAFR,CADJ,CAFJ,CAPW,EAqBX,oBAAC,YAAD;AAAc,QAAA,GAAG,EAAE,aAAaD,GAAhC;AAAqC,QAAA,KAAK,EAAE;AAA5C,SACKD,QAAQ,CAACS,aAAT,CAAuBZ,MAAvB,GAAgC,CAAhC,IACD,oBAAC,SAAD;AAAW,QAAA,WAAW;AAAtB,SACI,oBAAC,oBAAD;AAAsB,QAAA,GAAG,EAAC,aAA1B;AAAwC,QAAA,YAAY,EAAEZ,GAAG,CAACa,QAAJ,CAAa,SAAb;AAAtD,SAESE,QAAQ,CAACS,aAAT,CAAuB,CAAvB,EAA0BH,MAA3B,CAA8CP,GAA9C,CAAkDQ,KAAK,IACnD,oBAAC,IAAD;AAAM,QAAA,GAAG,EAAEA,KAAK,CAACL,IAAjB;AAAuB,QAAA,UAAU;AAAjC,SACKK,KAAK,CAACC,WAAN,IAAqBD,KAAK,CAACL,IADhC,CADJ,CAFR,CADJ,CAFJ,CArBW;AADnB,MADJ,CADJ,CADH,CAjBL,CADJ;AAiEH;;AAhFiF","sourcesContent":["/*\n * Copyright 2018 Red Hat, Inc. and/or its affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as React from 'react';\n\nimport {\n DataList,\n DataListItem,\n DataListItemRow,\n DataListCell,\n DataListItemCells,\n ChipGroup,\n ChipGroupToolbarItem,\n Chip\n } from '@patternfly/react-core';\nimport { RepositoryIcon } from '@patternfly/react-icons';\n\n\nimport { PaginatedResources, Resource, Scope } from \"./resource-model\";\nimport { Msg } from '../../widgets/Msg';\nimport { AbstractResourcesTable, ResourcesTableState } from './AbstractResourceTable';\nimport EmptyMessageState from '../../widgets/EmptyMessageState';\n\nexport interface ResourcesTableProps {\n resources: PaginatedResources;\n noResourcesMessage: string;\n}\n\nexport class SharedResourcesTable extends AbstractResourcesTable<ResourcesTableState> {\n\n public constructor(props: ResourcesTableProps) {\n super(props);\n this.state = {\n permissions: new Map()\n }\n }\n\n public render(): React.ReactNode {\n if (this.props.resources.data.length === 0) {\n return (\n <EmptyMessageState icon={RepositoryIcon} messageKey=\"noResourcesSharedWithYou\"/>\n );\n }\n return (\n <DataList aria-label={Msg.localize('resources')} id=\"sharedResourcesList\">\n <DataListItem key='resource-header' aria-labelledby='resource-header'>\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell key='resource-name-header' width={2}>\n <strong><Msg msgKey='resourceName'/></strong>\n </DataListCell>,\n <DataListCell key='application-name-header' width={2}>\n <strong><Msg msgKey='application'/></strong>\n </DataListCell>,\n <DataListCell key='permission-header' width={2}/>,\n <DataListCell key='requests-header' width={2}/>,\n ]}\n />\n </DataListItemRow>\n </DataListItem>\n {this.props.resources.data.map((resource: Resource, row: number) => (\n <DataListItem key={'resource-' + row} aria-labelledby={resource.name}>\n <DataListItemRow>\n <DataListItemCells\n dataListCells={[\n <DataListCell key={'resourceName-' + row} width={2}>\n <Msg msgKey={resource.name}/>\n </DataListCell>,\n <DataListCell key={'resourceClient-' + row} width={2}>\n <a href={resource.client.baseUrl}>{this.getClientName(resource.client)}</a>\n </DataListCell>,\n <DataListCell key={'permissions-' + row} width={2}>\n { resource.scopes.length > 0 &&\n <ChipGroup withToolbar>\n <ChipGroupToolbarItem key='permissions' categoryName={Msg.localize('permissions')}>\n {\n resource.scopes.map(scope => (\n <Chip key={scope.name} isReadOnly>\n {scope.displayName || scope.name}\n </Chip>\n ))\n }\n </ChipGroupToolbarItem>\n </ChipGroup>}\n </DataListCell>,\n <DataListCell key={'pending-' + row} width={2}>\n {resource.shareRequests.length > 0 &&\n <ChipGroup withToolbar>\n <ChipGroupToolbarItem key='permissions' categoryName={Msg.localize('pending')}>\n {\n (resource.shareRequests[0].scopes as Scope[]).map(scope => (\n <Chip key={scope.name} isReadOnly>\n {scope.displayName || scope.name}\n </Chip>\n ))\n }\n </ChipGroupToolbarItem>\n </ChipGroup>\n }\n </DataListCell>\n ]}\n />\n </DataListItemRow>\n </DataListItem>\n ))}\n </DataList>\n );\n }\n}"],"file":"SharedResourcesTable.js"}