{"version":3,"sources":["webpack:///./src/core/types.tsx","webpack:///./src/core/modals/third-party-credentials-modal.tsx","webpack:///./src/core/modal-loader.tsx","webpack:///./src/core/services/third-party-credentials-service.ts"],"names":["ThirdPartyPropertyConditionOperator","_super","ThirdPartyCredentialsModal","props","_this","call","this","state","thirdParty","name","properties","submitted","working","createSuccess","createError","loadSuccess","credentialsCreated","createdThirdPartyCredentials","handleClose","bind","createCredentials","onPropertyChange","onChange","__extends","prototype","onClose","created","credentials","setState","type","args","filter","p","checkPropertyCondition","every","third_party_credentials_service","result","_a","sent","e_1","message","componentDidMount","thirdPartyProperties","properties_1","forEach","property","toLowerCase","console","log","e_2","event","target","checked","value","condition","sourceProperty","operator","In","trim","split","includes","renderProperties","map","react","Grid","item","xs","TextField","required","id","label","displayName","fullWidth","autoComplete","error","disabled","style","fontFamily","color","fontSize","marginTop","dangerouslySetInnerHTML","__html","infoText","FormControlLabel","control","Checkbox","FormControl","InputLabel","Select","labelId","values","MenuItem","renderMessage","Box","mt","Alert","variant","severity","AlertTitle","renderDialogContent","m","container","spacing","LinearProgress","render","dialogTitle","Dialog","open","aria-labelledby","aria-describedby","maxWidth","DialogTitle","backgroundColor","DialogContent","overflowY","DialogActions","Button","onClick","theme","Object","createMuiTheme","typography","h6","button","body1","body2","caption","palette","primary","main","modal_loader_ModalLoader","ModalLoader","closeModal","modal_loader_extends","ThemeProvider","third_party_credentials_modal","ssoUrl","window","global","getThirdParty","fetch","response","Error","status","json","method","body","JSON","stringify","ThirdPartyType","headers","Content-Type"],"mappings":"oGAkJYA,mKAAZ,SAAYA,GACRA,IAAA,WADJ,CAAYA,MAAmC,qnDC5I/C,SAAAC,GACE,SAAAC,EAAYC,GAAZ,IAAAC,EACEH,EAAAI,KAAAC,KAAMH,IAAMG,YAEZF,EAAKG,MAAQ,CACXC,WAAY,KACZC,KAAM,GACNC,WAAY,GACZC,WAAW,EACXC,SAAS,EACTC,cAAe,KACfC,YAAa,KACbC,YAAa,KACbC,oBAAoB,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,OACN,IAAIyG,MAAMrE,EAAMlC,gBAEtB,MAAM,IAAIuG,MAAM,8EAKrB,SAAe3H,EAAkBS,EAAcpB,EAAcC,qGAIjD,gCAAMmI,MAASJ,EAAM,oCAAqC,CACjES,OAAQ,OACRC,KAAMC,KAAKC,UAAU,CACjB5I,KAAIA,EACJ6I,eAAgBzH,EAChBnB,WAAUA,IAEd6I,QAAS,CACLC,eAAgB,oBAEpB7H,YAAa,2BAVjBmH,EAAWzG,EAAAC,oBAcX,iBADAS,QAAQC,IAAIC,GACN,IAAI8F,MAAM,uFAGE,KAAnBD,EAASE,OAAT,MACC,GAAOF,EAASG,sBAEM,KAAnBH,EAASE,OAAT,MACa,GAAMF,EAASG,eAC3B,MADIvE,EAAQrC,EAAAC,OACN,IAAIyG,MAAMrE,EAAMlC,gBAEtB,MAAM,IAAIuG,MAAM","file":"2.bundle.js","sourcesContent":["import { MenuItemType } from \"./Enums\";\n\nexport interface IGatorEnviroment {\n systemId: number;\n displayName: JSX.Element;\n}\n\nexport interface IGatorEnviroments extends Array { }\n\nexport interface IGatorApp {\n clientId: number;\n enviroments: IGatorEnviroments;\n}\n\nexport interface IGatorApps extends Array { }\n\nexport interface IClients {\n clientId: number;\n getClinet: () => string;\n}\n\nexport interface IAccountSubMenuItem {\n itemName: string;\n link: string;\n className: string;\n}\n\nexport interface IAccountCardInfo {\n FirstName: string;\n LastName: string;\n Email: string;\n IsImpersonating: boolean;\n}\n\nexport interface IAccountDropdownItem {\n itemName: string;\n link: string;\n className: string;\n itemType: number;\n subMenu : Array;\n icon: string;\n cardInfo: IAccountCardInfo;\n newWindow : boolean;\n}\n\nexport interface ISsoAccounts {\n companyId: string;\n currentAppId: number;\n isAdmin: boolean;\n isCompanyAdmin: boolean;\n isPartnerAdmin: boolean;\n isPartnerSuperAdmin: boolean;\n id: string;\n firstName: string;\n lastName: string;\n email: string;\n companyName: string;\n clientUserDisplayName?: string;\n clientUserUniqueId?: string;\n trueUser: string;\n user: string;\n isImpersonating: boolean;\n currentAppName: number;\n isAuthenticated: boolean;\n companyApps: IGatorApps;\n ShowFeatureRequest: boolean,\n showGatorHome: boolean,\n showModal: boolean,\n modalType: string,\n modalArgs: any,\n modalCallback: Function\n}\n\nexport interface IAccountMenuProps {\n companyId: string;\n isCompanyAdmin: boolean;\n isPartnerAdmin: boolean;\n isPartnerSuperAdmin: boolean;\n accountName: string;\n fristName: string;\n lastName: string;\n email: string;\n isImpersonation: boolean;\n isAdmin: boolean;\n accountId: string;\n showHome: boolean;\n showFeatureRequest: boolean;\n clientId: Number;\n}\n\nexport interface IGatorProductState {\n accountDropClass: string;\n hoverActiveClass: string;\n helpDropClass: string;\n hoverHelpActiveClass: string;\n isImpersonation: boolean;\n showAccountControl: boolean;\n showHelpControl: boolean;\n nameIcon: string;\n}\n\nexport interface IModalLoaderProps {\n type: string,\n args: any,\n onClose: Function\n}\n\nexport interface IModalProps {\n args: any,\n onClose: Function\n}\n\nexport interface IThirdPartyModalState {\n thirdParty: IThirdParty,\n name: string,\n properties: any,\n submitted: boolean,\n working: boolean,\n createSuccess: boolean\n createError: string,\n loadSuccess: boolean,\n credentialsCreated: boolean,\n createdThirdPartyCredentials: IThirdPartyCredentials\n}\n\nexport interface IThirdParty {\n name: string,\n type: string,\n properties: Array\n}\n\nexport interface IThirdPartyProperty {\n name: string,\n displayName: string,\n type: string,\n values: Array,\n infoText: string\n condition: IThirdPartyPropertyCondition\n}\n\nexport interface IThirdPartyPropertyCondition {\n sourceProperty: string,\n operator: ThirdPartyPropertyConditionOperator\n value: string\n}\n\nexport enum ThirdPartyPropertyConditionOperator {\n \"In\" = 0,\n}\n\nexport interface IThirdPartyCredentials {\n credentialsId: string,\n name: string,\n thirdPartyType: string\n}","import * as React from \"react\"\nimport { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, LinearProgress, Box, Typography, Grid, TextField, FormControlLabel, Checkbox, FormControl, InputLabel, Select, MenuItem } from \"@material-ui/core\";\nimport { Alert, AlertTitle } from \"@material-ui/lab\";\nimport { IModalProps, IThirdPartyModalState, IThirdPartyProperty, ThirdPartyPropertyConditionOperator } from \"../types\"\nimport * as thirdPartyCredentialsService from \"../services/third-party-credentials-service\";\n\nexport default class ThirdPartyCredentialsModal extends React.Component {\n constructor(props: any) {\n super(props);\n\n this.state = {\n thirdParty: null,\n name: \"\",\n properties: {},\n submitted: false,\n working: false,\n createSuccess: null,\n createError: null,\n loadSuccess: null,\n credentialsCreated: false,\n createdThirdPartyCredentials: null\n };\n\n this.handleClose = this.handleClose.bind(this);\n this.createCredentials = this.createCredentials.bind(this);\n this.onPropertyChange = this.onPropertyChange.bind(this);\n this.onChange = this.onChange.bind(this);\n }\n\n private handleClose() {\n this.props.onClose({\n created: this.state.credentialsCreated,\n credentials: this.state.createdThirdPartyCredentials\n });\n }\n\n private async createCredentials() {\n this.setState({\n submitted: true\n });\n\n let name = this.state.name;\n let type = this.props.args.type;\n let properties = this.state.properties;\n\n if(name && this.state.thirdParty.properties.filter(p => this.checkPropertyCondition(p)).every((p) => typeof properties[p.name] !== \"undefined\")) {\n this.setState({\n working: true\n });\n\n try {\n let result = await thirdPartyCredentialsService.createCredentials(type, name, properties);\n\n this.setState({\n name: \"\",\n properties: {},\n createSuccess: true,\n working: false,\n submitted: false,\n credentialsCreated: true,\n createdThirdPartyCredentials: result\n });\n }catch(e) {\n this.setState({\n createSuccess: false,\n createError: e.message,\n working: false\n });\n }\n }\n }\n\n async componentDidMount() {\n try {\n let thirdParty = await thirdPartyCredentialsService.getThirdParty(this.props.args.type);\n let thirdPartyProperties = thirdParty.properties;\n\n let properties = this.state.properties;\n thirdPartyProperties.forEach((property) => {\n if(property.type.toLowerCase() == \"boolean\"){\n properties[property.name] = false;\n }\n });\n\n this.setState({\n thirdParty,\n loadSuccess: true,\n properties: properties\n })\n } catch (e) {\n this.setState({\n loadSuccess: false\n });\n\n console.log(e);\n }\n }\n\n private onPropertyChange(event: any) {\n var properties = this.state.properties;\n\n if(event.target.type === \"checkbox\") {\n properties[event.target.name] = event.target.checked;\n }else{\n properties[event.target.name] = event.target.value;\n }\n\n this.setState({\n properties\n });\n }\n\n private onChange(event: any) {\n this.setState({\n [event.target.name]: event.target.value,\n });\n }\n\n private checkPropertyCondition(property: IThirdPartyProperty) {\n if(property.condition) {\n var value = this.state.properties[property.condition.sourceProperty];\n if(value) {\n switch (property.condition.operator) {\n case ThirdPartyPropertyConditionOperator.In: {\n const values = property.condition.value.toLowerCase().trim().split(/\\s*,\\s*/);\n if (values.includes(value.toLowerCase())) {\n return true;\n } \n }\n }\n }\n\n return false;\n }\n\n return true;\n }\n\n private renderProperties() {\n var properties = this.state.thirdParty.properties;\n\n return properties.filter(p => this.checkPropertyCondition(p)).map((property) => {\n switch (property.type.toLowerCase()) {\n case \"string\":\n return (\n \n \n
\n
\n );\n case \"password\":\n return (\n \n \n
\n
\n ); \n case \"boolean\":\n return (\n \n }\n label={property.displayName}\n />\n );\n case \"url\":\n return (\n \n \n
\n
\n ); \n break;\n case \"integer\":\n return (\n \n \n
\n
\n ); \n break;\n case \"picklist\":\n return (\n \n \n {property.displayName}\n \n {\n property.values.map((value) => {value})\n }\n \n \n \n );\n break; \n }\n });\n }\n\n private renderMessage() {\n if(this.state.createSuccess === false) {\n return (\n \n \n \n Error Creating Credentials\n {this.state.createError}\n \n \n \n );\n } else if(this.state.createSuccess === true) {\n return (\n \n \n \n Credentials Created Succesfully\n The credentials have been created succesfully. Click close to continue.\n \n \n \n );\n }\n }\n\n private renderDialogContent() {\n if(this.state.loadSuccess === false) {\n return (\n \n \n \n Error Loading Credential Details\n We were unable to load the credential details. Please close the window and try again. If this error persists please contact your support representative\n \n \n ); \n } else if (!this.state.thirdParty) {\n return (\n \n \n \n );\n } else {\n return (\n \n \n \n \n \n {this.renderProperties()}\n \n {this.renderMessage()}\n \n );\n }\n }\n\n public render() {\n let dialogTitle = this.state.thirdParty ? `Create ${this.state.thirdParty.name} Credentials` : \"Create Credentials\"\n\n return (\n \n {dialogTitle}\n \n {this.renderDialogContent()}\n \n \n \n {\n this.state.loadSuccess && !this.state.createSuccess && (\n \n )\n }\n \n \n ); \n }\n}","import * as React from \"react\"\nimport { IModalLoaderProps } from \"./types\"\nimport ThirdPartyCredentialsModal from \"./modals/third-party-credentials-modal\"\nimport { createMuiTheme, ThemeProvider } from \"@material-ui/core/styles\";\n\n// const theme = createMuiTheme({\n// typography: {\n// fontFamily: 'Roboto, Helvetica, Arial, sans-serif',\n// fontSize: 13,\n// button: {\n// fontSize: 14,\n// },\n// label: {\n// fontSize: 20\n// },\n// h6: {\n// fontSize: 20\n// }\n// }\n// });\n\nconst theme = createMuiTheme({\n typography: {\n fontFamily: 'Roboto, Helvetica, Arial, sans-serif',\n fontSize: 16,\n h6:{\n fontSize: 20\n },\n button:{\n fontSize: 16\n },\n body1: {\n fontSize: 16\n },\n body2: {\n fontSize: 16\n },\n caption: {\n fontSize: 11\n }\n },\n palette: {\n primary: {\n main: '#002a4d'\n }\n }\n});\n\nexport default class ModalLoader extends React.Component {\n constructor(props: any) {\n super(props);\n\n this.state = {\n };\n\n this.closeModal = this.closeModal.bind(this);\n }\n\n private closeModal(result: any) {\n this.props.onClose(result);\n }\n\n public render() {\n switch(this.props.type.toLowerCase()){\n case \"thirdpartycredentials\": {\n return \n \n ;\n }\n default:{\n this.closeModal(null);\n return null;\n }\n }\n }\n}","import { IThirdParty, IThirdPartyCredentials } from \"../types\";\n\nconst _global = (window || global) as any;\nconst ssoUrl = _global.ssoUrl;\n\nexport async function getThirdParty(type: string) : Promise {\n let response;\n\n try {\n response = await fetch(`${ssoUrl}/api/thirdpartycredentials/thirdparties/get/${type}`, { credentials: 'include' });\n } catch(e) {\n throw new Error(\"An unknown error has occurred, please refresh the page and try again.\");\n }\n\n if(response.status == 200){\n return response.json();\n }else{\n if(response.status == 400) {\n var error = await response.json();\n throw new Error(error.message);\n } else {\n throw new Error(\"An unknown error has occurred, please refresh the page and try again.\");\n }\n }\n}\n\nexport async function createCredentials(type: string, name: string, properties: any) : Promise {\n let response;\n\n try {\n response = await fetch(`${ssoUrl}/api/thirdpartycredentials/create`, {\n method: 'POST',\n body: JSON.stringify({\n name,\n ThirdPartyType: type,\n properties\n }),\n headers: {\n 'Content-Type': 'application/json'\n }, \n credentials: 'include'\n });\n } catch(e) {\n console.log(e);\n throw new Error(\"An unknown error has occurred, please refresh the page and try again.\");\n }\n\n if(response.status == 200){\n return response.json();\n }else{\n if(response.status == 400) {\n var error = await response.json();\n throw new Error(error.message);\n } else {\n throw new Error(\"An unknown error has occurred, please refresh the page and try again.\");\n }\n }\n}"],"sourceRoot":""}