{"version":3,"sources":["../../../src/app/content/my-resources-page/ResourcesTable.tsx"],"names":["React","DataList","DataListItem","DataListItemRow","DataListCell","DataListToggle","DataListContent","DataListItemCells","Level","LevelItem","Button","DataListAction","DataListActionVisibility","Dropdown","DropdownPosition","DropdownItem","KebabToggle","css","Remove2Icon","RepositoryIcon","ShareAltIcon","EditAltIcon","AccountServiceContext","PermissionRequest","ShareTheResource","Msg","AbstractResourcesTable","EditTheResource","ContentAlert","EmptyMessageState","ContinueCancelModal","ResourcesTable","constructor","props","context","row","newIsRowOpen","state","isRowOpen","fetchPermissions","resources","data","setState","isOpen","isModalActive","contextOpen","index","length","permissions","Map","resource","doGet","_id","then","response","newPermissions","set","removeShare","get","map","a","username","scopes","doPut","success","localize","render","visibility","name","onToggle","client","baseUrl","getClientName","shareRequests","hiddenOnLg","right","onContextToggle","sharedWithUsersMessage","toggle","numOthers","visibleOnLg","hidden"],"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,cALJ,EAMIC,eANJ,EAOIC,iBAPJ,EAQIC,KARJ,EASIC,SATJ,EAUIC,MAVJ,EAWIC,cAXJ,EAYIC,wBAZJ,EAaIC,QAbJ,EAcIC,gBAdJ,EAeIC,YAfJ,EAgBIC,WAhBJ;AAkBA,SAASC,GAAT;AAEA,SAASC,WAAT,EAAsBC,cAAtB,EAAsCC,YAAtC,EAAoDC,WAApD;AAGA,SAASC,qBAAT;AACA,SAASC,iBAAT;AACA,SAASC,gBAAT;AAEA,SAASC,GAAT;AACA,SAAmDC,sBAAnD;AACA,SAASC,eAAT;AACA,SAASC,YAAT;AACA,OAAOC,iBAAP;AACA,SAASC,mBAAT;AAQA,OAAO,MAAMC,cAAN,SAA6BL,sBAA7B,CAAoF;AAIhFM,EAAAA,WAAW,CAACC,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,CADJ;AA+NH;;AAzRsF;;gBAA9EJ,c,iBACYT,qB","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 DataListToggle,\n DataListContent,\n DataListItemCells,\n Level,\n LevelItem,\n Button,\n DataListAction,\n DataListActionVisibility,\n Dropdown,\n DropdownPosition,\n DropdownItem,\n KebabToggle\n} from '@patternfly/react-core';\nimport { css } from '@patternfly/react-styles';\n\nimport { Remove2Icon, RepositoryIcon, ShareAltIcon, EditAltIcon } from '@patternfly/react-icons';\n\nimport { HttpResponse } from '../../account-service/account.service';\nimport { AccountServiceContext } from '../../account-service/AccountServiceContext';\nimport { PermissionRequest } from \"./PermissionRequest\";\nimport { ShareTheResource } from \"./ShareTheResource\";\nimport { Permission, Resource } from \"./resource-model\";\nimport { Msg } from '../../widgets/Msg';\nimport { ResourcesTableState, ResourcesTableProps, AbstractResourcesTable } from './AbstractResourceTable';\nimport { EditTheResource } from './EditTheResource';\nimport { ContentAlert } from '../ContentAlert';\nimport EmptyMessageState from '../../widgets/EmptyMessageState';\nimport { ContinueCancelModal } from '../../widgets/ContinueCancelModal';\n\nexport interface CollapsibleResourcesTableState extends ResourcesTableState {\n isRowOpen: boolean[];\n contextOpen: boolean[];\n isModalActive: boolean;\n}\n\nexport class ResourcesTable extends AbstractResourcesTable {\n static contextType = AccountServiceContext;\n context: React.ContextType;\n\n public constructor(props: ResourcesTableProps, context: React.ContextType) {\n super(props);\n this.context = context;\n\n this.state = {\n isRowOpen: [],\n contextOpen: [],\n isModalActive: false,\n permissions: new Map()\n }\n }\n\n private onToggle = (row: number): void => {\n const newIsRowOpen: boolean[] = this.state.isRowOpen;\n newIsRowOpen[row] = !newIsRowOpen[row];\n if (newIsRowOpen[row]) this.fetchPermissions(this.props.resources.data[row], row);\n this.setState({ isRowOpen: newIsRowOpen });\n };\n\n private onContextToggle = (row: number, isOpen: boolean): void => {\n if (this.state.isModalActive) return;\n const data = this.props.resources.data;\n const contextOpen = this.state.contextOpen;\n contextOpen[row] = isOpen;\n if (isOpen) {\n const index = row > data.length ? row - data.length - 1 : row;\n this.fetchPermissions(data[index], index);\n }\n this.setState({ contextOpen });\n }\n\n private fetchPermissions(resource: Resource, row: number): void {\n this.context!.doGet(`/resources/${resource._id}/permissions`)\n .then((response: HttpResponse) => {\n const newPermissions: Map = new Map(this.state.permissions);\n newPermissions.set(row, response.data || []);\n this.setState({ permissions: newPermissions });\n });\n }\n\n private removeShare(resource: Resource, row: number): Promise {\n const permissions = this.state.permissions.get(row)!.map(a => ({ username: a.username, scopes: [] }));\n return this.context!.doPut(`/resources/${resource._id}/permissions`, permissions)\n .then(() => {\n ContentAlert.success(Msg.localize('unShareSuccess'));\n });\n }\n\n public render(): React.ReactNode {\n if (this.props.resources.data.length === 0) {\n return (\n \n );\n }\n return (\n \n \n \n // invisible toggle allows headings to line up properly\n \n \n \n \n \n ,\n \n \n ,\n \n \n ,\n ]}\n />\n \n \n {this.props.resources.data.map((resource: Resource, row: number) => (\n \n \n this.onToggle(row)}\n isExpanded={this.state.isRowOpen[row]}\n id={'resourceToggle-' + row}\n aria-controls=\"ex-expand1\"\n />\n \n \n ,\n \n {this.getClientName(resource.client)}\n ,\n \n {resource.shareRequests.length > 0 &&\n this.fetchPermissions(resource, row)}\n >\n }\n \n ]}\n />\n \n this.setState({ isModalActive: true })}\n toggle={ this.onContextToggle(row + this.props.resources.data.length + 1, isOpen)} />}\n isOpen={this.state.contextOpen[row + this.props.resources.data.length + 1]}\n dropdownItems={[\n {\n this.setState({ isModalActive: false }, () => {\n this.onContextToggle(row + this.props.resources.data.length + 1, false);\n this.fetchPermissions(resource, row + this.props.resources.data.length + 1);\n });\n }}\n >\n {\n (toggle: () => void) => (\n \n \n )\n }\n ,\n {\n this.setState({ isModalActive: false }, () => {\n this.onContextToggle(row + this.props.resources.data.length + 1, false);\n this.fetchPermissions(resource, row + this.props.resources.data.length + 1);\n });\n }}\n >\n {\n (toggle: () => void) => (\n \n \n )\n }\n ,\n void) => (\n \n \n \n )}\n modalTitle=\"unShare\"\n modalMessage=\"unShareAllConfirm\"\n onClose={() =>\n this.setState({ isModalActive: false }, () => {\n this.onContextToggle(row + this.props.resources.data.length + 1, false);\n })\n }\n onContinue={() => this.removeShare(resource, row)\n .then(() => this.fetchPermissions(resource, row + this.props.resources.data.length + 1))}\n />\n ]}\n />\n \n \n this.fetchPermissions(resource, row)}\n >\n {\n (toggle: () => void) => (\n \n )\n }\n \n this.onContextToggle(row, isOpen)} />}\n onSelect={() => this.setState({ isModalActive: true })}\n isOpen={this.state.contextOpen[row]}\n dropdownItems={[\n {\n this.setState({ isModalActive: false }, () => {\n this.onContextToggle(row, false);\n this.fetchPermissions(resource, row);\n });\n }}\n >\n {\n (toggle: () => void) => (\n \n \n )\n }\n ,\n void) => (\n \n \n \n )}\n modalTitle=\"unShare\"\n modalMessage='unShareAllConfirm'\n onClose={() =>\n this.setState({ isModalActive: false }, () => {\n this.onContextToggle(row, false);\n })\n }\n onContinue={() => this.removeShare(resource, row).then(() => this.fetchPermissions(resource, row))}\n />\n ]}\n />\n \n\n \n \n \n \n {this.sharedWithUsersMessage(row)}\n \n \n \n \n ))}\n \n );\n }\n}"],"file":"ResourcesTable.js"}