SigningInPage.js.map 28 KB

1
  1. {"version":3,"sources":["../../../src/app/content/signingin-page/SigningInPage.tsx"],"names":["React","withRouter","Button","DataList","DataListAction","DataListItemCells","DataListCell","DataListItem","DataListItemRow","Stack","StackItem","Title","TitleLevel","DataListActionVisibility","Dropdown","DropdownPosition","KebabToggle","AIACommand","TimeUtil","AccountServiceContext","ContinueCancelModal","Msg","ContentPage","ContentAlert","KeycloakContext","css","SigningInPage","Component","constructor","props","context","credentialId","userLabel","doDelete","then","getCredentialContainers","success","state","credentialContainers","Map","doGet","response","allContainers","containers","data","forEach","container","categoryMap","get","category","set","type","setState","console","log","credElementId","credType","credId","item","substring","render","renderCategories","Array","from","keys","map","h2","renderTypes","credTypeMap","keycloak","index","typeArray","renderCredTypeTitle","renderUserCredentials","renderEmptyRow","length","isLast","credContainer","userCredentials","removeable","displayName","localizedDisplayName","localize","credential","hasOwnProperty","createdDate","strCreatedDate","format","updateAIA","updateAction","id","credentialRowCells","handleRemove","credRowCells","push","setupAction","createAction","credContainerDisplayName","h3","helptext","hiddenOnLg","right","isOpen","open","execute","visibleOnLg","hidden","CredentialAction","credRemover","SigningInPageWithRouter"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ;AAEA,SAAQC,UAAR;AACA,SACQC,MADR,EAEQC,QAFR,EAGQC,cAHR,EAIQC,iBAJR,EAKQC,YALR,EAMQC,YANR,EAOQC,eAPR,EAQQC,KARR,EASQC,SATR,EAUQC,KAVR,EAWQC,UAXR,EAYQC,wBAZR,EAaQC,QAbR,EAcQC,gBAdR,EAeQC,WAfR;AAkBA,SAAQC,UAAR;AACA,OAAOC,QAAP;AAEA,SAAQC,qBAAR;AACA,SAAQC,mBAAR;AAEA,SAAQC,GAAR;AACA,SAAQC,WAAR;AACA,SAAQC,YAAR;AACA,SAASC,eAAT;AAEA,SAASC,GAAT;;AA2CA;AACA;AACA;AACA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liates.\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 {withRouter, RouteComponentProps} from 'react-router-dom';\nimport {\n Button,\n DataList,\n DataListAction,\n DataListItemCells,\n DataListCell,\n DataListItem,\n DataListItemRow,\n Stack,\n StackItem,\n Title,\n TitleLevel,\n DataListActionVisibility,\n Dropdown,\n DropdownPosition,\n KebabToggle,\n } from '@patternfly/react-core';\n\nimport {AIACommand} from '../../util/AIACommand';\nimport TimeUtil from '../../util/TimeUtil';\nimport {HttpResponse, AccountServiceClient} from '../../account-service/account.service';\nimport {AccountServiceContext} from '../../account-service/AccountServiceContext';\nimport {ContinueCancelModal} from '../../widgets/ContinueCancelModal';\nimport {Features} from '../../widgets/features';\nimport {Msg} from '../../widgets/Msg';\nimport {ContentPage} from '../ContentPage';\nimport {ContentAlert} from '../ContentAlert';\nimport { KeycloakContext } from '../../keycloak-service/KeycloakContext';\nimport { KeycloakService } from '../../keycloak-service/keycloak.service';\nimport { css } from '@patternfly/react-styles';\n\ndeclare const features: Features;\n\ninterface PasswordDetails {\n registered: boolean;\n lastUpdate: number;\n}\n\ntype CredCategory = 'password' | 'two-factor' | 'passwordless';\ntype CredType = string;\ntype CredTypeMap = Map<CredType, CredentialContainer>;\ntype CredContainerMap = Map<CredCategory, CredTypeMap>;\n\ninterface UserCredential {\n id: string;\n type: string;\n userLabel: string;\n createdDate?: number;\n strCreatedDate?: string;\n}\n\n// A CredentialContainer is unique by combo of credential type and credential category\ninterface CredentialContainer {\n category: CredCategory;\n type: CredType;\n displayName: string;\n helptext?: string;\n createAction?: string;\n updateAction?: string;\n removeable: boolean;\n userCredentials: UserCredential[];\n open: boolean;\n}\n\ninterface SigningInPageProps extends RouteComponentProps {\n}\n\ninterface SigningInPageState {\n // Credential containers organized by category then type\n credentialContainers: CredContainerMap;\n}\n\n/**\n * @author Stan Silvert ssilvert@redhat.com (C) 2018 Red Hat Inc.\n */\nclass SigningInPage extends React.Component<SigningInPageProps, SigningInPageState> {\n static contextType = AccountServiceContext;\n context: React.ContextType<typeof AccountServiceContext>;\n\n public constructor(props: SigningInPageProps, context: React.ContextType<typeof AccountServiceContext>) {\n super(props);\n this.context = context;\n \n this.state = {\n credentialContainers: new Map(),\n }\n\n this.getCredentialContainers();\n }\n\n private getCredentialContainers(): void {\n this.context!.doGet(\"/credentials\")\n .then((response: HttpResponse<CredentialContainer[]>) => {\n\n const allContainers: CredContainerMap = new Map();\n const containers: CredentialContainer[] = response.data || [];\n containers.forEach(container => {\n let categoryMap = allContainers.get(container.category);\n if (!categoryMap) {\n categoryMap = new Map();\n allContainers.set(container.category, categoryMap);\n }\n categoryMap.set(container.type, container);\n });\n\n this.setState({credentialContainers: allContainers});\n console.log({allContainers})\n });\n }\n\n private handleRemove = (credentialId: string, userLabel: string) => {\n this.context!.doDelete(\"/credentials/\" + credentialId)\n .then(() => {\n this.getCredentialContainers();\n ContentAlert.success('successRemovedMessage', [userLabel]);\n });\n }\n\n public static credElementId(credType: CredType, credId: string, item: string): string {\n return `${credType}-${item}-${credId.substring(0,8)}`;\n }\n\n public render(): React.ReactNode {\n return (\n <ContentPage title=\"signingIn\"\n introMessage=\"signingInSubMessage\">\n <Stack gutter='md'>\n {this.renderCategories()}\n </Stack>\n </ContentPage>\n );\n }\n\n private renderCategories(): React.ReactNode {\n return (<> {\n Array.from(this.state.credentialContainers.keys()).map(category => (\n <StackItem key={category} isFilled>\n <Title id={`${category}-categ-title`} headingLevel={TitleLevel.h2} size='2xl'>\n <strong><Msg msgKey={category}/></strong>\n </Title>\n <DataList aria-label='foo'>\n {this.renderTypes(this.state.credentialContainers.get(category)!)}\n </DataList>\n </StackItem>\n ))\n\n }</>)\n }\n\n private renderTypes(credTypeMap: CredTypeMap): React.ReactNode {\n return (\n <KeycloakContext.Consumer> \n { keycloak => (\n <>{\n Array.from(credTypeMap.keys()).map((credType: CredType, index: number, typeArray: string[]) => ([\n this.renderCredTypeTitle(credTypeMap.get(credType)!, keycloak!),\n this.renderUserCredentials(credTypeMap, credType, keycloak!),\n this.renderEmptyRow(credTypeMap.get(credType)!.type, index === typeArray.length - 1)\n ]))\n }</>\n )}\n </KeycloakContext.Consumer>\n );\n }\n\n private renderEmptyRow(type: string, isLast: boolean): React.ReactNode {\n if (isLast) return; // don't put empty row at the end\n\n return (\n <DataListItem aria-labelledby={'empty-list-item-' + type}>\n <DataListItemRow key={'empty-row-' + type}>\n <DataListItemCells dataListCells={[<DataListCell></DataListCell>]}/>\n </DataListItemRow>\n </DataListItem>\n )\n }\n\n private renderUserCredentials(credTypeMap: CredTypeMap, credType: CredType, keycloak: KeycloakService): React.ReactNode {\n const credContainer: CredentialContainer = credTypeMap.get(credType)!;\n const userCredentials: UserCredential[] = credContainer.userCredentials;\n const removeable: boolean = credContainer.removeable;\n const type: string = credContainer.type;\n const displayName: string = credContainer.displayName;\n\n if (!userCredentials || userCredentials.length === 0) {\n const localizedDisplayName = Msg.localize(displayName);\n return (\n <DataListItem key='no-credentials-list-item' aria-labelledby='no-credentials-list-item'>\n <DataListItemRow key='no-credentials-list-item-row'>\n <DataListItemCells\n dataListCells={[\n <DataListCell key={'no-credentials-cell-0'}/>,\n <strong id={`${type}-not-set-up`} key={'no-credentials-cell-1'}><Msg msgKey='notSetUp' params={[localizedDisplayName]}/></strong>,\n <DataListCell key={'no-credentials-cell-2'}/>\n ]}/>\n </DataListItemRow>\n </DataListItem>\n );\n }\n\n userCredentials.forEach(credential => {\n if (!credential.userLabel) credential.userLabel = Msg.localize(credential.type);\n if (credential.hasOwnProperty('createdDate') && credential.createdDate && credential.createdDate! > 0) {\n credential.strCreatedDate = TimeUtil.format(credential.createdDate as number);\n }\n });\n\n let updateAIA: AIACommand;\n if (credContainer.updateAction) {\n updateAIA = new AIACommand(keycloak, credContainer.updateAction);\n }\n\n return (\n <React.Fragment key='userCredentials'> {\n userCredentials.map(credential => (\n <DataListItem id={`${SigningInPage.credElementId(type, credential.id, 'row')}`} key={'credential-list-item-' + credential.id} aria-labelledby={'credential-list-item-' + credential.userLabel}>\n <DataListItemRow key={'userCredentialRow-' + credential.id}>\n <DataListItemCells dataListCells={this.credentialRowCells(credential, type)}/>\n\n <CredentialAction credential={credential}\n removeable={removeable}\n updateAction={updateAIA}\n credRemover={this.handleRemove}/>\n </DataListItemRow>\n </DataListItem>\n ))\n }\n </React.Fragment>)\n }\n\n private credentialRowCells(credential: UserCredential, type: string): React.ReactNode[] {\n const credRowCells: React.ReactNode[] = [];\n credRowCells.push(<DataListCell id={`${SigningInPage.credElementId(type, credential.id, 'label')}`} key={'userLabel-' + credential.id}>{credential.userLabel}</DataListCell>);\n if (credential.strCreatedDate) {\n credRowCells.push(<DataListCell id={`${SigningInPage.credElementId(type, credential.id, 'created-at')}`} key={'created-' + credential.id}><strong><Msg msgKey='credentialCreatedAt'/>: </strong>{credential.strCreatedDate}</DataListCell>);\n credRowCells.push(<DataListCell key={'spacer-' + credential.id}/>);\n }\n\n return credRowCells;\n }\n\n private renderCredTypeTitle(credContainer: CredentialContainer, keycloak: KeycloakService): React.ReactNode {\n if (!credContainer.hasOwnProperty('helptext') && !credContainer.hasOwnProperty('createAction')) return;\n\n let setupAction: AIACommand;\n if (credContainer.createAction) {\n setupAction = new AIACommand(keycloak, credContainer.createAction);\n }\n const credContainerDisplayName: string = Msg.localize(credContainer.displayName);\n\n return (\n <React.Fragment key={'credTypeTitle-' + credContainer.type}>\n <DataListItem aria-labelledby={'type-datalistitem-' + credContainer.type}>\n <DataListItemRow key={'credTitleRow-' + credContainer.type}>\n <DataListItemCells\n dataListCells={[\n <DataListCell width={5} key={'credTypeTitle-' + credContainer.type}>\n <Title headingLevel={TitleLevel.h3} size='2xl'>\n <strong id={`${credContainer.type}-cred-title`}><Msg msgKey={credContainer.displayName}/></strong>\n </Title>\n <span id={`${credContainer.type}-cred-help`}>\n {credContainer.helptext && <Msg msgKey={credContainer.helptext}/>}\n </span>\n </DataListCell>,\n\n ]}/>\n {credContainer.createAction &&\n <DataListAction\n aria-labelledby='create'\n aria-label='create action'\n id={'mob-setUpAction-' + credContainer.type}\n className={DataListActionVisibility.hiddenOnLg}\n >\n <Dropdown\n isPlain\n position={DropdownPosition.right}\n toggle={<KebabToggle onToggle={isOpen => {\n credContainer.open = isOpen;\n this.setState({ credentialContainers: new Map(this.state.credentialContainers) });\n }} />}\n isOpen={credContainer.open}\n dropdownItems={[\n <button id={`mob-${credContainer.type}-set-up`} className=\"pf-c-button pf-m-link\" type=\"button\" onClick={() => setupAction.execute()}>\n <span className=\"pf-c-button__icon\">\n <i className=\"fas fa-plus-circle\" aria-hidden=\"true\"></i>\n </span>\n <Msg msgKey='setUpNew' params={[credContainerDisplayName]} />\n </button>]}\n />\n </DataListAction>}\n {credContainer.createAction &&\n <DataListAction\n aria-labelledby='create'\n aria-label='create action'\n id={'setUpAction-' + credContainer.type}\n className={css(DataListActionVisibility.visibleOnLg, DataListActionVisibility.hidden)}\n >\n <button id={`${credContainer.type}-set-up`} className=\"pf-c-button pf-m-link\" type=\"button\" onClick={()=> setupAction.execute()}>\n <span className=\"pf-c-button__icon\">\n <i className=\"fas fa-plus-circle\" aria-hidden=\"true\"></i>\n </span>\n <Msg msgKey='setUpNew' params={[credContainerDisplayName]}/>\n </button>\n </DataListAction>}\n </DataListItemRow>\n </DataListItem>\n </React.Fragment>\n )\n }\n\n};\n\ntype CredRemover = (credentialId: string, userLabel: string) => void;\ninterface CredentialActionProps {credential: UserCredential;\n removeable: boolean;\n updateAction: AIACommand;\n credRemover: CredRemover;};\nclass CredentialAction extends React.Component<CredentialActionProps> {\n\n render(): React.ReactNode {\n if (this.props.updateAction) {\n return (\n <DataListAction aria-labelledby='foo' aria-label='foo action' id={'updateAction-' + this.props.credential.id}>\n <Button id={`${SigningInPage.credElementId(this.props.credential.type, this.props.credential.id, 'update')}`} variant='primary'onClick={()=> this.props.updateAction.execute()}><Msg msgKey='update'/></Button>\n </DataListAction>\n )\n }\n\n if (this.props.removeable) {\n const userLabel: string = this.props.credential.userLabel;\n return (\n <DataListAction aria-labelledby='foo' aria-label='foo action' id={'removeAction-' + this.props.credential.id }>\n <ContinueCancelModal buttonTitle='remove'\n buttonId={`${SigningInPage.credElementId(this.props.credential.type, this.props.credential.id, 'remove')}`}\n modalTitle={Msg.localize('removeCred', [userLabel])}\n modalMessage={Msg.localize('stopUsingCred', [userLabel])}\n onContinue={() => this.props.credRemover(this.props.credential.id, userLabel)}\n />\n </DataListAction>\n )\n }\n\n return (<></>)\n }\n}\n\nconst SigningInPageWithRouter = withRouter(SigningInPage);\nexport { SigningInPageWithRouter as SigningInPage};"],"file":"SigningInPage.js"}