theme.keycloak.v2.account.resources.content.my-resources-page.AbstractResourceTable.js.map Maven / Gradle / Ivy
{"version":3,"file":"AbstractResourceTable.js","names":["React","Msg","AbstractResourcesTable","Component","hasPermissions","row","state","permissions","has","get","length","firstUser","username","numOthers","sharedWithUsersMessage","createElement","Fragment","msgKey","getClientName","client","hasOwnProperty","name","localize","clientId"],"sources":["../../../src/app/content/my-resources-page/AbstractResourceTable.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Permission, PaginatedResources, Client } from './resource-model';\nimport { Msg } from '../../widgets/Msg';\n\nexport interface ResourcesTableProps {\n resources: PaginatedResources;\n}\n\nexport interface ResourcesTableState {\n permissions: Map;\n}\n\nexport abstract class AbstractResourcesTable extends React.Component {\n\n protected hasPermissions(row: number): boolean {\n return (this.state.permissions.has(row)) && (this.state.permissions.get(row)!.length > 0);\n }\n\n private firstUser(row: number): string {\n if (!this.hasPermissions(row)) return 'ERROR!!!!'; // should never happen\n\n return this.state.permissions.get(row)![0].username;\n }\n\n protected numOthers(row: number): number {\n if (!this.hasPermissions(row)) return -1; // should never happen\n\n return this.state.permissions.get(row)!.length - 1;\n }\n\n public sharedWithUsersMessage(row: number): React.ReactNode {\n if (!this.hasPermissions(row)) return ( );\n\n return (\n \n \n {this.firstUser(row)}\n \n {this.numOthers(row) > 0 && \n {this.numOthers(row)}\n }.\n \n );\n }\n\n protected getClientName(client: Client): string {\n if (client.hasOwnProperty('name') && client.name !== null && client.name !== '') {\n return Msg.localize(client.name!);\n } else {\n return client.clientId;\n }\n }\n}\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK;AAEjB,SAASC,GAAG;AAUZ,OAAO,MAAeC,sBAAsB,SAAwCF,KAAK,CAACG,SAAS,CAAyB;EAEhHC,cAAcA,CAACC,GAAW,EAAW;IAC7C,OAAQ,IAAI,CAACC,KAAK,CAACC,WAAW,CAACC,GAAG,CAACH,GAAG,CAAC,IAAM,IAAI,CAACC,KAAK,CAACC,WAAW,CAACE,GAAG,CAACJ,G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