1 |
- {"version":3,"sources":["../../src/app/widgets/Logout.tsx"],"names":["React","Msg","KeycloakContext","Button","DropdownItem","handleLogout","keycloak","logout","LogoutButton","Component","render","LogoutDropdownItem","localize"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ;AAEA,SAAQC,GAAR;AAEA,SAASC,eAAT;AAEA,SAAQC,MAAR,EAAgBC,YAAhB;;AAEA,SAASC,YAAT,CAAsBC,QAAtB,EAAuD;AACnDA,EAAAA,QAAQ,CAACC,MAAT;AACH;;AAGD,OAAO,MAAMC,YAAN,SAA2BR,KAAK,CAACS,SAAjC,CAAwD;AACpDC,EAAAA,MAAM,GAAoB;AAC7B,WACI,oBAAC,eAAD,CAAiB,QAAjB,QACEJ,QAAQ,IACN,oBAAC,MAAD;AAAQ,MAAA,EAAE,EAAC,eAAX;AAA2B,MAAA,OAAO,EAAE,MAAMD,YAAY,CAACC,QAAD;AAAtD,OAAmE,oBAAC,GAAD;AAAK,MAAA,MAAM,EAAC;AAAZ,MAAnE,CAFJ,CADJ;AAQH;;AAV0D;AAc/D,OAAO,MAAMK,kBAAN,SAAiCX,KAAK,CAACS,SAAvC,CAA0E;AACtEC,EAAAA,MAAM,GAAoB;AAC7B,WACI,oBAAC,eAAD,CAAiB,QAAjB,QACMJ,QAAQ,IACV,oBAAC,YAAD;AAAc,MAAA,EAAE,EAAC,aAAjB;AAA+B,MAAA,GAAG,EAAC,QAAnC;AAA4C,MAAA,OAAO,EAAE,MAAMD,YAAY,CAACC,QAAD;AAAvE,OACKL,GAAG,CAACW,QAAJ,CAAa,WAAb,CADL,CAFJ,CADJ;AASH;;AAX4E","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 {Msg} from './Msg';\nimport {KeycloakService} from '../keycloak-service/keycloak.service';\nimport { KeycloakContext } from '../keycloak-service/KeycloakContext';\n\nimport {Button, DropdownItem} from '@patternfly/react-core';\n\nfunction handleLogout(keycloak: KeycloakService): void {\n keycloak.logout();\n}\n\ninterface LogoutProps {}\nexport class LogoutButton extends React.Component<LogoutProps> {\n public render(): React.ReactNode {\n return (\n <KeycloakContext.Consumer>\n { keycloak => (\n <Button id=\"signOutButton\" onClick={() => handleLogout(keycloak!)}><Msg msgKey=\"doSignOut\"/></Button>\n )}\n </KeycloakContext.Consumer>\n\n );\n }\n}\n\ninterface LogoutDropdownItemProps {}\nexport class LogoutDropdownItem extends React.Component<LogoutDropdownItemProps> {\n public render(): React.ReactNode {\n return (\n <KeycloakContext.Consumer>\n { keycloak => (\n <DropdownItem id=\"signOutLink\" key=\"logout\" onClick={() => handleLogout(keycloak!)}>\n {Msg.localize('doSignOut')}\n </DropdownItem>\n )}\n </KeycloakContext.Consumer>\n );\n }\n}"],"file":"Logout.js"}
|