feat: update keycloak theme

This commit is contained in:
Jonas Juselius
2024-02-22 09:47:34 +01:00
parent d6fde78f8d
commit f9e012da95
9813 changed files with 611335 additions and 162181 deletions
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
*
@@ -15,36 +16,28 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../common/keycloak/web_modules/react.js";
import * as React from "../keycloak.v2/web_modules/react.js";
import { PageNav } from "./PageNav.js";
import { PageHeaderTool } from "./PageHeaderTool.js";
import { makeRoutes } from "./ContentPages.js";
import { Brand, Page, PageHeader, PageSidebar } from "../../common/keycloak/web_modules/@patternfly/react-core.js";
import { Brand, Page, PageHeader, PageSidebar } from "../keycloak.v2/web_modules/@patternfly/react-core.js";
import { KeycloakContext } from "./keycloak-service/KeycloakContext.js";
;
export class App extends React.Component {
constructor(props, context) {
super(props);
_defineProperty(this, "context", void 0);
this.context = context;
toggleReact();
}
render() {
toggleReact(); // check login
toggleReact();
// check login
if (!this.context.authenticated() && !isWelcomePage()) {
this.context.login();
}
const username = /*#__PURE__*/React.createElement("span", {
style: {
marginLeft: '10px'
},
id: "loggedInUser"
}, loggedInUserName());
const Header = /*#__PURE__*/React.createElement(PageHeader, {
logo: /*#__PURE__*/React.createElement("a", {
id: "brandLink",
@@ -66,10 +59,7 @@ export class App extends React.Component {
isManagedSidebar: true
}, makeRoutes());
}
}
_defineProperty(App, "contextType", KeycloakContext);
;
//# sourceMappingURL=App.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/app/App.tsx"],"names":["React","PageNav","PageHeaderTool","makeRoutes","Brand","Page","PageHeader","PageSidebar","KeycloakContext","App","Component","constructor","props","context","toggleReact","render","authenticated","isWelcomePage","login","username","marginLeft","loggedInUserName","Header","brandUrl","brandImg","Sidebar"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ;AAIA,SAAQC,OAAR;AACA,SAAQC,cAAR;AACA,SAAQC,UAAR;AAEA,SACIC,KADJ,EAEIC,IAFJ,EAGIC,UAHJ,EAIIC,WAJJ;AAOA,SAASC,eAAT;AAS4B;AAC5B,OAAO,MAAMC,GAAN,SAAkBT,KAAK,CAACU,SAAxB,CAA4C;AAIxCC,EAAAA,WAAW,CAACC,KAAD,EAAkBC,OAAlB,EAAsE;AACpF,UAAMD,KAAN;;AADoF;;AAEpF,SAAKC,OAAL,GAAeA,OAAf;AACAC,IAAAA,WAAW;AACd;;AAEMC,EAAAA,MAAM,GAAoB;AAC7BD,IAAAA,WAAW,GADkB,CAG7B;;AACA,QAAI,CAAC,KAAKD,OAAL,CAAcG,aAAd,EAAD,IAAkC,CAACC,aAAa,EAApD,EAAwD;AACpD,WAAKJ,OAAL,CAAcK,KAAd;AACH;;AAED,UAAMC,QAAQ,gBACV;AAAM,MAAA,KAAK,EAAE;AAACC,QAAAA,UAAU,EAAE;AAAb,OAAb;AAAmC,MAAA,EAAE,EAAC;AAAtC,OAAsDC,gBAAgB,EAAtE,CADJ;AAIA,UAAMC,MAAM,gBACR,oBAAC,UAAD;AACI,MAAA,IAAI,eAAE;AAAG,QAAA,EAAE,EAAC,WAAN;AAAkB,QAAA,IAAI,EAAEC;AAAxB,sBAAkC,oBAAC,KAAD;AAAO,QAAA,GAAG,EAAEC,QAAZ;AAAsB,QAAA,GAAG,EAAC,MAA1B;AAAiC,QAAA,SAAS,EAAC;AAA3C,QAAlC,CADV;AAEI,MAAA,WAAW,eAAE,oBAAC,cAAD,OAFjB;AAGI,MAAA,aAAa;AAHjB,MADJ;AAQA,UAAMC,OAAO,gBAAG,oBAAC,WAAD;AAAa,MAAA,GAAG,eAAE,oBAAC,OAAD;AAAlB,MAAhB;AAEA,wBACI,oBAAC,IAAD;AAAM,MAAA,MAAM,EAAEH,MAAd;AAAsB,MAAA,OAAO,EAAEG,OAA/B;AAAwC,MAAA,gBAAgB;AAAxD,OACKtB,UAAU,EADf,CADJ;AAKH;;AArC8C;;gBAAtCM,G,iBACYD,e;;AAqCxB","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 {KeycloakService} from './keycloak-service/keycloak.service';\n\nimport {PageNav} from './PageNav';\nimport {PageHeaderTool} from './PageHeaderTool';\nimport {makeRoutes} from './ContentPages';\n\nimport {\n Brand,\n Page,\n PageHeader,\n PageSidebar\n} from '@patternfly/react-core';\n\nimport { KeycloakContext } from './keycloak-service/KeycloakContext';\n\ndeclare function toggleReact(): void;\ndeclare function isWelcomePage(): boolean;\ndeclare function loggedInUserName(): string;\n\ndeclare const brandImg: string;\ndeclare const brandUrl: string;\n\nexport interface AppProps {};\nexport class App extends React.Component<AppProps> {\n static contextType = KeycloakContext;\n context: React.ContextType<typeof KeycloakContext>;\n\n public constructor(props: AppProps, context: React.ContextType<typeof KeycloakContext>) {\n super(props);\n this.context = context;\n toggleReact();\n }\n\n public render(): React.ReactNode {\n toggleReact();\n\n // check login\n if (!this.context!.authenticated() && !isWelcomePage()) {\n this.context!.login();\n }\n\n const username = (\n <span style={{marginLeft: '10px'}} id=\"loggedInUser\">{loggedInUserName()}</span>\n );\n\n const Header = (\n <PageHeader\n logo={<a id=\"brandLink\" href={brandUrl}><Brand src={brandImg} alt=\"Logo\" className=\"brand\"/></a>}\n headerTools={<PageHeaderTool/>}\n showNavToggle\n />\n );\n\n const Sidebar = <PageSidebar nav={<PageNav/>} />;\n\n return (\n <Page header={Header} sidebar={Sidebar} isManagedSidebar>\n {makeRoutes()}\n </Page>\n );\n }\n};\n"],"file":"App.js"}
{"version":3,"file":"App.js","names":["React","PageNav","PageHeaderTool","makeRoutes","Brand","Page","PageHeader","PageSidebar","KeycloakContext","App","Component","constructor","props","context","_defineProperty","toggleReact","render","authenticated","isWelcomePage","login","Header","createElement","logo","id","href","brandUrl","src","brandImg","alt","className","headerTools","showNavToggle","Sidebar","nav","header","sidebar","isManagedSidebar"],"sources":["../src/app/App.tsx"],"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 {KeycloakService} from './keycloak-service/keycloak.service';\n\nimport {PageNav} from './PageNav';\nimport {PageHeaderTool} from './PageHeaderTool';\nimport {makeRoutes} from './ContentPages';\n\nimport {\n Brand,\n Page,\n PageHeader,\n PageSidebar\n} from '@patternfly/react-core';\n\nimport { KeycloakContext } from './keycloak-service/KeycloakContext';\n\ndeclare function toggleReact(): void;\ndeclare function isWelcomePage(): boolean;\n\ndeclare const brandImg: string;\ndeclare const brandUrl: string;\n\nexport interface AppProps {};\nexport class App extends React.Component<AppProps> {\n static contextType = KeycloakContext;\n context: React.ContextType<typeof KeycloakContext>;\n\n public constructor(props: AppProps, context: React.ContextType<typeof KeycloakContext>) {\n super(props);\n this.context = context;\n toggleReact();\n }\n\n public render(): React.ReactNode {\n toggleReact();\n\n // check login\n if (!this.context!.authenticated() && !isWelcomePage()) {\n this.context!.login();\n }\n\n const Header = (\n <PageHeader\n logo={<a id=\"brandLink\" href={brandUrl}><Brand src={brandImg} alt=\"Logo\" className=\"brand\"/></a>}\n headerTools={<PageHeaderTool/>}\n showNavToggle\n />\n );\n\n const Sidebar = <PageSidebar nav={<PageNav/>} />;\n\n return (\n <Page header={Header} sidebar={Sidebar} isManagedSidebar>\n {makeRoutes()}\n </Page>\n );\n }\n};\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK;AAIjB,SAAQC,OAAO;AACf,SAAQC,cAAc;AACtB,SAAQC,UAAU;AAElB,SACIC,KAAK,EACLC,IAAI,EACJC,UAAU,EACVC,WAAW;AAGf,SAASC,eAAe;AAQI;AAC5B,OAAO,MAAMC,GAAG,SAAST,KAAK,CAACU,SAAS,CAAW;EAIxCC,WAAWA,CAACC,KAAe,EAAEC,OAAkD,EAAE;IACpF,KAAK,CAACD,KAAK,CAAC;IAACE,eAAA;IACb,IAAI,CAACD,OAAO,GAAGA,OAAO;IACtBE,WAAW,CAAC,CAAC;EACjB;EAEOC,MAAMA,CAAA,EAAoB;IAC7BD,WAAW,CAAC,CAAC;;IAEb;IACA,IAAI,CAAC,IAAI,CAACF,OAAO,CAAEI,aAAa,CAAC,CAAC,IAAI,CAACC,aAAa,CAAC,CAAC,EAAE;MACpD,IAAI,CAACL,OAAO,CAAEM,KAAK,CAAC,CAAC;IACzB;IAEA,MAAMC,MAAM,gBACRpB,KAAA,CAAAqB,aAAA,CAACf,UAAU;MACPgB,IAAI,eAAEtB,KAAA,CAAAqB,aAAA;QAAGE,EAAE,EAAC,WAAW;QAACC,IAAI,EAAEC;MAAS,gBAACzB,KAAA,CAAAqB,aAAA,CAACjB,KAAK;QAACsB,GAAG,EAAEC,QAAS;QAACC,GAAG,EAAC,MAAM;QAACC,SAAS,EAAC;MAAO,CAAC,CAAI,CAAE;MACjGC,WAAW,eAAE9B,KAAA,CAAAqB,aAAA,CAACnB,cAAc,MAAC,CAAE;MAC/B6B,aAAa;IAAA,CAChB,CACJ;IAED,MAAMC,OAAO,gBAAGhC,KAAA,CAAAqB,aAAA,CAACd,WAAW;MAAC0B,GAAG,eAAEjC,KAAA,CAAAqB,aAAA,CAACpB,OAAO,MAAC;IAAE,CAAE,CAAC;IAEhD,oBACID,KAAA,CAAAqB,aAAA,CAAChB,IAAI;MAAC6B,MAAM,EAAEd,MAAO;MAACe,OAAO,EAAEH,OAAQ;MAACI,gBAAgB;IAAA,GACnDjC,UAAU,CAAC,CACV,CAAC;EAEf;AACJ;AAACW,eAAA,CAlCYL,GAAG,iBACSD,eAAe;AAiCvC"}
@@ -13,9 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../common/keycloak/web_modules/react.js";
import { Route, Switch } from "../../common/keycloak/web_modules/react-router-dom.js";
import { NavItem, NavExpandable } from "../../common/keycloak/web_modules/@patternfly/react-core.js";
import * as React from "../keycloak.v2/web_modules/react.js";
import { Route, Switch } from "../keycloak.v2/web_modules/react-router-dom.js";
import { NavItem, NavExpandable } from "../keycloak.v2/web_modules/@patternfly/react-core.js";
import { Msg } from "./widgets/Msg.js";
import { PageNotFound } from "./content/page-not-found/PageNotFound.js";
import { ForbiddenPage } from "./content/forbidden-page/ForbiddenPage.js";
@@ -26,29 +27,23 @@ export function isModulePageDef(item) {
export function isExpansion(contentItem) {
return contentItem.content !== undefined;
}
function groupId(group) {
return 'grp-' + group;
}
function itemId(group, item) {
return 'grp-' + group + '_itm-' + item;
}
function isChildOf(parent, child) {
for (var item of parent.content) {
if (isExpansion(item) && isChildOf(item, child)) return true;
if (parent.groupId === child.groupId) return true;
}
return false;
}
function createNavItems(activePage, contentParam, groupNum) {
if (typeof content === 'undefined') return /*#__PURE__*/React.createElement(React.Fragment, null);
const links = contentParam.map(item => {
const navLinkId = `nav-link-${item.id}`;
if (isExpansion(item)) {
return /*#__PURE__*/React.createElement(NavExpandable, {
id: navLinkId,
@@ -72,21 +67,17 @@ function createNavItems(activePage, contentParam, groupNum) {
});
return /*#__PURE__*/React.createElement(React.Fragment, null, links);
}
export function makeNavItems(activePage) {
console.log({
activePage
});
return createNavItems(activePage, content, 0);
}
function setIds(contentParam, groupNum) {
if (typeof contentParam === 'undefined') return groupNum;
let expansionGroupNum = groupNum;
for (let i = 0; i < contentParam.length; i++) {
const item = contentParam[i];
if (isExpansion(item)) {
item.itemId = itemId(groupNum, i);
expansionGroupNum = expansionGroupNum + 1;
@@ -98,21 +89,19 @@ function setIds(contentParam, groupNum) {
item.itemId = itemId(groupNum, i);
}
}
;
return expansionGroupNum;
}
export function initGroupAndItemIds() {
setIds(content, 0);
console.log({
content
});
} // get rid of Expansions and put all PageDef items into a single array
}
// get rid of Expansions and put all PageDef items into a single array
export function flattenContent(pageDefs) {
const flat = [];
for (let item of pageDefs) {
if (isExpansion(item)) {
flat.push(...flattenContent(item.content));
@@ -120,7 +109,6 @@ export function flattenContent(pageDefs) {
flat.push(item);
}
}
return flat;
}
export function makeRoutes() {
File diff suppressed because one or more lines are too long
@@ -13,9 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../common/keycloak/web_modules/react.js";
import * as ReactDOM from "../../common/keycloak/web_modules/react-dom.js";
import { HashRouter } from "../../common/keycloak/web_modules/react-router-dom.js";
import * as React from "../keycloak.v2/web_modules/react.js";
import * as ReactDOM from "../keycloak.v2/web_modules/react-dom.js";
import { HashRouter } from "../keycloak.v2/web_modules/react-router-dom.js";
import { App } from "./App.js";
import { flattenContent, initGroupAndItemIds, isExpansion, isModulePageDef } from "./ContentPages.js";
import { KeycloakService } from "./keycloak-service/keycloak.service.js";
@@ -26,12 +27,10 @@ export class Main extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
isReactLoading = false;
toggleReact();
}
render() {
const keycloakService = new KeycloakService(keycloak);
return /*#__PURE__*/React.createElement(HashRouter, null, /*#__PURE__*/React.createElement(KeycloakContext.Provider, {
@@ -40,21 +39,16 @@ export class Main extends React.Component {
value: new AccountServiceClient(keycloakService)
}, /*#__PURE__*/React.createElement(App, null))));
}
}
;
const e = React.createElement;
function removeHidden(items) {
const visible = [];
for (let item of items) {
if (item.hidden && eval(item.hidden)) continue;
if (isExpansion(item)) {
visible.push(item);
item.content = removeHidden(item.content);
if (item.content.length === 0) {
visible.pop(); // remove empty expansion
}
@@ -62,13 +56,10 @@ function removeHidden(items) {
visible.push(item);
}
}
return visible;
}
content = removeHidden(content);
initGroupAndItemIds();
function loadModule(modulePage) {
return new Promise((resolve, reject) => {
console.log('loading: ' + resourceUrl + modulePage.modulePath);
@@ -81,15 +72,15 @@ function loadModule(modulePage) {
});
});
}
;
const moduleLoaders = [];
flattenContent(content).forEach(item => {
if (isModulePageDef(item)) {
moduleLoaders.push(loadModule(item));
}
}); // load content modules and start
});
// load content modules and start
Promise.all(moduleLoaders).then(() => {
const domContainer = document.querySelector('#main_react_container');
ReactDOM.render(e(Main), domContainer);
File diff suppressed because one or more lines are too long
@@ -1,23 +1,27 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import * as React from "../../common/keycloak/web_modules/react.js";
import { PageHeaderTools } from "../../common/keycloak/web_modules/@patternfly/react-core.js";
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
import * as React from "../keycloak.v2/web_modules/react.js";
import { PageHeaderTools } from "../keycloak.v2/web_modules/@patternfly/react-core.js";
import { ReferrerLink } from "./widgets/ReferrerLink.js";
import { LogoutButton } from "./widgets/Logout.js";
export class PageHeaderTool extends React.Component {
constructor(...args) {
super(...args);
_defineProperty(this, "hasReferrer", typeof referrerName !== 'undefined');
}
render() {
const username = loggedInUserName();
return /*#__PURE__*/React.createElement(PageHeaderTools, null, this.hasReferrer && /*#__PURE__*/React.createElement("div", {
className: "pf-c-page__header-tools-group"
}, /*#__PURE__*/React.createElement(ReferrerLink, null)), /*#__PURE__*/React.createElement("div", {
className: "pf-c-page__header-tools-group"
}, /*#__PURE__*/React.createElement(LogoutButton, null)));
}, /*#__PURE__*/React.createElement(LogoutButton, null)), /*#__PURE__*/React.createElement("span", {
style: {
marginLeft: '10px'
},
id: "loggedInUser"
}, username));
}
}
//# sourceMappingURL=PageHeaderTool.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/app/PageHeaderTool.tsx"],"names":["React","PageHeaderTools","ReferrerLink","LogoutButton","PageHeaderTool","Component","referrerName","render","hasReferrer"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ;AAEA,SAAQC,eAAR;AACA,SAAQC,YAAR;AACA,SAAQC,YAAR;AAIA,OAAO,MAAMC,cAAN,SAA6BJ,KAAK,CAACK,SAAnC,CAA6C;AAAA;AAAA;;AAAA,yCACjB,OAAOC,YAAP,KAAwB,WADP;AAAA;;AAGzCC,EAAAA,MAAM,GAAoB;AAC7B,wBACI,oBAAC,eAAD,QACK,KAAKC,WAAL,iBACG;AAAK,MAAA,SAAS,EAAC;AAAf,oBACI,oBAAC,YAAD,OADJ,CAFR,eAOI;AAAK,MAAA,SAAS,EAAC;AAAf,oBACI,oBAAC,YAAD,OADJ,CAPJ,CADJ;AAaH;;AAjB+C","sourcesContent":["import * as React from 'react';\n\nimport {PageHeaderTools} from '@patternfly/react-core';\nimport {ReferrerLink} from './widgets/ReferrerLink';\nimport {LogoutButton} from './widgets/Logout';\n\ndeclare const referrerName: string;\n\nexport class PageHeaderTool extends React.Component {\n private hasReferrer: boolean = typeof referrerName !== 'undefined';\n\n public render(): React.ReactNode {\n return (\n <PageHeaderTools>\n {this.hasReferrer &&\n <div className=\"pf-c-page__header-tools-group\">\n <ReferrerLink/>\n </div>\n }\n\n <div className=\"pf-c-page__header-tools-group\">\n <LogoutButton/>\n </div>\n </PageHeaderTools>\n );\n }\n}\n"],"file":"PageHeaderTool.js"}
{"version":3,"file":"PageHeaderTool.js","names":["React","PageHeaderTools","ReferrerLink","LogoutButton","PageHeaderTool","Component","constructor","args","_defineProperty","referrerName","render","username","loggedInUserName","createElement","hasReferrer","className","style","marginLeft","id"],"sources":["../src/app/PageHeaderTool.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {PageHeaderTools} from '@patternfly/react-core';\nimport {ReferrerLink} from './widgets/ReferrerLink';\nimport {LogoutButton} from './widgets/Logout';\n\ndeclare const referrerName: string;\ndeclare function loggedInUserName(): string;\n\nexport class PageHeaderTool extends React.Component {\n private hasReferrer: boolean = typeof referrerName !== 'undefined';\n\n public render(): React.ReactNode {\n const username = loggedInUserName();\n \n return (\n <PageHeaderTools>\n {this.hasReferrer &&\n <div className=\"pf-c-page__header-tools-group\">\n <ReferrerLink/>\n </div>\n }\n\n <div className=\"pf-c-page__header-tools-group\">\n <LogoutButton/>\n </div>\n\n <span style={{marginLeft: '10px'}} id=\"loggedInUser\">{username}</span>\n </PageHeaderTools>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAO,KAAKA,KAAK;AAEjB,SAAQC,eAAe;AACvB,SAAQC,YAAY;AACpB,SAAQC,YAAY;AAKpB,OAAO,MAAMC,cAAc,SAASJ,KAAK,CAACK,SAAS,CAAC;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,sBACjB,OAAOC,YAAY,KAAK,WAAW;EAAA;EAE3DC,MAAMA,CAAA,EAAoB;IAC7B,MAAMC,QAAQ,GAAGC,gBAAgB,CAAC,CAAC;IAEnC,oBACIZ,KAAA,CAAAa,aAAA,CAACZ,eAAe,QACX,IAAI,CAACa,WAAW,iBACbd,KAAA,CAAAa,aAAA;MAAKE,SAAS,EAAC;IAA+B,gBAC1Cf,KAAA,CAAAa,aAAA,CAACX,YAAY,MAAC,CACb,CAAC,eAGVF,KAAA,CAAAa,aAAA;MAAKE,SAAS,EAAC;IAA+B,gBAC1Cf,KAAA,CAAAa,aAAA,CAACV,YAAY,MAAC,CACb,CAAC,eAENH,KAAA,CAAAa,aAAA;MAAMG,KAAK,EAAE;QAACC,UAAU,EAAE;MAAM,CAAE;MAACC,EAAE,EAAC;IAAc,GAAEP,QAAe,CACxD,CAAC;EAE1B;AACJ"}
@@ -13,39 +13,32 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../common/keycloak/web_modules/react.js";
import { withRouter } from "../../common/keycloak/web_modules/react-router-dom.js";
import { Nav, NavList } from "../../common/keycloak/web_modules/@patternfly/react-core.js";
import { makeNavItems, flattenContent } from "./ContentPages.js";
import * as React from "../keycloak.v2/web_modules/react.js";
import { withRouter } from "../keycloak.v2/web_modules/react-router-dom.js";
import { Nav, NavList } from "../keycloak.v2/web_modules/@patternfly/react-core.js";
import { makeNavItems, flattenContent } from "./ContentPages.js";
class PageNavigation extends React.Component {
constructor(props) {
super(props);
}
findActiveItem() {
const currentPath = this.props.location.pathname;
const items = flattenContent(content);
const firstItem = items[0];
for (let item of items) {
const itemPath = '/' + item.path;
if (itemPath === currentPath) {
return item;
}
}
;
return firstItem;
}
render() {
const activeItem = this.findActiveItem();
return /*#__PURE__*/React.createElement(Nav, null, /*#__PURE__*/React.createElement(NavList, null, makeNavItems(activeItem)));
}
}
export const PageNav = withRouter(PageNavigation);
//# sourceMappingURL=PageNav.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/app/PageNav.tsx"],"names":["React","withRouter","Nav","NavList","makeNavItems","flattenContent","PageNavigation","Component","constructor","props","findActiveItem","currentPath","location","pathname","items","content","firstItem","item","itemPath","path","render","activeItem","PageNav"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ;AACA,SAAQC,UAAR;AACA,SAAQC,GAAR,EAAaC,OAAb;AAEA,SAAQC,YAAR,EAAsBC,cAAtB;;AAQA,MAAMC,cAAN,SAA6BN,KAAK,CAACO,SAAnC,CAAyE;AAE9DC,EAAAA,WAAW,CAACC,KAAD,EAAsB;AACpC,UAAMA,KAAN;AACH;;AAEOC,EAAAA,cAAc,GAAY;AAC9B,UAAMC,WAAmB,GAAG,KAAKF,KAAL,CAAWG,QAAX,CAAoBC,QAAhD;AACA,UAAMC,KAAgB,GAAGT,cAAc,CAACU,OAAD,CAAvC;AACA,UAAMC,SAAS,GAAGF,KAAK,CAAC,CAAD,CAAvB;;AACA,SAAK,IAAIG,IAAT,IAAiBH,KAAjB,EAAwB;AACpB,YAAMI,QAAgB,GAAG,MAAMD,IAAI,CAACE,IAApC;;AACA,UAAID,QAAQ,KAAKP,WAAjB,EAA8B;AAC1B,eAAOM,IAAP;AACH;AACJ;;AAAA;AAED,WAAOD,SAAP;AACH;;AAEMI,EAAAA,MAAM,GAAoB;AAC7B,UAAMC,UAAmB,GAAG,KAAKX,cAAL,EAA5B;AACA,wBACI,oBAAC,GAAD,qBACI,oBAAC,OAAD,QACKN,YAAY,CAACiB,UAAD,CADjB,CADJ,CADJ;AAOH;;AA7BoE;;AAgCzE,OAAO,MAAMC,OAAO,GAAGrB,UAAU,CAACK,cAAD,CAA1B","sourcesContent":["/*\n * Copyright 2019 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';\nimport {withRouter, RouteComponentProps} from 'react-router-dom';\nimport {Nav, NavList} from '@patternfly/react-core';\n\nimport {makeNavItems, flattenContent, ContentItem, PageDef} from './ContentPages';\n\ndeclare const content: ContentItem[];\n\nexport interface PageNavProps extends RouteComponentProps {}\n\nexport interface PageNavState {}\n\nclass PageNavigation extends React.Component<PageNavProps, PageNavState> {\n\n public constructor(props: PageNavProps) {\n super(props);\n }\n\n private findActiveItem(): PageDef {\n const currentPath: string = this.props.location.pathname;\n const items: PageDef[] = flattenContent(content);\n const firstItem = items[0];\n for (let item of items) {\n const itemPath: string = '/' + item.path;\n if (itemPath === currentPath) {\n return item;\n }\n };\n\n return firstItem;\n }\n\n public render(): React.ReactNode {\n const activeItem: PageDef = this.findActiveItem();\n return (\n <Nav>\n <NavList>\n {makeNavItems(activeItem)}\n </NavList>\n </Nav>\n );\n }\n}\n\nexport const PageNav = withRouter(PageNavigation);\n"],"file":"PageNav.js"}
{"version":3,"file":"PageNav.js","names":["React","withRouter","Nav","NavList","makeNavItems","flattenContent","PageNavigation","Component","constructor","props","findActiveItem","currentPath","location","pathname","items","content","firstItem","item","itemPath","path","render","activeItem","createElement","PageNav"],"sources":["../src/app/PageNav.tsx"],"sourcesContent":["/*\n * Copyright 2019 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';\nimport {withRouter, RouteComponentProps} from 'react-router-dom';\nimport {Nav, NavList} from '@patternfly/react-core';\n\nimport {makeNavItems, flattenContent, ContentItem, PageDef} from './ContentPages';\n\ndeclare const content: ContentItem[];\n\nexport interface PageNavProps extends RouteComponentProps {}\n\nexport interface PageNavState {}\n\nclass PageNavigation extends React.Component<PageNavProps, PageNavState> {\n\n public constructor(props: PageNavProps) {\n super(props);\n }\n\n private findActiveItem(): PageDef {\n const currentPath: string = this.props.location.pathname;\n const items: PageDef[] = flattenContent(content);\n const firstItem = items[0];\n for (let item of items) {\n const itemPath: string = '/' + item.path;\n if (itemPath === currentPath) {\n return item;\n }\n };\n\n return firstItem;\n }\n\n public render(): React.ReactNode {\n const activeItem: PageDef = this.findActiveItem();\n return (\n <Nav>\n <NavList>\n {makeNavItems(activeItem)}\n </NavList>\n </Nav>\n );\n }\n}\n\nexport const PageNav = withRouter(PageNavigation);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK;AACjB,SAAQC,UAAU;AAClB,SAAQC,GAAG,EAAEC,OAAO;AAEpB,SAAQC,YAAY,EAAEC,cAAc;AAQpC,MAAMC,cAAc,SAASN,KAAK,CAACO,SAAS,CAA6B;EAE9DC,WAAWA,CAACC,KAAmB,EAAE;IACpC,KAAK,CAACA,KAAK,CAAC;EAChB;EAEQC,cAAcA,CAAA,EAAY;IAC9B,MAAMC,WAAmB,GAAG,IAAI,CAACF,KAAK,CAACG,QAAQ,CAACC,QAAQ;IACxD,MAAMC,KAAgB,GAAGT,cAAc,CAACU,OAAO,CAAC;IAChD,MAAMC,SAAS,GAAGF,KAAK,CAAC,CAAC,CAAC;IAC1B,KAAK,IAAIG,IAAI,IAAIH,KAAK,EAAE;MACpB,MAAMI,QAAgB,GAAG,GAAG,GAAGD,IAAI,CAACE,IAAI;MACxC,IAAID,QAAQ,KAAKP,WAAW,EAAE;QAC1B,OAAOM,IAAI;MACf;IACJ;IAAC;IAED,OAAOD,SAAS;EACpB;EAEOI,MAAMA,CAAA,EAAoB;IAC7B,MAAMC,UAAmB,GAAG,IAAI,CAACX,cAAc,CAAC,CAAC;IACjD,oBACIV,KAAA,CAAAsB,aAAA,CAACpB,GAAG,qBACAF,KAAA,CAAAsB,aAAA,CAACnB,OAAO,QACHC,YAAY,CAACiB,UAAU,CACnB,CACR,CAAC;EAEd;AACJ;AAEA,OAAO,MAAME,OAAO,GAAGtB,UAAU,CAACK,cAAc,CAAC"}
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
@@ -15,27 +16,24 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../common/keycloak/web_modules/react.js";
import { Toolbar, ToolbarGroup, ToolbarItem } from "../../common/keycloak/web_modules/@patternfly/react-core.js";
import * as React from "../keycloak.v2/web_modules/react.js";
import { Toolbar, ToolbarGroup, ToolbarItem } from "../keycloak.v2/web_modules/@patternfly/react-core.js";
import { ReferrerLink } from "./widgets/ReferrerLink.js";
import { LogoutButton } from "./widgets/Logout.js";
export class PageToolbar extends React.Component {
constructor(props) {
super(props);
_defineProperty(this, "hasReferrer", typeof referrerName !== 'undefined');
_defineProperty(this, "onKebabDropdownToggle", isKebabDropdownOpen => {
this.setState({
isKebabDropdownOpen
});
});
this.state = {
isKebabDropdownOpen: false
};
}
render() {
return /*#__PURE__*/React.createElement(Toolbar, null, this.hasReferrer && /*#__PURE__*/React.createElement(ToolbarGroup, {
key: "referrerGroup",
@@ -55,6 +53,5 @@ export class PageToolbar extends React.Component {
key: "logout"
}, /*#__PURE__*/React.createElement(LogoutButton, null))));
}
}
//# sourceMappingURL=PageToolbar.js.map
@@ -1 +1 @@
{"version":3,"sources":["../src/app/PageToolbar.tsx"],"names":["React","Toolbar","ToolbarGroup","ToolbarItem","ReferrerLink","LogoutButton","PageToolbar","Component","constructor","props","referrerName","isKebabDropdownOpen","setState","state","render","hasReferrer","default"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ;AAEA,SAA+BC,OAA/B,EAAwCC,YAAxC,EAAsDC,WAAtD;AAGA,SAAQC,YAAR;AAEA,SAAQC,YAAR;AAOA,OAAO,MAAMC,WAAN,SAA0BN,KAAK,CAACO,SAAhC,CAA8E;AAG1EC,EAAAA,WAAW,CAACC,KAAD,EAA0B;AACxC,UAAMA,KAAN;;AADwC,yCAFb,OAAOC,YAAP,KAAwB,WAEX;;AAAA,mDAQXC,mBAAD,IAAkC;AAC9D,WAAKC,QAAL,CAAc;AACVD,QAAAA;AADU,OAAd;AAGH,KAZ2C;;AAGxC,SAAKE,KAAL,GAAa;AACTF,MAAAA,mBAAmB,EAAE;AADZ,KAAb;AAGH;;AAQMG,EAAAA,MAAM,GAAoB;AAC7B,wBACI,oBAAC,OAAD,QACK,KAAKC,WAAL,iBACG,oBAAC,YAAD;AAAc,MAAA,GAAG,EAAC,eAAlB;AAAkC,MAAA,SAAS,EAAE;AAACC,QAAAA,OAAO,EAAC;AAAT;AAA7C,oBACI,oBAAC,WAAD;AAAa,MAAA,SAAS,EAAC,YAAvB;AAAoC,MAAA,GAAG,EAAC;AAAxC,oBACI,oBAAC,YAAD,OADJ,CADJ,CAFR,eASI,oBAAC,YAAD;AAAc,MAAA,GAAG,EAAC,aAAlB;AAAgC,MAAA,SAAS,EAAE;AAACA,QAAAA,OAAO,EAAC;AAAT;AAA3C,oBACI,oBAAC,WAAD;AAAa,MAAA,SAAS,EAAC,YAAvB;AAAoC,MAAA,GAAG,EAAC;AAAxC,oBACI,oBAAC,YAAD,OADJ,CADJ,CATJ,CADJ;AAiBH;;AAnCgF","sourcesContent":["/*\n * Copyright 2019 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 {Dropdown, KebabToggle, Toolbar, ToolbarGroup, ToolbarItem} from '@patternfly/react-core';\n\nimport {ReferrerDropdownItem} from './widgets/ReferrerDropdownItem';\nimport {ReferrerLink} from './widgets/ReferrerLink';\nimport {Features} from './widgets/features';\nimport {LogoutButton,LogoutDropdownItem} from './widgets/Logout';\n\ndeclare const referrerName: string;\ndeclare const features: Features;\n\ninterface PageToolbarProps {}\ninterface PageToolbarState {isKebabDropdownOpen: boolean}\nexport class PageToolbar extends React.Component<PageToolbarProps, PageToolbarState> {\n private hasReferrer: boolean = typeof referrerName !== 'undefined';\n\n public constructor(props: PageToolbarProps) {\n super(props);\n\n this.state = {\n isKebabDropdownOpen: false,\n };\n }\n\n private onKebabDropdownToggle = (isKebabDropdownOpen: boolean) => {\n this.setState({\n isKebabDropdownOpen\n });\n };\n\n public render(): React.ReactNode {\n return (\n <Toolbar>\n {this.hasReferrer &&\n <ToolbarGroup key='referrerGroup' alignment={{default:\"alignRight\"}}>\n <ToolbarItem className=\"pf-m-icons\" key='referrer'>\n <ReferrerLink/>\n </ToolbarItem>\n </ToolbarGroup>\n }\n\n <ToolbarGroup key='secondGroup' alignment={{default:\"alignRight\"}}>\n <ToolbarItem className=\"pf-m-icons\" key='logout'>\n <LogoutButton/>\n </ToolbarItem>\n </ToolbarGroup>\n </Toolbar>\n );\n }\n}\n"],"file":"PageToolbar.js"}
{"version":3,"file":"PageToolbar.js","names":["React","Toolbar","ToolbarGroup","ToolbarItem","ReferrerLink","LogoutButton","PageToolbar","Component","constructor","props","_defineProperty","referrerName","isKebabDropdownOpen","setState","state","render","createElement","hasReferrer","key","alignment","default","className"],"sources":["../src/app/PageToolbar.tsx"],"sourcesContent":["/*\n * Copyright 2019 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 {Dropdown, KebabToggle, Toolbar, ToolbarGroup, ToolbarItem} from '@patternfly/react-core';\n\nimport {ReferrerDropdownItem} from './widgets/ReferrerDropdownItem';\nimport {ReferrerLink} from './widgets/ReferrerLink';\nimport {Features} from './widgets/features';\nimport {LogoutButton,LogoutDropdownItem} from './widgets/Logout';\n\ndeclare const referrerName: string;\ndeclare const features: Features;\n\ninterface PageToolbarProps {}\ninterface PageToolbarState {isKebabDropdownOpen: boolean}\nexport class PageToolbar extends React.Component<PageToolbarProps, PageToolbarState> {\n private hasReferrer: boolean = typeof referrerName !== 'undefined';\n\n public constructor(props: PageToolbarProps) {\n super(props);\n\n this.state = {\n isKebabDropdownOpen: false,\n };\n }\n\n private onKebabDropdownToggle = (isKebabDropdownOpen: boolean) => {\n this.setState({\n isKebabDropdownOpen\n });\n };\n\n public render(): React.ReactNode {\n return (\n <Toolbar>\n {this.hasReferrer &&\n <ToolbarGroup key='referrerGroup' alignment={{default:\"alignRight\"}}>\n <ToolbarItem className=\"pf-m-icons\" key='referrer'>\n <ReferrerLink/>\n </ToolbarItem>\n </ToolbarGroup>\n }\n\n <ToolbarGroup key='secondGroup' alignment={{default:\"alignRight\"}}>\n <ToolbarItem className=\"pf-m-icons\" key='logout'>\n <LogoutButton/>\n </ToolbarItem>\n </ToolbarGroup>\n </Toolbar>\n );\n }\n}\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK;AAEjB,SAA+BC,OAAO,EAAEC,YAAY,EAAEC,WAAW;AAGjE,SAAQC,YAAY;AAEpB,SAAQC,YAAY;AAOpB,OAAO,MAAMC,WAAW,SAASN,KAAK,CAACO,SAAS,CAAqC;EAG1EC,WAAWA,CAACC,KAAuB,EAAE;IACxC,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,sBAHc,OAAOC,YAAY,KAAK,WAAW;IAAAD,eAAA,gCAUjCE,mBAA4B,IAAK;MAC9D,IAAI,CAACC,QAAQ,CAAC;QACVD;MACJ,CAAC,CAAC;IACN,CAAC;IATG,IAAI,CAACE,KAAK,GAAG;MACTF,mBAAmB,EAAE;IACzB,CAAC;EACL;EAQOG,MAAMA,CAAA,EAAoB;IAC7B,oBACIf,KAAA,CAAAgB,aAAA,CAACf,OAAO,QACH,IAAI,CAACgB,WAAW,iBACbjB,KAAA,CAAAgB,aAAA,CAACd,YAAY;MAACgB,GAAG,EAAC,eAAe;MAACC,SAAS,EAAE;QAACC,OAAO,EAAC;MAAY;IAAE,gBAChEpB,KAAA,CAAAgB,aAAA,CAACb,WAAW;MAACkB,SAAS,EAAC,YAAY;MAACH,GAAG,EAAC;IAAU,gBAC9ClB,KAAA,CAAAgB,aAAA,CAACZ,YAAY,MAAC,CACL,CACH,CAAC,eAGnBJ,KAAA,CAAAgB,aAAA,CAACd,YAAY;MAACgB,GAAG,EAAC,aAAa;MAACC,SAAS,EAAE;QAACC,OAAO,EAAC;MAAY;IAAE,gBAC9DpB,KAAA,CAAAgB,aAAA,CAACb,WAAW;MAACkB,SAAS,EAAC,YAAY;MAACH,GAAG,EAAC;IAAQ,gBAC5ClB,KAAA,CAAAgB,aAAA,CAACX,YAAY,MAAC,CACL,CACH,CACT,CAAC;EAElB;AACJ"}
@@ -1,3 +1,3 @@
import * as React from "../../../common/keycloak/web_modules/react.js";
import * as React from "../../keycloak.v2/web_modules/react.js";
export const AccountServiceContext = React.createContext(undefined);
//# sourceMappingURL=AccountServiceContext.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../src/app/account-service/AccountServiceContext.tsx"],"names":["React","AccountServiceContext","createContext","undefined"],"mappings":"AAAA,OAAO,KAAKA,KAAZ;AAGA,OAAO,MAAMC,qBAAqB,GAAGD,KAAK,CAACE,aAAN,CAAsDC,SAAtD,CAA9B","sourcesContent":["import * as React from 'react';\nimport { AccountServiceClient } from './account.service';\n\nexport const AccountServiceContext = React.createContext<AccountServiceClient | undefined>(undefined);"],"file":"AccountServiceContext.js"}
{"version":3,"file":"AccountServiceContext.js","names":["React","AccountServiceContext","createContext","undefined"],"sources":["../../src/app/account-service/AccountServiceContext.tsx"],"sourcesContent":["import * as React from 'react';\nimport { AccountServiceClient } from './account.service';\n\nexport const AccountServiceContext = React.createContext<AccountServiceClient | undefined>(undefined);"],"mappings":"AAAA,OAAO,KAAKA,KAAK;AAGjB,OAAO,MAAMC,qBAAqB,GAAGD,KAAK,CAACE,aAAa,CAAmCC,SAAS,CAAC"}
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2018 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @author tags. All rights reserved.
@@ -16,71 +17,64 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* License for the specific language governing permissions and limitations under
* the License.
*/
import { ContentAlert } from "../content/ContentAlert.js";
export class AccountServiceError extends Error {
constructor(response) {
super(response.statusText);
this.response = response;
}
}
/**
*
* @author Stan Silvert ssilvert@redhat.com (C) 2018 Red Hat Inc.
*/
export class AccountServiceClient {
constructor(keycloakService) {
_defineProperty(this, "kcSvc", void 0);
_defineProperty(this, "accountUrl", void 0);
this.kcSvc = keycloakService;
this.accountUrl = this.kcSvc.authServerUrl() + 'realms/' + this.kcSvc.realm() + '/account';
}
async doGet(endpoint, config) {
return this.doRequest(endpoint, { ...config,
return this.doRequest(endpoint, {
...config,
method: 'get'
});
}
async doDelete(endpoint, config) {
return this.doRequest(endpoint, { ...config,
return this.doRequest(endpoint, {
...config,
method: 'delete'
});
}
async doPost(endpoint, body, config) {
return this.doRequest(endpoint, { ...config,
return this.doRequest(endpoint, {
...config,
body: JSON.stringify(body),
method: 'post'
});
}
async doPut(endpoint, body, config) {
return this.doRequest(endpoint, { ...config,
return this.doRequest(endpoint, {
...config,
body: JSON.stringify(body),
method: 'put'
});
}
async doRequest(endpoint, config) {
const response = await fetch(this.makeUrl(endpoint, config).toString(), await this.makeConfig(config));
try {
response.data = await response.json();
} catch (e) {} // ignore. Might be empty
if (!response.ok) {
this.handleError(response);
throw new AccountServiceError(response);
}
return response;
}
handleError(response) {
if (response !== null && response.status === 401) {
if (this.kcSvc.authenticated() && !this.kcSvc.audiencePresent()) {
@@ -91,40 +85,36 @@ export class AccountServiceClient {
this.kcSvc.login();
}
}
if (response !== null && response.status === 403) {
window.location.href = baseUrl + '#/forbidden';
}
if (response !== null && response.data != null) {
if (response.data['errors'] != null) {
for (let err of response.data['errors']) ContentAlert.danger(err['errorMessage'], err['params']);
} else {
ContentAlert.danger(`${response.statusText}: ${response.data['errorMessage'] ? response.data['errorMessage'] : ''} ${response.data['error'] ? response.data['error'] : ''}`);
}
;
} else {
ContentAlert.danger(response.statusText);
}
}
makeUrl(endpoint, config) {
if (endpoint.startsWith('http')) return new URL(endpoint);
const url = new URL(this.accountUrl + endpoint); // add request params
const url = new URL(this.accountUrl + endpoint);
// add request params
if (config && config.hasOwnProperty('params')) {
const params = config.params || {};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
}
return url;
}
makeConfig(config = {}) {
return new Promise(resolve => {
this.kcSvc.getToken().then(token => {
resolve({ ...config,
resolve({
...config,
headers: {
'Content-Type': 'application/json',
...config.headers,
@@ -136,7 +126,6 @@ export class AccountServiceClient {
});
});
}
}
window.addEventListener("unhandledrejection", event => {
event.promise.catch(error => {
File diff suppressed because one or more lines are too long
@@ -47,6 +47,16 @@
"modulePath": "/content/applications-page/ApplicationsPage.js",
"componentName": "ApplicationsPage"
},
{
"id": "groups",
"path": "groups",
"icon": "pf-icon-server-group",
"label": "groupLabel",
"descriptionLabel": "groupDescriptionLabel",
"modulePath": "/content/group-page/GroupsPage.js",
"componentName": "GroupsPage",
"hidden": "!features.isViewGroupsEnabled"
},
{
"id": "resources",
"icon": "pf-icon-repository",
@@ -1,5 +1,7 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var _class;
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
@@ -15,21 +17,19 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../common/keycloak/web_modules/react.js";
import { Alert, AlertActionCloseButton, AlertGroup, AlertVariant } from "../../../common/keycloak/web_modules/@patternfly/react-core.js";
import * as React from "../../keycloak.v2/web_modules/react.js";
import { Alert, AlertActionCloseButton, AlertGroup, AlertVariant } from "../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { Msg } from "../widgets/Msg.js";
export class ContentAlert extends React.Component {
constructor(props) {
super(props);
_defineProperty(this, "hideAlert", key => {
this.setState({
alerts: [...this.state.alerts.filter(el => el.key !== key)]
});
});
_defineProperty(this, "getUniqueId", () => new Date().getTime());
_defineProperty(this, "postAlert", (variant, message, params) => {
const alerts = this.state.alerts;
const key = this.getUniqueId();
@@ -41,50 +41,43 @@ export class ContentAlert extends React.Component {
this.setState({
alerts
});
if (variant !== AlertVariant.danger) {
setTimeout(() => this.hideAlert(key), 8000);
}
});
this.state = {
alerts: []
};
ContentAlert.instance = this;
}
/**
* @param message A literal text message or localization key.
*/
static success(message, params) {
ContentAlert.instance.postAlert(AlertVariant.success, message, params);
}
/**
* @param message A literal text message or localization key.
*/
static danger(message, params) {
ContentAlert.instance.postAlert(AlertVariant.danger, message, params);
}
/**
* @param message A literal text message or localization key.
*/
static warning(message, params) {
ContentAlert.instance.postAlert(AlertVariant.warning, message, params);
}
/**
* @param message A literal text message or localization key.
*/
static info(message, params) {
ContentAlert.instance.postAlert(AlertVariant.info, message, params);
}
render() {
return /*#__PURE__*/React.createElement(AlertGroup, {
isToast: true,
@@ -106,8 +99,7 @@ export class ContentAlert extends React.Component {
key: key
})));
}
}
_class = ContentAlert;
_defineProperty(ContentAlert, "instance", void 0);
//# sourceMappingURL=ContentAlert.js.map
File diff suppressed because one or more lines are too long
@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../common/keycloak/web_modules/react.js";
import { Button, Text, Title, Tooltip, PageSection, TextContent, PageSectionVariants, SplitItem, Split } from "../../../common/keycloak/web_modules/@patternfly/react-core.js";
import { SyncAltIcon } from "../../../common/keycloak/web_modules/@patternfly/react-icons.js";
import * as React from "../../keycloak.v2/web_modules/react.js";
import { Button, Text, Title, Tooltip, PageSection, TextContent, PageSectionVariants, SplitItem, Split } from "../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { SyncAltIcon } from "../../keycloak.v2/web_modules/@patternfly/react-icons.js";
import { Msg } from "../widgets/Msg.js";
import { ContentAlert } from "./ContentAlert.js";
/**
* @author Stan Silvert ssilvert@redhat.com (C) 2019 Red Hat Inc.
*/
@@ -26,7 +26,6 @@ export class ContentPage extends React.Component {
constructor(props) {
super(props);
}
render() {
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ContentAlert, null), /*#__PURE__*/React.createElement(PageSection, {
variant: PageSectionVariants.light,
@@ -57,7 +56,6 @@ export class ContentPage extends React.Component {
msgKey: "refresh"
})))))), this.props.children);
}
}
;
//# sourceMappingURL=ContentPage.js.map
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
*
@@ -15,8 +16,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import { ActionGroup, Button, Form, FormGroup, TextInput, Grid, GridItem, ExpandableSection, ValidatedOptions, PageSection, PageSectionVariants, Text, TextVariants, TextContent } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { ActionGroup, Button, Form, FormGroup, TextInput, InputGroup, Grid, GridItem, ExpandableSection, ValidatedOptions, PageSection, PageSectionVariants, Text, TextVariants, TextContent } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { AccountServiceContext } from "../../account-service/AccountServiceContext.js";
import { Msg } from "../../widgets/Msg.js";
import { ContentPage } from "../ContentPage.js";
@@ -24,22 +25,19 @@ import { ContentAlert } from "../ContentAlert.js";
import { LocaleSelector } from "../../widgets/LocaleSelectors.js";
import { KeycloakContext } from "../../keycloak-service/KeycloakContext.js";
import { AIACommand } from "../../util/AIACommand.js";
import { ExternalLinkSquareAltIcon } from "../../../keycloak.v2/web_modules/@patternfly/react-icons.js";
/**
* @author Stan Silvert ssilvert@redhat.com (C) 2018 Red Hat Inc.
*/
export class AccountPage extends React.Component {
constructor(props, context) {
super(props);
_defineProperty(this, "context", void 0);
_defineProperty(this, "isRegistrationEmailAsUsername", features.isRegistrationEmailAsUsername);
_defineProperty(this, "isEditUserNameAllowed", features.isEditUserNameAllowed);
_defineProperty(this, "isDeleteAccountAllowed", features.deleteAccountAllowed);
_defineProperty(this, "isUpdateEmailFeatureEnabled", features.updateEmailFeatureEnabled);
_defineProperty(this, "isUpdateEmailActionEnabled", features.updateEmailActionEnabled);
_defineProperty(this, "DEFAULT_STATE", {
errors: {
username: '',
@@ -55,37 +53,34 @@ export class AccountPage extends React.Component {
attributes: {}
}
});
_defineProperty(this, "state", this.DEFAULT_STATE);
_defineProperty(this, "handleCancel", () => {
this.fetchPersonalInfo();
});
_defineProperty(this, "handleChange", (value, event) => {
const target = event.currentTarget;
const name = target.name;
this.setState({
errors: { ...this.state.errors,
errors: {
...this.state.errors,
[name]: target.validationMessage
},
formFields: { ...this.state.formFields,
formFields: {
...this.state.formFields,
[name]: value
}
});
});
_defineProperty(this, "handleSubmit", event => {
event.preventDefault();
const form = event.target;
const isValid = form.checkValidity();
if (isValid) {
const reqData = { ...this.state.formFields
const reqData = {
...this.state.formFields
};
this.context.doPost("/", reqData).then(() => {
ContentAlert.success('accountUpdatedMessage');
if (locale !== this.state.formFields.attributes.locale[0]) {
window.location.reload();
}
@@ -97,17 +92,19 @@ export class AccountPage extends React.Component {
return acc;
}, {});
this.setState({
errors: { ...validationMessages
errors: {
...validationMessages
},
formFields: this.state.formFields
});
}
});
_defineProperty(this, "handleDelete", keycloak => {
new AIACommand(keycloak, "delete_account").execute();
});
_defineProperty(this, "handleEmailUpdate", keycloak => {
new AIACommand(keycloak, "UPDATE_EMAIL").execute();
});
_defineProperty(this, "UsernameInput", () => /*#__PURE__*/React.createElement(TextInput, {
isRequired: true,
type: "text",
@@ -118,7 +115,6 @@ export class AccountPage extends React.Component {
onChange: this.handleChange,
validated: this.state.errors.username !== '' ? ValidatedOptions.error : ValidatedOptions.default
}));
_defineProperty(this, "RestrictedUsernameInput", () => /*#__PURE__*/React.createElement(TextInput, {
isReadOnly: true,
type: "text",
@@ -126,16 +122,13 @@ export class AccountPage extends React.Component {
name: "username",
value: this.state.formFields.username
}));
this.context = context;
this.fetchPersonalInfo();
}
fetchPersonalInfo() {
this.context.doGet("/").then(response => {
this.setState(this.DEFAULT_STATE);
const formFields = response.data;
if (!formFields.attributes) {
formFields.attributes = {
locale: [locale]
@@ -143,14 +136,13 @@ export class AccountPage extends React.Component {
} else if (!formFields.attributes.locale) {
formFields.attributes.locale = [locale];
}
this.setState({ ...{
this.setState({
...{
formFields: formFields
}
});
});
}
render() {
const fields = this.state.formFields;
return /*#__PURE__*/React.createElement(ContentPage, {
@@ -166,13 +158,13 @@ export class AccountPage extends React.Component {
}, Msg.localize('allFieldsRequired'))), /*#__PURE__*/React.createElement(Form, {
onSubmit: event => this.handleSubmit(event),
className: "personal-info-form"
}, !this.isRegistrationEmailAsUsername && /*#__PURE__*/React.createElement(FormGroup, {
}, !this.isRegistrationEmailAsUsername && fields.username != undefined && /*#__PURE__*/React.createElement(FormGroup, {
label: Msg.localize("username"),
fieldId: "user-name",
helperTextInvalid: this.state.errors.username,
validated: this.state.errors.username !== "" ? ValidatedOptions.error : ValidatedOptions.default
}, this.isEditUserNameAllowed && /*#__PURE__*/React.createElement(this.UsernameInput, null), !this.isEditUserNameAllowed && /*#__PURE__*/React.createElement(this.RestrictedUsernameInput, null)), /*#__PURE__*/React.createElement(FormGroup, {
label: Msg.localize("email"),
}, this.isEditUserNameAllowed && /*#__PURE__*/React.createElement(this.UsernameInput, null), !this.isEditUserNameAllowed && /*#__PURE__*/React.createElement(this.RestrictedUsernameInput, null)), !this.isUpdateEmailFeatureEnabled && /*#__PURE__*/React.createElement(FormGroup, {
label: Msg.localize('email'),
fieldId: "email-address",
helperTextInvalid: this.state.errors.email,
validated: this.state.errors.email !== "" ? ValidatedOptions.error : ValidatedOptions.default
@@ -185,7 +177,24 @@ export class AccountPage extends React.Component {
value: fields.email,
onChange: this.handleChange,
validated: this.state.errors.email !== "" ? ValidatedOptions.error : ValidatedOptions.default
})), /*#__PURE__*/React.createElement(FormGroup, {
})), this.isUpdateEmailFeatureEnabled && /*#__PURE__*/React.createElement(FormGroup, {
label: Msg.localize('email'),
fieldId: "email-address"
}, /*#__PURE__*/React.createElement(InputGroup, null, /*#__PURE__*/React.createElement(TextInput, {
isDisabled: true,
type: "email",
id: "email-address",
name: "email",
value: fields.email
}), this.isUpdateEmailActionEnabled && (!this.isRegistrationEmailAsUsername || this.isEditUserNameAllowed) && /*#__PURE__*/React.createElement(KeycloakContext.Consumer, null, keycloak => /*#__PURE__*/React.createElement(Button, {
id: "update-email-btn",
variant: "link",
onClick: () => this.handleEmailUpdate(keycloak),
icon: /*#__PURE__*/React.createElement(ExternalLinkSquareAltIcon, null),
iconPosition: "right"
}, /*#__PURE__*/React.createElement(Msg, {
msgKey: "updateEmail"
}))))), /*#__PURE__*/React.createElement(FormGroup, {
label: Msg.localize("firstName"),
fieldId: "first-name",
helperTextInvalid: this.state.errors.firstName,
@@ -222,8 +231,10 @@ export class AccountPage extends React.Component {
value: fields.attributes.locale || "",
onChange: value => this.setState({
errors: this.state.errors,
formFields: { ...this.state.formFields,
attributes: { ...this.state.formFields.attributes,
formFields: {
...this.state.formFields,
attributes: {
...this.state.formFields.attributes,
locale: [value]
}
}
@@ -247,7 +258,7 @@ export class AccountPage extends React.Component {
marginTop: "30px"
}
}, /*#__PURE__*/React.createElement(ExpandableSection, {
toggleText: "Delete Account"
toggleText: Msg.localize("deleteAccount")
}, /*#__PURE__*/React.createElement(Grid, {
hasGutter: true
}, /*#__PURE__*/React.createElement(GridItem, {
@@ -267,10 +278,7 @@ export class AccountPage extends React.Component {
span: 2
}))))));
}
}
_defineProperty(AccountPage, "contextType", AccountServiceContext);
;
//# sourceMappingURL=AccountPage.js.map
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
@@ -15,30 +16,33 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import { withRouter } from "../../../../common/keycloak/web_modules/react-router-dom.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { withRouter } from "../../../keycloak.v2/web_modules/react-router-dom.js";
import { AIACommand } from "../../util/AIACommand.js";
import { Msg } from "../../widgets/Msg.js";
import { Title, Button, EmptyState, EmptyStateVariant, EmptyStateIcon, EmptyStateBody, TitleSizes } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js";
import { PassportIcon } from "../../../../common/keycloak/web_modules/@patternfly/react-icons.js";
import { KeycloakContext } from "../../keycloak-service/KeycloakContext.js"; // Note: This class demonstrates two features of the ContentPages framework:
import { Title, Button, EmptyState, EmptyStateVariant, EmptyStateIcon, EmptyStateBody, TitleSizes } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { PassportIcon } from "../../../keycloak.v2/web_modules/@patternfly/react-icons.js";
import { KeycloakContext } from "../../keycloak-service/KeycloakContext.js";
// Note: This class demonstrates two features of the ContentPages framework:
// 1) The PageDef is available as a React property.
// 2) You can add additional custom properties to the PageDef. In this case,
// we add a value called kcAction in content.js and access it by extending the
// PageDef interface.
// Extend RouteComponentProps to get access to router information such as
// the hash-routed path associated with this page. See this.props.location.pathname
// as used below.
/**
* @author Stan Silvert
*/
class ApplicationInitiatedActionPage extends React.Component {
constructor(props) {
super(props);
_defineProperty(this, "handleClick", keycloak => {
new AIACommand(keycloak, this.props.pageDef.kcAction).execute();
});
}
render() {
return /*#__PURE__*/React.createElement(EmptyState, {
variant: EmptyStateVariant.full
@@ -60,11 +64,10 @@ class ApplicationInitiatedActionPage extends React.Component {
msgKey: "continue"
}))));
}
}
;
; // Note that the class name is not exported above. To get access to the router,
// Note that the class name is not exported above. To get access to the router,
// we use withRouter() and export a different name.
export const AppInitiatedActionPage = withRouter(ApplicationInitiatedActionPage);
//# sourceMappingURL=AppInitiatedActionPage.js.map
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
*
@@ -15,9 +16,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import { DataList, DataListItem, DataListItemRow, DataListCell, DataListToggle, DataListContent, DataListItemCells, DescriptionList, DescriptionListTerm, DescriptionListGroup, DescriptionListDescription, Grid, GridItem, Button, PageSection, PageSectionVariants, Stack } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js";
import { InfoAltIcon, CheckIcon, ExternalLinkAltIcon } from "../../../../common/keycloak/web_modules/@patternfly/react-icons.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { DataList, DataListItem, DataListItemRow, DataListCell, DataListToggle, DataListContent, DataListItemCells, DescriptionList, DescriptionListTerm, DescriptionListGroup, DescriptionListDescription, Grid, GridItem, Button, PageSection, PageSectionVariants, Stack } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { InfoAltIcon, CheckIcon, ExternalLinkAltIcon } from "../../../keycloak.v2/web_modules/@patternfly/react-icons.js";
import { ContentPage } from "../ContentPage.js";
import { ContinueCancelModal } from "../../widgets/ContinueCancelModal.js";
import { AccountServiceContext } from "../../account-service/AccountServiceContext.js";
@@ -25,15 +27,12 @@ import { Msg } from "../../widgets/Msg.js";
export class ApplicationsPage extends React.Component {
constructor(props, context) {
super(props);
_defineProperty(this, "context", void 0);
_defineProperty(this, "removeConsent", clientId => {
this.context.doDelete("/applications/" + clientId + "/consent").then(() => {
this.context.doDelete("/applications/" + encodeURIComponent(clientId) + "/consent").then(() => {
this.fetchApplications();
});
});
_defineProperty(this, "onToggle", row => {
const newIsRowOpen = this.state.isRowOpen;
newIsRowOpen[row] = !newIsRowOpen[row];
@@ -41,7 +40,6 @@ export class ApplicationsPage extends React.Component {
isRowOpen: newIsRowOpen
});
});
this.context = context;
this.state = {
isRowOpen: [],
@@ -49,7 +47,6 @@ export class ApplicationsPage extends React.Component {
};
this.fetchApplications();
}
fetchApplications() {
this.context.doGet("/applications").then(response => {
const applications = response.data || [];
@@ -59,15 +56,13 @@ export class ApplicationsPage extends React.Component {
});
});
}
elementId(item, application) {
return `application-${item}-${application.clientId}`;
}
render() {
return /*#__PURE__*/React.createElement(ContentPage, {
title: Msg.localize('applicationsPageTitle'),
introMessage: "Manage your application permissions."
introMessage: Msg.localize('applicationsPageSubTitle')
}, /*#__PURE__*/React.createElement(PageSection, {
isFilled: true,
variant: PageSectionVariants.light
@@ -147,11 +142,15 @@ export class ApplicationsPage extends React.Component {
"aria-label": Msg.localize('applicationDetails'),
id: this.elementId("expandable", application),
isHidden: !this.state.isRowOpen[appIndex]
}, /*#__PURE__*/React.createElement(DescriptionList, null, /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('client')), /*#__PURE__*/React.createElement(DescriptionListDescription, null, application.clientId)), application.description && /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('description')), /*#__PURE__*/React.createElement(DescriptionListDescription, null, application.description)), application.effectiveUrl && /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, "URL"), /*#__PURE__*/React.createElement(DescriptionListDescription, null, application.effectiveUrl.split('"'))), application.consent && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, "Has access to"), application.consent.grantedScopes.map((scope, scopeIndex) => {
}, /*#__PURE__*/React.createElement(DescriptionList, null, /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('client')), /*#__PURE__*/React.createElement(DescriptionListDescription, null, application.clientId)), application.description && /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('description')), /*#__PURE__*/React.createElement(DescriptionListDescription, null, application.description)), application.effectiveUrl && /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, "URL"), /*#__PURE__*/React.createElement(DescriptionListDescription, {
id: this.elementId("effectiveurl", application)
}, application.effectiveUrl.split('"'))), application.consent && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, "Has access to"), application.consent.grantedScopes.map((scope, scopeIndex) => {
return /*#__PURE__*/React.createElement(React.Fragment, {
key: 'scope-' + scopeIndex
}, /*#__PURE__*/React.createElement(DescriptionListDescription, null, /*#__PURE__*/React.createElement(CheckIcon, null), " ", scope.name));
})), /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('accessGrantedOn') + ': '), /*#__PURE__*/React.createElement(DescriptionListDescription, null, new Intl.DateTimeFormat(locale, {
}, /*#__PURE__*/React.createElement(DescriptionListDescription, null, /*#__PURE__*/React.createElement(CheckIcon, null), Msg.localize(scope.name)));
})), application.tosUri && /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('termsOfService')), /*#__PURE__*/React.createElement(DescriptionListDescription, null, application.tosUri)), application.policyUri && /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('policy')), /*#__PURE__*/React.createElement(DescriptionListDescription, null, application.policyUri)), application.logoUri && /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('logo')), /*#__PURE__*/React.createElement(DescriptionListDescription, null, /*#__PURE__*/React.createElement("img", {
src: application.logoUri
}))), /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('accessGrantedOn') + ': '), /*#__PURE__*/React.createElement(DescriptionListDescription, null, new Intl.DateTimeFormat(locale, {
year: 'numeric',
month: 'long',
day: 'numeric',
@@ -171,14 +170,10 @@ export class ApplicationsPage extends React.Component {
modalContinueButtonLabel: Msg.localize('confirmButton') // defaults to 'Continue'
,
onContinue: () => this.removeConsent(application.clientId) // required
}))), /*#__PURE__*/React.createElement(GridItem, null, /*#__PURE__*/React.createElement(InfoAltIcon, null), " ", Msg.localize('infoMessage')))));
})))));
}
}
_defineProperty(ApplicationsPage, "contextType", AccountServiceContext);
;
//# sourceMappingURL=ApplicationsPage.js.map
File diff suppressed because one or more lines are too long
@@ -13,16 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
export class AuthenticatorPage extends React.Component {
constructor(props) {
super(props);
}
render() {
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h2", null, "Hello Authenticator Page"));
}
}
;
//# sourceMappingURL=AuthenticatorPage.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../../src/app/content/authenticator-page/AuthenticatorPage.tsx"],"names":["React","AuthenticatorPage","Component","constructor","props","render"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ;AAKA,OAAO,MAAMC,iBAAN,SAAgCD,KAAK,CAACE,SAAtC,CAAwE;AAEpEC,EAAAA,WAAW,CAACC,KAAD,EAAgC;AAC9C,UAAMA,KAAN;AACH;;AAEMC,EAAAA,MAAM,GAAoB;AAC7B,wBACI,8CACE,2DADF,CADJ;AAKH;;AAZ0E;AAa9E","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 \nexport interface AuthenticatorPageProps {\n}\n \nexport class AuthenticatorPage extends React.Component<AuthenticatorPageProps> {\n \n public constructor(props: AuthenticatorPageProps) {\n super(props);\n }\n\n public render(): React.ReactNode {\n return (\n <div>\n <h2>Hello Authenticator Page</h2>\n </div>\n );\n }\n};"],"file":"AuthenticatorPage.js"}
{"version":3,"file":"AuthenticatorPage.js","names":["React","AuthenticatorPage","Component","constructor","props","render","createElement"],"sources":["../../../src/app/content/authenticator-page/AuthenticatorPage.tsx"],"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 \nexport interface AuthenticatorPageProps {\n}\n \nexport class AuthenticatorPage extends React.Component<AuthenticatorPageProps> {\n \n public constructor(props: AuthenticatorPageProps) {\n super(props);\n }\n\n public render(): React.ReactNode {\n return (\n <div>\n <h2>Hello Authenticator Page</h2>\n </div>\n );\n }\n};"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK;AAKjB,OAAO,MAAMC,iBAAiB,SAASD,KAAK,CAACE,SAAS,CAAyB;EAEpEC,WAAWA,CAACC,KAA6B,EAAE;IAC9C,KAAK,CAACA,KAAK,CAAC;EAChB;EAEOC,MAAMA,CAAA,EAAoB;IAC7B,oBACIL,KAAA,CAAAM,aAAA,2BACEN,KAAA,CAAAM,aAAA,aAAI,0BAA4B,CAC7B,CAAC;EAEd;AACJ;AAAC"}
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
*
@@ -15,46 +16,41 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { AccountServiceContext } from "../../account-service/AccountServiceContext.js";
import TimeUtil from "../../util/TimeUtil.js";
import { Button, DataList, DataListItem, DataListItemRow, DataListContent, DescriptionList, DescriptionListTerm, DescriptionListDescription, DescriptionListGroup, Grid, GridItem, Label, PageSection, PageSectionVariants, Title, Tooltip, SplitItem, Split } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js";
import { DesktopIcon, MobileAltIcon, SyncAltIcon } from "../../../../common/keycloak/web_modules/@patternfly/react-icons.js";
import { Button, DataList, DataListItem, DataListItemRow, DataListContent, DescriptionList, DescriptionListTerm, DescriptionListDescription, DescriptionListGroup, Grid, GridItem, Label, PageSection, PageSectionVariants, Title, Tooltip, SplitItem, Split } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { DesktopIcon, MobileAltIcon, SyncAltIcon } from "../../../keycloak.v2/web_modules/@patternfly/react-icons.js";
import { Msg } from "../../widgets/Msg.js";
import { ContinueCancelModal } from "../../widgets/ContinueCancelModal.js";
import { KeycloakContext } from "../../keycloak-service/KeycloakContext.js";
import { ContentPage } from "../ContentPage.js";
import { ContentAlert } from "../ContentAlert.js";
/**
* @author Stan Silvert ssilvert@redhat.com (C) 2019 Red Hat Inc.
*/
export class DeviceActivityPage extends React.Component {
constructor(props, context) {
super(props);
_defineProperty(this, "context", void 0);
_defineProperty(this, "signOutAll", keycloakService => {
this.context.doDelete("/sessions").then(() => {
keycloakService.logout();
});
});
_defineProperty(this, "signOutSession", (device, session) => {
this.context.doDelete("/sessions/" + session.id).then(() => {
this.context.doDelete("/sessions/" + encodeURIComponent(session.id)).then(() => {
this.fetchDevices();
ContentAlert.success('signedOutSession', [session.browser, device.os]);
});
});
this.context = context;
this.state = {
devices: []
};
this.fetchDevices();
}
fetchDevices() {
this.context.doGet("/sessions/devices").then(response => {
console.log({
@@ -65,9 +61,9 @@ export class DeviceActivityPage extends React.Component {
devices: devices
});
});
} // current device and session should display at the top of their respective lists
}
// current device and session should display at the top of their respective lists
moveCurrentToTop(devices) {
let currentDevice = devices[0];
devices.forEach((device, index) => {
@@ -85,15 +81,12 @@ export class DeviceActivityPage extends React.Component {
});
return devices;
}
time(time) {
return TimeUtil.format(time * 1000);
}
elementId(item, session, element = 'session') {
return `${element}-${session.id.substring(0, 7)}-${item}`;
}
findDeviceTypeIcon(session, device) {
const deviceType = device.mobile;
if (deviceType === true) return /*#__PURE__*/React.createElement(MobileAltIcon, {
@@ -103,41 +96,34 @@ export class DeviceActivityPage extends React.Component {
id: this.elementId('icon-desktop', session, 'device')
});
}
findOS(device) {
if (device.os.toLowerCase().includes('unknown')) return Msg.localize('unknownOperatingSystem');
return device.os;
}
findOSVersion(device) {
if (device.osVersion.toLowerCase().includes('unknown')) return '';
return device.osVersion;
}
makeClientsString(clients) {
let clientsString = "";
clients.forEach((client, index) => {
let clientName;
if (client.hasOwnProperty('clientName') && client.clientName !== undefined && client.clientName !== '') {
clientName = Msg.localize(client.clientName);
} else {
clientName = client.clientId;
}
clientsString += clientName;
if (clients.length > index + 1) clientsString += ', ';
});
return clientsString;
}
isShowSignOutAll(devices) {
if (devices.length === 0) return false;
if (devices.length > 1) return true;
if (devices[0].sessions.length > 1) return true;
return false;
}
render() {
return /*#__PURE__*/React.createElement(ContentPage, {
title: "device-activity",
@@ -168,7 +154,9 @@ export class DeviceActivityPage extends React.Component {
variant: "link",
onClick: this.fetchDevices.bind(this),
icon: /*#__PURE__*/React.createElement(SyncAltIcon, null)
}, "Refresh"))), /*#__PURE__*/React.createElement(SplitItem, null, /*#__PURE__*/React.createElement(KeycloakContext.Consumer, null, keycloak => this.isShowSignOutAll(this.state.devices) && /*#__PURE__*/React.createElement(ContinueCancelModal, {
}, /*#__PURE__*/React.createElement(Msg, {
msgKey: "refresh"
})))), /*#__PURE__*/React.createElement(SplitItem, null, /*#__PURE__*/React.createElement(KeycloakContext.Consumer, null, keycloak => this.isShowSignOutAll(this.state.devices) && /*#__PURE__*/React.createElement(ContinueCancelModal, {
buttonTitle: "signOutAllDevices",
buttonId: "sign-out-all",
modalTitle: "signOutAllDevices",
@@ -189,6 +177,7 @@ export class DeviceActivityPage extends React.Component {
isHidden: false,
className: "pf-u-flex-grow-1"
}, /*#__PURE__*/React.createElement(Grid, {
id: this.elementId("item", session),
className: "signed-in-device-grid",
hasGutter: true
}, /*#__PURE__*/React.createElement(GridItem, {
@@ -201,9 +190,10 @@ export class DeviceActivityPage extends React.Component {
span: 10
}, /*#__PURE__*/React.createElement("span", {
id: this.elementId('browser', session),
className: "pf-u-mr-md"
className: "pf-u-mr-md session-title"
}, this.findOS(device), " ", this.findOSVersion(device), " / ", session.browser), session.current && /*#__PURE__*/React.createElement(Label, {
color: "green"
color: "green",
id: this.elementId('current-badge', session)
}, /*#__PURE__*/React.createElement(Msg, {
msgKey: "currentSession"
}))), /*#__PURE__*/React.createElement(GridItem, {
@@ -225,14 +215,21 @@ export class DeviceActivityPage extends React.Component {
sm: '2Col',
lg: '3Col'
}
}, /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('ipAddress')), /*#__PURE__*/React.createElement(DescriptionListDescription, null, session.ipAddress)), /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('lastAccessedOn')), /*#__PURE__*/React.createElement(DescriptionListDescription, null, this.time(session.lastAccess))), /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('clients')), /*#__PURE__*/React.createElement(DescriptionListDescription, null, this.makeClientsString(session.clients))), /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('started')), /*#__PURE__*/React.createElement(DescriptionListDescription, null, this.time(session.started))), /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('expires')), /*#__PURE__*/React.createElement(DescriptionListDescription, null, this.time(session.expires)))))))));
}, /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('ipAddress')), /*#__PURE__*/React.createElement(DescriptionListDescription, {
id: this.elementId('ip', session)
}, session.ipAddress)), /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('lastAccessedOn')), /*#__PURE__*/React.createElement(DescriptionListDescription, {
id: this.elementId('last-access', session)
}, this.time(session.lastAccess))), /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('clients')), /*#__PURE__*/React.createElement(DescriptionListDescription, {
id: this.elementId('clients', session)
}, this.makeClientsString(session.clients))), /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('started')), /*#__PURE__*/React.createElement(DescriptionListDescription, {
id: this.elementId('started', session)
}, this.time(session.started))), /*#__PURE__*/React.createElement(DescriptionListGroup, null, /*#__PURE__*/React.createElement(DescriptionListTerm, null, Msg.localize('expires')), /*#__PURE__*/React.createElement(DescriptionListDescription, {
id: this.elementId('expires', session)
}, this.time(session.expires)))))))));
}));
})))));
}
}
_defineProperty(DeviceActivityPage, "contextType", AccountServiceContext);
;
//# sourceMappingURL=DeviceActivityPage.js.map
File diff suppressed because one or more lines are too long
@@ -13,15 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import { WarningTriangleIcon } from "../../../../common/keycloak/web_modules/@patternfly/react-icons.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { WarningTriangleIcon } from "../../../keycloak.v2/web_modules/@patternfly/react-icons.js";
import { Msg } from "../../widgets/Msg.js";
import EmptyMessageState from "../../widgets/EmptyMessageState.js";
export class ForbiddenPage extends React.Component {
constructor() {
super({});
}
render() {
return /*#__PURE__*/React.createElement(EmptyMessageState, {
icon: WarningTriangleIcon,
@@ -30,7 +29,6 @@ export class ForbiddenPage extends React.Component {
msgKey: "needAccessRights"
}));
}
}
;
//# sourceMappingURL=ForbiddenPage.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../../src/app/content/forbidden-page/ForbiddenPage.tsx"],"names":["React","WarningTriangleIcon","Msg","EmptyMessageState","ForbiddenPage","Component","constructor","render"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,KAAZ;AAEA,SAASC,mBAAT;AACA,SAAQC,GAAR;AACA,OAAOC,iBAAP;AAGA,OAAO,MAAMC,aAAN,SAA4BJ,KAAK,CAACK,SAAlC,CAA4C;AAExCC,EAAAA,WAAW,GAAG;AACjB,UAAM,EAAN;AACH;;AAEMC,EAAAA,MAAM,GAAoB;AAC7B,wBACI,oBAAC,iBAAD;AAAmB,MAAA,IAAI,EAAEN,mBAAzB;AAA8C,MAAA,UAAU,EAAC;AAAzD,oBACI,oBAAC,GAAD;AAAK,MAAA,MAAM,EAAC;AAAZ,MADJ,CADJ;AAKH;;AAZ8C;AAalD","sourcesContent":["/*\n * Copyright 2020 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 */\nimport * as React from 'react';\n\nimport { WarningTriangleIcon } from '@patternfly/react-icons';\nimport {Msg} from '../../widgets/Msg';\nimport EmptyMessageState from '../../widgets/EmptyMessageState';\n\n\nexport class ForbiddenPage extends React.Component {\n\n public constructor() {\n super({});\n }\n\n public render(): React.ReactNode {\n return (\n <EmptyMessageState icon={WarningTriangleIcon} messageKey=\"forbidden\">\n <Msg msgKey=\"needAccessRights\"/>\n </EmptyMessageState>\n );\n }\n};\n"],"file":"ForbiddenPage.js"}
{"version":3,"file":"ForbiddenPage.js","names":["React","WarningTriangleIcon","Msg","EmptyMessageState","ForbiddenPage","Component","constructor","render","createElement","icon","messageKey","msgKey"],"sources":["../../../src/app/content/forbidden-page/ForbiddenPage.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 */\nimport * as React from 'react';\n\nimport { WarningTriangleIcon } from '@patternfly/react-icons';\nimport {Msg} from '../../widgets/Msg';\nimport EmptyMessageState from '../../widgets/EmptyMessageState';\n\n\nexport class ForbiddenPage extends React.Component {\n\n public constructor() {\n super({});\n }\n\n public render(): React.ReactNode {\n return (\n <EmptyMessageState icon={WarningTriangleIcon} messageKey=\"forbidden\">\n <Msg msgKey=\"needAccessRights\"/>\n </EmptyMessageState>\n );\n }\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,KAAK;AAEjB,SAASC,mBAAmB;AAC5B,SAAQC,GAAG;AACX,OAAOC,iBAAiB;AAGxB,OAAO,MAAMC,aAAa,SAASJ,KAAK,CAACK,SAAS,CAAC;EAExCC,WAAWA,CAAA,EAAG;IACjB,KAAK,CAAC,CAAC,CAAC,CAAC;EACb;EAEOC,MAAMA,CAAA,EAAoB;IAC7B,oBACIP,KAAA,CAAAQ,aAAA,CAACL,iBAAiB;MAACM,IAAI,EAAER,mBAAoB;MAACS,UAAU,EAAC;IAAW,gBAChEV,KAAA,CAAAQ,aAAA,CAACN,GAAG;MAACS,MAAM,EAAC;IAAkB,CAAC,CAChB,CAAC;EAE5B;AACJ;AAAC"}
@@ -0,0 +1,133 @@
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { Checkbox, DataList, DataListItem, DataListItemRow, DataListCell, DataListItemCells } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { ContentPage } from "../ContentPage.js";
import { AccountServiceContext } from "../../account-service/AccountServiceContext.js";
import { Msg } from "../../widgets/Msg.js";
export class GroupsPage extends React.Component {
constructor(props, context) {
super(props);
_defineProperty(this, "context", void 0);
_defineProperty(this, "changeDirectMembership", (checked, event) => {
this.setState({
isDirectMembership: checked
});
});
this.context = context;
this.state = {
groups: [],
directGroups: [],
isDirectMembership: false
};
this.fetchGroups();
}
fetchGroups() {
this.context.doGet("/groups").then(response => {
const directGroups = response.data || [];
const groups = [...directGroups];
const groupsPaths = directGroups.map(s => s.path);
directGroups.forEach(el => this.getParents(el, groups, groupsPaths));
this.setState({
groups: groups,
directGroups: directGroups
});
});
}
getParents(el, groups, groupsPaths) {
const parentPath = el.path.slice(0, el.path.lastIndexOf('/'));
if (parentPath && groupsPaths.indexOf(parentPath) === -1) {
el = {
name: parentPath.slice(parentPath.lastIndexOf('/') + 1),
path: parentPath
};
groups.push(el);
groupsPaths.push(parentPath);
this.getParents(el, groups, groupsPaths);
}
}
emptyGroup() {
return /*#__PURE__*/React.createElement(DataListItem, {
key: "emptyItem",
"aria-labelledby": "empty-item"
}, /*#__PURE__*/React.createElement(DataListItemRow, {
key: "emptyRow"
}, /*#__PURE__*/React.createElement(DataListItemCells, {
dataListCells: [/*#__PURE__*/React.createElement(DataListCell, {
key: "empty"
}, /*#__PURE__*/React.createElement("strong", null, /*#__PURE__*/React.createElement(Msg, {
msgKey: "noGroupsText"
})))]
})));
}
renderGroupList(group, appIndex) {
return /*#__PURE__*/React.createElement(DataListItem, {
id: `${appIndex}-group`,
key: 'group-' + appIndex,
"aria-labelledby": "groups-list"
}, /*#__PURE__*/React.createElement(DataListItemRow, null, /*#__PURE__*/React.createElement(DataListItemCells, {
dataListCells: [/*#__PURE__*/React.createElement(DataListCell, {
id: `${appIndex}-group-name`,
width: 2,
key: 'name-' + appIndex
}, group.name), /*#__PURE__*/React.createElement(DataListCell, {
id: `${appIndex}-group-path`,
width: 2,
key: 'path-' + appIndex
}, group.path), /*#__PURE__*/React.createElement(DataListCell, {
id: `${appIndex}-group-directMembership`,
width: 2,
key: 'directMembership-' + appIndex
}, /*#__PURE__*/React.createElement(Checkbox, {
id: `${appIndex}-checkbox-directMembership`,
isChecked: group.id != null,
isDisabled: true
}))]
})));
}
render() {
return /*#__PURE__*/React.createElement(ContentPage, {
title: Msg.localize('groupLabel')
}, /*#__PURE__*/React.createElement(DataList, {
id: "groups-list",
"aria-label": Msg.localize('groupLabel'),
isCompact: true
}, /*#__PURE__*/React.createElement(DataListItem, {
id: "groups-list-header",
"aria-labelledby": "Columns names"
}, /*#__PURE__*/React.createElement(DataListItemRow, null, /*#__PURE__*/React.createElement(DataListItemCells, {
dataListCells: [/*#__PURE__*/React.createElement(DataListCell, {
key: "directMembership-header"
}, /*#__PURE__*/React.createElement(Checkbox, {
label: Msg.localize('directMembership'),
id: "directMembership-checkbox",
isChecked: this.state.isDirectMembership,
onChange: this.changeDirectMembership
}))]
}))), /*#__PURE__*/React.createElement(DataListItem, {
id: "groups-list-header",
"aria-labelledby": "Columns names"
}, /*#__PURE__*/React.createElement(DataListItemRow, null, /*#__PURE__*/React.createElement(DataListItemCells, {
dataListCells: [/*#__PURE__*/React.createElement(DataListCell, {
key: "group-name-header",
width: 2
}, /*#__PURE__*/React.createElement("strong", null, /*#__PURE__*/React.createElement(Msg, {
msgKey: "Name"
}))), /*#__PURE__*/React.createElement(DataListCell, {
key: "group-path-header",
width: 2
}, /*#__PURE__*/React.createElement("strong", null, /*#__PURE__*/React.createElement(Msg, {
msgKey: "path"
}))), /*#__PURE__*/React.createElement(DataListCell, {
key: "group-direct-membership-header",
width: 2
}, /*#__PURE__*/React.createElement("strong", null, /*#__PURE__*/React.createElement(Msg, {
msgKey: "directMembership"
})))]
}))), this.state.groups.length === 0 ? this.emptyGroup() : this.state.isDirectMembership ? this.state.directGroups.map((group, appIndex) => this.renderGroupList(group, appIndex)) : this.state.groups.map((group, appIndex) => this.renderGroupList(group, appIndex))));
}
}
_defineProperty(GroupsPage, "contextType", AccountServiceContext);
;
//# sourceMappingURL=GroupsPage.js.map
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
@@ -15,24 +16,22 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import { withRouter } from "../../../../common/keycloak/web_modules/react-router-dom.js";
import { Button, DataList, DataListAction, DataListItemCells, DataListCell, DataListItemRow, Label, PageSection, PageSectionVariants, Split, SplitItem, Stack, StackItem, Title, DataListItem } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js";
import { BitbucketIcon, CubeIcon, GitlabIcon, LinkIcon, PaypalIcon, UnlinkIcon } from "../../../../common/keycloak/web_modules/@patternfly/react-icons.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { withRouter } from "../../../keycloak.v2/web_modules/react-router-dom.js";
import { Button, DataList, DataListAction, DataListItemCells, DataListCell, DataListItemRow, Label, PageSection, PageSectionVariants, Split, SplitItem, Stack, StackItem, Title, DataListItem } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { BitbucketIcon, CubeIcon, GitlabIcon, LinkIcon, OpenshiftIcon, PaypalIcon, UnlinkIcon, FacebookIcon, GoogleIcon, InstagramIcon, MicrosoftIcon, TwitterIcon, StackOverflowIcon, LinkedinIcon, GithubIcon } from "../../../keycloak.v2/web_modules/@patternfly/react-icons.js";
import { AccountServiceContext } from "../../account-service/AccountServiceContext.js";
import { Msg } from "../../widgets/Msg.js";
import { ContentPage } from "../ContentPage.js";
import { createRedirect } from "../../util/RedirectUri.js";
/**
* @author Stan Silvert
*/
class LinkedAccountsPage extends React.Component {
constructor(props, context) {
super(props);
_defineProperty(this, "context", void 0);
this.context = context;
this.state = {
linkedAccounts: [],
@@ -40,7 +39,6 @@ class LinkedAccountsPage extends React.Component {
};
this.getLinkedAccounts();
}
getLinkedAccounts() {
this.context.doGet("/linked-accounts").then(response => {
console.log({
@@ -54,7 +52,6 @@ class LinkedAccountsPage extends React.Component {
});
});
}
unLinkAccount(account) {
const url = '/linked-accounts/' + account.providerName;
this.context.doDelete(url).then(response => {
@@ -64,7 +61,6 @@ class LinkedAccountsPage extends React.Component {
this.getLinkedAccounts();
});
}
linkAccount(account) {
const url = '/linked-accounts/' + account.providerName;
const redirectUri = createRedirect(this.props.location.pathname);
@@ -80,7 +76,6 @@ class LinkedAccountsPage extends React.Component {
window.location.href = response.data.accountLinkUri;
});
}
render() {
return /*#__PURE__*/React.createElement(ContentPage, {
title: Msg.localize('linkedAccountsTitle'),
@@ -110,16 +105,13 @@ class LinkedAccountsPage extends React.Component {
"aria-label": Msg.localize('unlinkedLoginProviders')
}, this.makeRows(this.state.unLinkedAccounts, false))))));
}
emptyRow(isLinked) {
let isEmptyMessage = '';
if (isLinked) {
isEmptyMessage = Msg.localize('linkedEmpty');
} else {
isEmptyMessage = Msg.localize('unlinkedEmpty');
}
return /*#__PURE__*/React.createElement(DataListItem, {
key: "emptyItem",
"aria-labelledby": Msg.localize('isEmptyMessage')
@@ -131,12 +123,10 @@ class LinkedAccountsPage extends React.Component {
}, isEmptyMessage)]
})));
}
makeRows(accounts, isLinked) {
if (accounts.length === 0) {
return this.emptyRow(isLinked);
}
return /*#__PURE__*/React.createElement(React.Fragment, null, " ", accounts.map(account => /*#__PURE__*/React.createElement(DataListItem, {
id: `${account.providerAlias}-idp`,
key: account.providerName,
@@ -191,7 +181,6 @@ class LinkedAccountsPage extends React.Component {
msgKey: "link"
})))))), " ");
}
label(account) {
if (account.social) {
return /*#__PURE__*/React.createElement(Label, {
@@ -200,49 +189,82 @@ class LinkedAccountsPage extends React.Component {
msgKey: "socialLogin"
}));
}
return /*#__PURE__*/React.createElement(Label, {
color: "green"
}, /*#__PURE__*/React.createElement(Msg, {
msgKey: "systemDefined"
}));
}
findIcon(account) {
const socialIconId = `${account.providerAlias}-idp-icon-social`;
console.log(account);
switch (true) {
case account.providerName.toLowerCase().includes('linkedin'):
return /*#__PURE__*/React.createElement(LinkedinIcon, {
id: socialIconId,
size: "lg"
});
case account.providerName.toLowerCase().includes('facebook'):
return /*#__PURE__*/React.createElement(FacebookIcon, {
id: socialIconId,
size: "lg"
});
case account.providerName.toLowerCase().includes('google'):
return /*#__PURE__*/React.createElement(GoogleIcon, {
id: socialIconId,
size: "lg"
});
case account.providerName.toLowerCase().includes('instagram'):
return /*#__PURE__*/React.createElement(InstagramIcon, {
id: socialIconId,
size: "lg"
});
case account.providerName.toLowerCase().includes('microsoft'):
return /*#__PURE__*/React.createElement(MicrosoftIcon, {
id: socialIconId,
size: "lg"
});
case account.providerName.toLowerCase().includes('bitbucket'):
return /*#__PURE__*/React.createElement(BitbucketIcon, {
id: socialIconId,
size: "lg"
});
case account.providerName.toLowerCase().includes('openshift'):
return /*#__PURE__*/React.createElement("div", {
className: "idp-icon-social",
id: "openshift-idp-icon-social"
case account.providerName.toLowerCase().includes('twitter'):
return /*#__PURE__*/React.createElement(TwitterIcon, {
id: socialIconId,
size: "lg"
});
case account.providerName.toLowerCase().includes('openshift'):
// return <div className="idp-icon-social" id="openshift-idp-icon-social" />;
return /*#__PURE__*/React.createElement(OpenshiftIcon, {
id: socialIconId,
size: "lg"
});
case account.providerName.toLowerCase().includes('gitlab'):
return /*#__PURE__*/React.createElement(GitlabIcon, {
id: socialIconId,
size: "lg"
});
case account.providerName.toLowerCase().includes('github'):
return /*#__PURE__*/React.createElement(GithubIcon, {
id: socialIconId,
size: "lg"
});
case account.providerName.toLowerCase().includes('paypal'):
return /*#__PURE__*/React.createElement(PaypalIcon, {
id: socialIconId,
size: "lg"
});
case account.providerName.toLowerCase().includes('stackoverflow'):
return /*#__PURE__*/React.createElement(StackOverflowIcon, {
id: socialIconId,
size: "lg"
});
case account.providerName !== '' && account.social:
return /*#__PURE__*/React.createElement("div", {
className: "idp-icon-social",
id: socialIconId
});
default:
return /*#__PURE__*/React.createElement(CubeIcon, {
id: `${account.providerAlias}-idp-icon-default`,
@@ -250,11 +272,8 @@ class LinkedAccountsPage extends React.Component {
});
}
}
}
_defineProperty(LinkedAccountsPage, "contextType", AccountServiceContext);
;
const LinkedAccountsPagewithRouter = withRouter(LinkedAccountsPage);
export { LinkedAccountsPagewithRouter as LinkedAccountsPage };
File diff suppressed because one or more lines are too long
@@ -1,22 +1,19 @@
import * as React from "../../../../common/keycloak/web_modules/react.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { Msg } from "../../widgets/Msg.js";
export class AbstractResourcesTable extends React.Component {
hasPermissions(row) {
return this.state.permissions.has(row) && this.state.permissions.get(row).length > 0;
}
firstUser(row) {
if (!this.hasPermissions(row)) return 'ERROR!!!!'; // should never happen
return this.state.permissions.get(row)[0].username;
}
numOthers(row) {
if (!this.hasPermissions(row)) return -1; // should never happen
return this.state.permissions.get(row).length - 1;
}
sharedWithUsersMessage(row) {
if (!this.hasPermissions(row)) return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Msg, {
msgKey: "resourceNotShared"
@@ -27,7 +24,6 @@ export class AbstractResourcesTable extends React.Component {
msgKey: "and"
}, /*#__PURE__*/React.createElement("strong", null, this.numOthers(row))), ".");
}
getClientName(client) {
if (client.hasOwnProperty('name') && client.name !== null && client.name !== '') {
return Msg.localize(client.name);
@@ -35,6 +31,5 @@ export class AbstractResourcesTable extends React.Component {
return client.clientId;
}
}
}
//# sourceMappingURL=AbstractResourceTable.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../../src/app/content/my-resources-page/AbstractResourceTable.tsx"],"names":["React","Msg","AbstractResourcesTable","Component","hasPermissions","row","state","permissions","has","get","length","firstUser","username","numOthers","sharedWithUsersMessage","getClientName","client","hasOwnProperty","name","localize","clientId"],"mappings":"AAAA,OAAO,KAAKA,KAAZ;AAEA,SAASC,GAAT;AAUA,OAAO,MAAeC,sBAAf,SAA6EF,KAAK,CAACG,SAAnF,CAAqH;AAEhHC,EAAAA,cAAc,CAACC,GAAD,EAAuB;AAC7C,WAAQ,KAAKC,KAAL,CAAWC,WAAX,CAAuBC,GAAvB,CAA2BH,GAA3B,CAAD,IAAsC,KAAKC,KAAL,CAAWC,WAAX,CAAuBE,GAAvB,CAA2BJ,GAA3B,EAAiCK,MAAjC,GAA0C,CAAvF;AACD;;AAEOC,EAAAA,SAAS,CAACN,GAAD,EAAsB;AACrC,QAAI,CAAC,KAAKD,cAAL,CAAoBC,GAApB,CAAL,EAA+B,OAAO,WAAP,CADM,CACc;;AAEnD,WAAO,KAAKC,KAAL,CAAWC,WAAX,CAAuBE,GAAvB,CAA2BJ,GAA3B,EAAiC,CAAjC,EAAoCO,QAA3C;AACD;;AAESC,EAAAA,SAAS,CAACR,GAAD,EAAsB;AACvC,QAAI,CAAC,KAAKD,cAAL,CAAoBC,GAApB,CAAL,EAA+B,OAAO,CAAC,CAAR,CADQ,CACG;;AAE1C,WAAO,KAAKC,KAAL,CAAWC,WAAX,CAAuBE,GAAvB,CAA2BJ,GAA3B,EAAiCK,MAAjC,GAA0C,CAAjD;AACD;;AAEMI,EAAAA,sBAAsB,CAACT,GAAD,EAA+B;AAC1D,QAAI,CAAC,KAAKD,cAAL,CAAoBC,GAApB,CAAL,EAA+B,oBAAQ,oBAAC,KAAD,CAAO,QAAP,qBAAgB,oBAAC,GAAD;AAAK,MAAA,MAAM,EAAC;AAAZ,MAAhB,CAAR;AAE/B,wBACE,oBAAC,KAAD,CAAO,QAAP,qBACE,oBAAC,GAAD;AAAK,MAAA,MAAM,EAAC;AAAZ,oBACE,oCAAS,KAAKM,SAAL,CAAeN,GAAf,CAAT,CADF,CADF,EAIG,KAAKQ,SAAL,CAAeR,GAAf,IAAsB,CAAtB,iBAA2B,oBAAC,GAAD;AAAK,MAAA,MAAM,EAAC;AAAZ,oBAC1B,oCAAS,KAAKQ,SAAL,CAAeR,GAAf,CAAT,CAD0B,CAJ9B,MADF;AAUD;;AAESU,EAAAA,aAAa,CAACC,MAAD,EAAyB;AAC9C,QAAIA,MAAM,CAACC,cAAP,CAAsB,MAAtB,KAAiCD,MAAM,CAACE,IAAP,KAAgB,IAAjD,IAAyDF,MAAM,CAACE,IAAP,KAAgB,EAA7E,EAAiF;AAC/E,aAAOjB,GAAG,CAACkB,QAAJ,CAAaH,MAAM,CAACE,IAApB,CAAP;AACD,KAFD,MAEO;AACL,aAAOF,MAAM,CAACI,QAAd;AACD;AACF;;AAvCyH","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<number, Permission[]>;\n}\n\nexport abstract class AbstractResourcesTable<S extends ResourcesTableState> extends React.Component<ResourcesTableProps, S> {\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 (<React.Fragment><Msg msgKey='resourceNotShared' /></React.Fragment>);\n\n return (\n <React.Fragment>\n <Msg msgKey='resourceSharedWith'>\n <strong>{this.firstUser(row)}</strong>\n </Msg>\n {this.numOthers(row) > 0 && <Msg msgKey='and'>\n <strong>{this.numOthers(row)}</strong>\n </Msg>}.\n </React.Fragment>\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"],"file":"AbstractResourceTable.js"}
{"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<number, Permission[]>;\n}\n\nexport abstract class AbstractResourcesTable<S extends ResourcesTableState> extends React.Component<ResourcesTableProps, S> {\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 (<React.Fragment><Msg msgKey='resourceNotShared' /></React.Fragment>);\n\n return (\n <React.Fragment>\n <Msg msgKey='resourceSharedWith'>\n <strong>{this.firstUser(row)}</strong>\n </Msg>\n {this.numOthers(row) > 0 && <Msg msgKey='and'>\n <strong>{this.numOthers(row)}</strong>\n </Msg>}.\n </React.Fragment>\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,GAAG,CAAC,CAAEK,MAAM,GAAG,CAAE;EAC3F;EAEQC,SAASA,CAACN,GAAW,EAAU;IACrC,IAAI,CAAC,IAAI,CAACD,cAAc,CAACC,GAAG,CAAC,EAAE,OAAO,WAAW,CAAC,CAAC;;IAEnD,OAAO,IAAI,CAACC,KAAK,CAACC,WAAW,CAACE,GAAG,CAACJ,GAAG,CAAC,CAAE,CAAC,CAAC,CAACO,QAAQ;EACrD;EAEUC,SAASA,CAACR,GAAW,EAAU;IACvC,IAAI,CAAC,IAAI,CAACD,cAAc,CAACC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;;IAE1C,OAAO,IAAI,CAACC,KAAK,CAACC,WAAW,CAACE,GAAG,CAACJ,GAAG,CAAC,CAAEK,MAAM,GAAG,CAAC;EACpD;EAEOI,sBAAsBA,CAACT,GAAW,EAAmB;IAC1D,IAAI,CAAC,IAAI,CAACD,cAAc,CAACC,GAAG,CAAC,EAAE,oBAAQL,KAAA,CAAAe,aAAA,CAACf,KAAK,CAACgB,QAAQ,qBAAChB,KAAA,CAAAe,aAAA,CAACd,GAAG;MAACgB,MAAM,EAAC;IAAmB,CAAE,CAAiB,CAAC;IAE1G,oBACEjB,KAAA,CAAAe,aAAA,CAACf,KAAK,CAACgB,QAAQ,qBACbhB,KAAA,CAAAe,aAAA,CAACd,GAAG;MAACgB,MAAM,EAAC;IAAoB,gBAC9BjB,KAAA,CAAAe,aAAA,iBAAS,IAAI,CAACJ,SAAS,CAACN,GAAG,CAAU,CAClC,CAAC,EACL,IAAI,CAACQ,SAAS,CAACR,GAAG,CAAC,GAAG,CAAC,iBAAIL,KAAA,CAAAe,aAAA,CAACd,GAAG;MAACgB,MAAM,EAAC;IAAK,gBAC3CjB,KAAA,CAAAe,aAAA,iBAAS,IAAI,CAACF,SAAS,CAACR,GAAG,CAAU,CAClC,CAAC,EAAC,GACO,CAAC;EAErB;EAEUa,aAAaA,CAACC,MAAc,EAAU;IAC9C,IAAIA,MAAM,CAACC,cAAc,CAAC,MAAM,CAAC,IAAID,MAAM,CAACE,IAAI,KAAK,IAAI,IAAIF,MAAM,CAACE,IAAI,KAAK,EAAE,EAAE;MAC/E,OAAOpB,GAAG,CAACqB,QAAQ,CAACH,MAAM,CAACE,IAAK,CAAC;IACnC,CAAC,MAAM;MACL,OAAOF,MAAM,CAACI,QAAQ;IACxB;EACF;AACF"}
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
@@ -15,9 +16,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import { Button, Modal, Form, FormGroup, TextInput, InputGroup, ModalVariant } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js";
import { OkIcon } from "../../../../common/keycloak/web_modules/@patternfly/react-icons.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { Button, Modal, Form, FormGroup, TextInput, InputGroup, ModalVariant } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { OkIcon } from "../../../keycloak.v2/web_modules/@patternfly/react-icons.js";
import { Scope } from "./resource-model.js";
import { Msg } from "../../widgets/Msg.js";
import { AccountServiceContext } from "../../account-service/AccountServiceContext.js";
@@ -26,9 +28,7 @@ import { PermissionSelect } from "./PermissionSelect.js";
export class EditTheResource extends React.Component {
constructor(props, context) {
super(props);
_defineProperty(this, "context", void 0);
_defineProperty(this, "handleToggleDialog", () => {
if (this.state.isOpen) {
this.setState({
@@ -42,7 +42,6 @@ export class EditTheResource extends React.Component {
});
}
});
_defineProperty(this, "updateChanged", row => {
const changed = this.state.changed;
changed[row] = !changed[row];
@@ -50,23 +49,19 @@ export class EditTheResource extends React.Component {
changed
});
});
this.context = context;
this.state = {
changed: [],
isOpen: false
};
}
clearState() {
this.setState({});
}
async savePermission(permission) {
await this.context.doPut(`/resources/${this.props.resource._id}/permissions`, [permission]);
await this.context.doPut(`/resources/${encodeURIComponent(this.props.resource._id)}/permissions`, [permission]);
ContentAlert.success(Msg.localize('updateSuccess'));
}
render() {
return /*#__PURE__*/React.createElement(React.Fragment, null, this.props.children(this.handleToggleDialog), /*#__PURE__*/React.createElement(Modal, {
title: 'Edit the resource - ' + this.props.resource.name,
@@ -109,12 +104,9 @@ export class EditTheResource extends React.Component {
onClick: () => this.savePermission(p)
}, /*#__PURE__*/React.createElement(OkIcon, null)))), /*#__PURE__*/React.createElement("hr", null))))));
}
}
_defineProperty(EditTheResource, "defaultProps", {
permissions: []
});
_defineProperty(EditTheResource, "contextType", AccountServiceContext);
//# sourceMappingURL=EditTheResource.js.map
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
*
@@ -15,9 +16,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import parse from "../../util/ParseLink.js";
import { Button, Level, LevelItem, PageSection, PageSectionVariants, Stack, StackItem, Tab, Tabs, TextInput } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js";
import { Button, Level, LevelItem, PageSection, PageSectionVariants, Stack, StackItem, Tab, Tabs, TextInput } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { AccountServiceContext } from "../../account-service/AccountServiceContext.js";
import { Scope } from "./resource-model.js";
import { ResourcesTable } from "./ResourcesTable.js";
@@ -29,23 +31,17 @@ const SHARED_WITH_ME_TAB = 1;
export class MyResourcesPage extends React.Component {
constructor(props, context) {
super(props);
_defineProperty(this, "context", void 0);
_defineProperty(this, "first", 0);
_defineProperty(this, "max", 5);
_defineProperty(this, "makeScopeObj", scope => {
return new Scope(scope.name, scope.displayName);
});
_defineProperty(this, "fetchPermissionRequests", () => {
this.state.myResources.data.forEach(resource => {
this.fetchShareRequests(resource);
});
});
_defineProperty(this, "fetchPending", async () => {
const response = await this.context.doGet(`/resources/pending-requests`);
const resources = response.data || [];
@@ -61,7 +57,6 @@ export class MyResourcesPage extends React.Component {
});
});
});
_defineProperty(this, "handleFilterRequest", value => {
this.setState({
nameFilter: value
@@ -70,11 +65,9 @@ export class MyResourcesPage extends React.Component {
name: value
});
});
_defineProperty(this, "handleFirstPageClick", () => {
this.fetchInitialResources();
});
_defineProperty(this, "handleNextClick", () => {
if (this.isSharedWithMeTab()) {
this.fetchResources(this.state.sharedWithMe.nextUrl);
@@ -82,7 +75,6 @@ export class MyResourcesPage extends React.Component {
this.fetchResources(this.state.myResources.nextUrl);
}
});
_defineProperty(this, "handlePreviousClick", () => {
if (this.isSharedWithMeTab()) {
this.fetchResources(this.state.sharedWithMe.prevUrl);
@@ -90,8 +82,7 @@ export class MyResourcesPage extends React.Component {
this.fetchResources(this.state.myResources.prevUrl);
}
});
_defineProperty(this, "handleTabClick", (event, tabIndex) => {
_defineProperty(this, "handleTabClick", tabIndex => {
if (this.state.activeTabKey === tabIndex) return;
this.setState({
nameFilter: '',
@@ -100,7 +91,6 @@ export class MyResourcesPage extends React.Component {
this.fetchInitialResources();
});
});
this.context = context;
this.state = {
activeTabKey: MY_RESOURCES_TAB,
@@ -119,11 +109,9 @@ export class MyResourcesPage extends React.Component {
};
this.fetchInitialResources();
}
isSharedWithMeTab() {
return this.state.activeTabKey === SHARED_WITH_ME_TAB;
}
hasNext() {
if (this.isSharedWithMeTab()) {
return this.state.sharedWithMe.nextUrl !== null && this.state.sharedWithMe.nextUrl !== '';
@@ -131,7 +119,6 @@ export class MyResourcesPage extends React.Component {
return this.state.myResources.nextUrl !== null && this.state.myResources.nextUrl !== '';
}
}
hasPrevious() {
if (this.isSharedWithMeTab()) {
return this.state.sharedWithMe.prevUrl !== null && this.state.sharedWithMe.prevUrl !== '';
@@ -139,7 +126,6 @@ export class MyResourcesPage extends React.Component {
return this.state.myResources.prevUrl !== null && this.state.myResources.prevUrl !== '';
}
}
fetchInitialResources() {
if (this.isSharedWithMeTab()) {
this.fetchResources("/resources/shared-with-me");
@@ -150,27 +136,26 @@ export class MyResourcesPage extends React.Component {
});
}
}
fetchFilteredResources(params) {
if (this.isSharedWithMeTab()) {
this.fetchResources("/resources/shared-with-me", params);
} else {
this.fetchResources("/resources", { ...params,
this.fetchResources("/resources", {
...params,
first: this.first,
max: this.max
});
}
}
fetchResources(url, extraParams) {
this.context.doGet(url, {
params: extraParams
}).then(response => {
const resources = response.data || [];
resources.forEach(resource => resource.shareRequests = []); // serialize the Scope objects from JSON so that toString() will work.
resources.forEach(resource => resource.shareRequests = []);
// serialize the Scope objects from JSON so that toString() will work.
resources.forEach(resource => resource.scopes = resource.scopes.map(this.makeScopeObj));
if (this.isSharedWithMeTab()) {
this.setState({
sharedWithMe: this.parseResourceResponse(response)
@@ -182,28 +167,23 @@ export class MyResourcesPage extends React.Component {
}
});
}
fetchShareRequests(resource) {
this.context.doGet('/resources/' + resource._id + '/permissions/requests').then(response => {
resource.shareRequests = response.data || [];
if (resource.shareRequests.length > 0) {
this.forceUpdate();
}
});
}
parseResourceResponse(response) {
const links = response.headers.get('link') || undefined;
const parsed = parse(links);
let next = '';
let prev = '';
if (parsed !== null) {
if (parsed.next) next = parsed.next;
if (parsed.prev) prev = parsed.prev;
}
const resources = response.data || [];
return {
nextUrl: next,
@@ -211,7 +191,6 @@ export class MyResourcesPage extends React.Component {
data: resources
};
}
makeTab(eventKey, title, resources, sharedResourcesTab) {
return /*#__PURE__*/React.createElement(Tab, {
id: title,
@@ -240,7 +219,6 @@ export class MyResourcesPage extends React.Component {
resources: resources
}))));
}
render() {
return /*#__PURE__*/React.createElement(ContentPage, {
title: "resources",
@@ -249,7 +227,7 @@ export class MyResourcesPage extends React.Component {
variant: PageSectionVariants.light
}, /*#__PURE__*/React.createElement(Tabs, {
activeKey: this.state.activeTabKey,
onSelect: this.handleTabClick
onSelect: (event, index) => this.handleTabClick(index)
}, this.makeTab(0, 'myResources', this.state.myResources, false), this.makeTab(1, 'sharedwithMe', this.state.sharedWithMe, true)), /*#__PURE__*/React.createElement(Level, {
hasGutter: true
}, /*#__PURE__*/React.createElement(LevelItem, null, this.hasPrevious() && /*#__PURE__*/React.createElement(Button, {
@@ -266,7 +244,6 @@ export class MyResourcesPage extends React.Component {
msgKey: "nextPage"
}), ">")))));
}
clearNextPrev() {
const newMyResources = this.state.myResources;
newMyResources.nextUrl = '';
@@ -275,10 +252,7 @@ export class MyResourcesPage extends React.Component {
myResources: newMyResources
});
}
}
_defineProperty(MyResourcesPage, "contextType", AccountServiceContext);
;
//# sourceMappingURL=MyResourcesPage.js.map
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
@@ -15,42 +16,36 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import { Button, Modal, Text, Badge, DataListItem, DataList, TextVariants, DataListItemRow, DataListItemCells, DataListCell, Chip, Split, SplitItem, ModalVariant } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js";
import { UserCheckIcon } from "../../../../common/keycloak/web_modules/@patternfly/react-icons.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { Button, Modal, Text, Badge, DataListItem, DataList, TextVariants, DataListItemRow, DataListItemCells, DataListCell, Chip, Split, SplitItem, ModalVariant } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { UserCheckIcon } from "../../../keycloak.v2/web_modules/@patternfly/react-icons.js";
import { AccountServiceContext } from "../../account-service/AccountServiceContext.js";
import { Msg } from "../../widgets/Msg.js";
import { ContentAlert } from "../ContentAlert.js";
export class PermissionRequest extends React.Component {
constructor(props, context) {
super(props);
_defineProperty(this, "context", void 0);
_defineProperty(this, "handleApprove", async (shareRequest, index) => {
this.handle(shareRequest.username, shareRequest.scopes, true);
this.props.resource.shareRequests.splice(index, 1);
});
_defineProperty(this, "handleDeny", async (shareRequest, index) => {
this.handle(shareRequest.username, shareRequest.scopes);
this.props.resource.shareRequests.splice(index, 1);
});
_defineProperty(this, "handle", async (username, scopes, approve = false) => {
const id = this.props.resource._id;
this.handleToggleDialog();
const permissionsRequest = await this.context.doGet(`/resources/${id}/permissions`);
const permissionsRequest = await this.context.doGet(`/resources/${encodeURIComponent(id)}/permissions`);
const permissions = permissionsRequest.data || [];
const foundPermission = permissions.find(p => p.username === username);
const userScopes = foundPermission ? foundPermission.scopes : [];
if (approve) {
userScopes.push(...scopes);
}
try {
await this.context.doPut(`/resources/${id}/permissions`, [{
await this.context.doPut(`/resources/${encodeURIComponent(id)}/permissions`, [{
username: username,
scopes: userScopes
}]);
@@ -60,19 +55,16 @@ export class PermissionRequest extends React.Component {
console.error('Could not update permissions', e.error);
}
});
_defineProperty(this, "handleToggleDialog", () => {
this.setState({
isOpen: !this.state.isOpen
});
});
this.context = context;
this.state = {
isOpen: false
};
}
render() {
const id = `shareRequest-${this.props.resource.name.replace(/\s/, '-')}`;
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
@@ -139,13 +131,10 @@ export class PermissionRequest extends React.Component {
}, "Deny"))))]
})))))));
}
}
_defineProperty(PermissionRequest, "defaultProps", {
permissions: [],
row: 0
});
_defineProperty(PermissionRequest, "contextType", AccountServiceContext);
//# sourceMappingURL=PermissionRequest.js.map
File diff suppressed because one or more lines are too long
@@ -1,55 +1,49 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import * as React from "../../../../common/keycloak/web_modules/react.js";
import { Select, SelectOption, SelectVariant } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js";
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { Select, SelectOption, SelectVariant } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { Msg } from "../../widgets/Msg.js";
class ScopeValue {
constructor(value) {
_defineProperty(this, "value", void 0);
this.value = value;
}
toString() {
return this.value.displayName ? this.value.displayName : this.value.name;
}
compareTo(selectOption) {
return selectOption.name === this.value.name;
}
}
export class PermissionSelect extends React.Component {
constructor(props) {
super(props);
_defineProperty(this, "onSelect", (_event, selection) => {
_defineProperty(this, "onSelect", (event, value) => {
const {
selected
} = this.state;
const {
onSelect
} = this.props;
if (selected.includes(selection)) {
if (!(value instanceof ScopeValue)) {
return;
}
if (selected.includes(value)) {
this.setState(prevState => ({
selected: prevState.selected.filter(item => item !== selection)
selected: prevState.selected.filter(item => item !== value)
}), () => onSelect(this.state.selected.map(sv => sv.value)));
} else {
this.setState(prevState => ({
selected: [...prevState.selected, selection]
selected: [...prevState.selected, value]
}), () => onSelect(this.state.selected.map(sv => sv.value)));
}
});
_defineProperty(this, "onToggle", isExpanded => {
this.setState({
isExpanded
});
});
_defineProperty(this, "clearSelection", () => {
this.setState({
selected: [],
@@ -57,13 +51,10 @@ export class PermissionSelect extends React.Component {
});
this.props.onSelect([]);
});
let values = [];
if (this.props.selected) {
values = this.props.selected.map(s => new ScopeValue(s));
}
this.state = {
isExpanded: false,
selected: values,
@@ -73,7 +64,6 @@ export class PermissionSelect extends React.Component {
}))
};
}
render() {
const {
isExpanded,
@@ -86,6 +76,7 @@ export class PermissionSelect extends React.Component {
}, /*#__PURE__*/React.createElement(Msg, {
msgKey: "selectPermissions"
})), /*#__PURE__*/React.createElement(Select, {
maxHeight: 300,
direction: this.props.direction || 'down',
variant: SelectVariant.typeaheadMulti,
typeAheadAriaLabel: Msg.localize("selectPermissions"),
@@ -95,9 +86,9 @@ export class PermissionSelect extends React.Component {
selections: selected,
isOpen: isExpanded,
"aria-labelledby": titleId,
placeholderText: Msg.localize("selectPermissions")
placeholderText: Msg.localize("selectPermissions"),
menuAppendTo: "parent"
}, this.state.scopes));
}
}
//# sourceMappingURL=PermissionSelect.js.map
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
*
@@ -15,9 +16,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import { DataList, DataListItem, DataListItemRow, DataListCell, DataListToggle, DataListContent, DataListItemCells, Level, LevelItem, Button, DataListAction, Dropdown, DropdownPosition, DropdownItem, KebabToggle } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js";
import { Remove2Icon, RepositoryIcon, ShareAltIcon, EditAltIcon } from "../../../../common/keycloak/web_modules/@patternfly/react-icons.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { DataList, DataListItem, DataListItemRow, DataListCell, DataListToggle, DataListContent, DataListItemCells, Level, LevelItem, Button, DataListAction, Dropdown, DropdownPosition, DropdownItem, KebabToggle } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { Remove2Icon, RepositoryIcon, ShareAltIcon, EditAltIcon } from "../../../keycloak.v2/web_modules/@patternfly/react-icons.js";
import { AccountServiceContext } from "../../account-service/AccountServiceContext.js";
import { PermissionRequest } from "./PermissionRequest.js";
import { ShareTheResource } from "./ShareTheResource.js";
@@ -30,9 +32,7 @@ import { ContinueCancelModal } from "../../widgets/ContinueCancelModal.js";
export class ResourcesTable extends AbstractResourcesTable {
constructor(props, context) {
super(props);
_defineProperty(this, "context", void 0);
_defineProperty(this, "onToggle", row => {
const newIsRowOpen = this.state.isRowOpen;
newIsRowOpen[row] = !newIsRowOpen[row];
@@ -41,23 +41,19 @@ export class ResourcesTable extends AbstractResourcesTable {
isRowOpen: newIsRowOpen
});
});
_defineProperty(this, "onContextToggle", (row, isOpen) => {
if (this.state.isModalActive) return;
const data = this.props.resources.data;
const contextOpen = this.state.contextOpen;
contextOpen[row] = isOpen;
if (isOpen) {
const index = row > data.length ? row - data.length - 1 : row;
this.fetchPermissions(data[index], index);
}
this.setState({
contextOpen
});
});
this.context = context;
this.state = {
isRowOpen: [],
@@ -66,9 +62,8 @@ export class ResourcesTable extends AbstractResourcesTable {
permissions: new Map()
};
}
fetchPermissions(resource, row) {
this.context.doGet(`/resources/${resource._id}/permissions`).then(response => {
this.context.doGet(`/resources/${encodeURIComponent(resource._id)}/permissions`).then(response => {
const newPermissions = new Map(this.state.permissions);
newPermissions.set(row, response.data || []);
this.setState({
@@ -76,17 +71,15 @@ export class ResourcesTable extends AbstractResourcesTable {
});
});
}
removeShare(resource, row) {
const permissions = this.state.permissions.get(row).map(a => ({
username: a.username,
scopes: []
}));
return this.context.doPut(`/resources/${resource._id}/permissions`, permissions).then(() => {
return this.context.doPut(`/resources/${encodeURIComponent(resource._id)}/permissions`, permissions).then(() => {
ContentAlert.success(Msg.localize('unShareSuccess'));
});
}
render() {
if (this.props.resources.data.length === 0) {
return /*#__PURE__*/React.createElement(EmptyMessageState, {
@@ -94,7 +87,6 @@ export class ResourcesTable extends AbstractResourcesTable {
messageKey: "notHaveAnyResource"
});
}
return /*#__PURE__*/React.createElement(DataList, {
"aria-label": Msg.localize('resources'),
id: "resourcesList"
@@ -306,8 +298,6 @@ export class ResourcesTable extends AbstractResourcesTable {
id: 'shared-with-user-message-' + row
}, this.sharedWithUsersMessage(row)), /*#__PURE__*/React.createElement(LevelItem, null, /*#__PURE__*/React.createElement("span", null)))))));
}
}
_defineProperty(ResourcesTable, "contextType", AccountServiceContext);
//# sourceMappingURL=ResourcesTable.js.map
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
@@ -15,46 +16,39 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import { Button, Chip, ChipGroup, Form, FormGroup, Gallery, GalleryItem, Modal, Stack, StackItem, TextInput, ModalVariant } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { Button, Chip, ChipGroup, Form, FormGroup, Gallery, GalleryItem, Modal, Stack, StackItem, TextInput, ModalVariant } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { AccountServiceContext } from "../../account-service/AccountServiceContext.js";
import { Msg } from "../../widgets/Msg.js";
import { ContentAlert } from "../ContentAlert.js";
import { PermissionSelect } from "./PermissionSelect.js";
/**
* @author Stan Silvert ssilvert@redhat.com (C) 2019 Red Hat Inc.
*/
export class ShareTheResource extends React.Component {
constructor(props, context) {
super(props);
_defineProperty(this, "context", void 0);
_defineProperty(this, "handleAddPermission", () => {
const rscId = this.props.resource._id;
const newPermissions = [];
for (const permission of this.state.permissionsSelected) {
newPermissions.push(permission.name);
}
const permissions = [];
for (const username of this.state.usernames) {
permissions.push({
username: username,
scopes: newPermissions
});
}
this.handleToggleDialog();
this.context.doPut(`/resources/${rscId}/permissions`, permissions).then(() => {
this.context.doPut(`/resources/${encodeURIComponent(rscId)}/permissions`, permissions).then(() => {
ContentAlert.success('shareSuccess');
this.props.onClose();
});
});
_defineProperty(this, "handleToggleDialog", () => {
if (this.state.isOpen) {
this.setState({
@@ -68,21 +62,18 @@ export class ShareTheResource extends React.Component {
});
}
});
_defineProperty(this, "handleUsernameChange", username => {
this.setState({
usernameInput: username
});
});
_defineProperty(this, "handleAddUsername", async () => {
if (this.state.usernameInput !== '' && !this.state.usernames.includes(this.state.usernameInput)) {
const response = await this.context.doGet(`/resources/${this.props.resource._id}/user`, {
const response = await this.context.doGet(`/resources/${encodeURIComponent(this.props.resource._id)}/user`, {
params: {
value: this.state.usernameInput
}
});
if (response.data && response.data.username) {
this.setState({
usernameInput: '',
@@ -93,21 +84,18 @@ export class ShareTheResource extends React.Component {
}
}
});
_defineProperty(this, "handleEnterKeyInAddField", event => {
if (event.key === "Enter") {
event.preventDefault();
this.handleAddUsername();
}
});
_defineProperty(this, "handleDeleteUsername", username => {
const newUsernames = this.state.usernames.filter(user => user !== username);
this.setState({
usernames: newUsernames
});
});
this.context = context;
this.state = {
isOpen: false,
@@ -117,7 +105,6 @@ export class ShareTheResource extends React.Component {
usernameInput: ''
};
}
clearState() {
this.setState({
permissionsSelected: [],
@@ -126,23 +113,18 @@ export class ShareTheResource extends React.Component {
usernameInput: ''
});
}
isAddDisabled() {
return this.state.usernameInput === '' || this.isAlreadyShared();
}
isAlreadyShared() {
for (let permission of this.props.permissions) {
if (permission.username === this.state.usernameInput) return true;
}
return false;
}
isFormInvalid() {
return this.state.usernames.length === 0 || this.state.permissionsSelected.length === 0;
}
render() {
return /*#__PURE__*/React.createElement(React.Fragment, null, this.props.children(this.handleToggleDialog), /*#__PURE__*/React.createElement(Modal, {
title: 'Share the resource - ' + this.props.resource.name,
@@ -211,12 +193,9 @@ export class ShareTheResource extends React.Component {
isFilled: true
}, this.props.sharedWithUsersMsg))));
}
}
_defineProperty(ShareTheResource, "defaultProps", {
permissions: []
});
_defineProperty(ShareTheResource, "contextType", AccountServiceContext);
//# sourceMappingURL=ShareTheResource.js.map
File diff suppressed because one or more lines are too long
@@ -13,9 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import { DataList, DataListItem, DataListItemRow, DataListCell, DataListItemCells, ChipGroup, Chip } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js";
import { RepositoryIcon } from "../../../../common/keycloak/web_modules/@patternfly/react-icons.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { DataList, DataListItem, DataListItemRow, DataListCell, DataListItemCells, ChipGroup, Chip } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { RepositoryIcon } from "../../../keycloak.v2/web_modules/@patternfly/react-icons.js";
import { Msg } from "../../widgets/Msg.js";
import { AbstractResourcesTable } from "./AbstractResourceTable.js";
import EmptyMessageState from "../../widgets/EmptyMessageState.js";
@@ -26,7 +27,6 @@ export class SharedResourcesTable extends AbstractResourcesTable {
permissions: new Map()
};
}
render() {
if (this.props.resources.data.length === 0) {
return /*#__PURE__*/React.createElement(EmptyMessageState, {
@@ -34,7 +34,6 @@ export class SharedResourcesTable extends AbstractResourcesTable {
messageKey: "noResourcesSharedWithYou"
});
}
return /*#__PURE__*/React.createElement(DataList, {
"aria-label": Msg.localize('resources'),
id: "sharedResourcesList"
@@ -92,6 +91,5 @@ export class SharedResourcesTable extends AbstractResourcesTable {
}, scope.displayName || scope.name))))]
})))));
}
}
//# sourceMappingURL=SharedResourcesTable.js.map
File diff suppressed because one or more lines are too long
@@ -3,7 +3,6 @@ export class Scope {
this.name = name;
this.displayName = displayName;
}
toString() {
if (this.hasOwnProperty('displayName') && this.displayName) {
return this.displayName;
@@ -11,6 +10,5 @@ export class Scope {
return this.name;
}
}
}
//# sourceMappingURL=resource-model.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../../src/app/content/my-resources-page/resource-model.ts"],"names":["Scope","constructor","name","displayName","toString","hasOwnProperty"],"mappings":"AAeA,OAAO,MAAMA,KAAN,CAAY;AACVC,EAAAA,WAAW,CAAQC,IAAR,EAA6BC,WAA7B,EAAmD;AAAA,SAA3CD,IAA2C,GAA3CA,IAA2C;AAAA,SAAtBC,WAAsB,GAAtBA,WAAsB;AAAE;;AAEhEC,EAAAA,QAAQ,GAAW;AACtB,QAAI,KAAKC,cAAL,CAAoB,aAApB,KAAuC,KAAKF,WAAhD,EAA8D;AAC1D,aAAO,KAAKA,WAAZ;AACH,KAFD,MAEO;AACH,aAAO,KAAKD,IAAZ;AACH;AACJ;;AATgB","sourcesContent":["export interface Resource {\n _id: string;\n name: string;\n client: Client;\n scopes: Scope[];\n uris: string[];\n shareRequests: Permission[];\n}\n\nexport interface Client {\n baseUrl: string;\n clientId: string;\n name?: string;\n}\n\nexport class Scope {\n public constructor(public name: string, public displayName?: string) {}\n\n public toString(): string {\n if (this.hasOwnProperty('displayName') && (this.displayName)) {\n return this.displayName;\n } else {\n return this.name;\n }\n }\n}\n\nexport interface PaginatedResources {\n nextUrl: string;\n prevUrl: string;\n data: Resource[];\n}\n\nexport interface Permission {\n email?: string;\n firstName?: string;\n lastName?: string;\n scopes: Scope[] | string[]; // this should be Scope[] - fix API\n username: string;\n}\n\nexport interface Permissions {\n permissions: Permission[];\n row?: number;\n}\n"],"file":"resource-model.js"}
{"version":3,"file":"resource-model.js","names":["Scope","constructor","name","displayName","toString","hasOwnProperty"],"sources":["../../../src/app/content/my-resources-page/resource-model.ts"],"sourcesContent":["export interface Resource {\n _id: string;\n name: string;\n client: Client;\n scopes: Scope[];\n uris: string[];\n shareRequests: Permission[];\n}\n\nexport interface Client {\n baseUrl: string;\n clientId: string;\n name?: string;\n}\n\nexport class Scope {\n public constructor(public name: string, public displayName?: string) {}\n\n public toString(): string {\n if (this.hasOwnProperty('displayName') && (this.displayName)) {\n return this.displayName;\n } else {\n return this.name;\n }\n }\n}\n\nexport interface PaginatedResources {\n nextUrl: string;\n prevUrl: string;\n data: Resource[];\n}\n\nexport interface Permission {\n email?: string;\n firstName?: string;\n lastName?: string;\n scopes: Scope[] | string[]; // this should be Scope[] - fix API\n username: string;\n}\n\nexport interface Permissions {\n permissions: Permission[];\n row?: number;\n}\n"],"mappings":"AAeA,OAAO,MAAMA,KAAK,CAAC;EACVC,WAAWA,CAAQC,IAAY,EAASC,WAAoB,EAAE;IAAA,KAA3CD,IAAY,GAAZA,IAAY;IAAA,KAASC,WAAoB,GAApBA,WAAoB;EAAG;EAE/DC,QAAQA,CAAA,EAAW;IACtB,IAAI,IAAI,CAACC,cAAc,CAAC,aAAa,CAAC,IAAK,IAAI,CAACF,WAAY,EAAE;MAC1D,OAAO,IAAI,CAACA,WAAW;IAC3B,CAAC,MAAM;MACH,OAAO,IAAI,CAACD,IAAI;IACpB;EACJ;AACF"}
@@ -3,17 +3,16 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import { WarningTriangleIcon } from "../../../../common/keycloak/web_modules/@patternfly/react-icons.js";
import { withRouter } from "../../../../common/keycloak/web_modules/react-router-dom.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { WarningTriangleIcon } from "../../../keycloak.v2/web_modules/@patternfly/react-icons.js";
import { withRouter } from "../../../keycloak.v2/web_modules/react-router-dom.js";
import { Msg } from "../../widgets/Msg.js";
import EmptyMessageState from "../../widgets/EmptyMessageState.js";
class PgNotFound extends React.Component {
constructor(props) {
super(props);
}
render() {
return /*#__PURE__*/React.createElement(EmptyMessageState, {
icon: WarningTriangleIcon,
@@ -23,9 +22,7 @@ class PgNotFound extends React.Component {
params: [this.props.location.pathname]
}));
}
}
;
export const PageNotFound = withRouter(PgNotFound);
//# sourceMappingURL=PageNotFound.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../../src/app/content/page-not-found/PageNotFound.tsx"],"names":["React","WarningTriangleIcon","withRouter","Msg","EmptyMessageState","PgNotFound","Component","constructor","props","render","location","pathname","PageNotFound"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ;AAEA,SAASC,mBAAT;AACA,SAAQC,UAAR;AACA,SAAQC,GAAR;AACA,OAAOC,iBAAP;;AAIA,MAAMC,UAAN,SAAyBL,KAAK,CAACM,SAA/B,CAA4D;AAEjDC,EAAAA,WAAW,CAACC,KAAD,EAA2B;AACzC,UAAMA,KAAN;AACH;;AAEMC,EAAAA,MAAM,GAAoB;AAC7B,wBACI,oBAAC,iBAAD;AAAmB,MAAA,IAAI,EAAER,mBAAzB;AAA8C,MAAA,UAAU,EAAC;AAAzD,oBACI,oBAAC,GAAD;AAAK,MAAA,MAAM,EAAC,cAAZ;AAA2B,MAAA,MAAM,EAAE,CAAC,KAAKO,KAAL,CAAWE,QAAX,CAAoBC,QAArB;AAAnC,MADJ,CADJ;AAKH;;AAZuD;;AAa3D;AAED,OAAO,MAAMC,YAAY,GAAGV,UAAU,CAACG,UAAD,CAA/B","sourcesContent":["/*\n * To change this license header, choose License Headers in Project Properties.\n * To change this template file, choose Tools | Templates\n * and open the template in the editor.\n */\n\nimport * as React from 'react';\n\nimport { WarningTriangleIcon } from '@patternfly/react-icons';\nimport {withRouter, RouteComponentProps} from 'react-router-dom';\nimport {Msg} from '../../widgets/Msg';\nimport EmptyMessageState from '../../widgets/EmptyMessageState';\n\nexport interface PageNotFoundProps extends RouteComponentProps {}\n\nclass PgNotFound extends React.Component<PageNotFoundProps> {\n\n public constructor(props: PageNotFoundProps) {\n super(props);\n }\n\n public render(): React.ReactNode {\n return (\n <EmptyMessageState icon={WarningTriangleIcon} messageKey=\"pageNotFound\">\n <Msg msgKey=\"invalidRoute\" params={[this.props.location.pathname]} />\n </EmptyMessageState>\n );\n }\n};\n\nexport const PageNotFound = withRouter(PgNotFound);"],"file":"PageNotFound.js"}
{"version":3,"file":"PageNotFound.js","names":["React","WarningTriangleIcon","withRouter","Msg","EmptyMessageState","PgNotFound","Component","constructor","props","render","createElement","icon","messageKey","msgKey","params","location","pathname","PageNotFound"],"sources":["../../../src/app/content/page-not-found/PageNotFound.tsx"],"sourcesContent":["/*\n * To change this license header, choose License Headers in Project Properties.\n * To change this template file, choose Tools | Templates\n * and open the template in the editor.\n */\n\nimport * as React from 'react';\n\nimport { WarningTriangleIcon } from '@patternfly/react-icons';\nimport {withRouter, RouteComponentProps} from 'react-router-dom';\nimport {Msg} from '../../widgets/Msg';\nimport EmptyMessageState from '../../widgets/EmptyMessageState';\n\nexport interface PageNotFoundProps extends RouteComponentProps {}\n\nclass PgNotFound extends React.Component<PageNotFoundProps> {\n\n public constructor(props: PageNotFoundProps) {\n super(props);\n }\n\n public render(): React.ReactNode {\n return (\n <EmptyMessageState icon={WarningTriangleIcon} messageKey=\"pageNotFound\">\n <Msg msgKey=\"invalidRoute\" params={[this.props.location.pathname]} />\n </EmptyMessageState>\n );\n }\n};\n\nexport const PageNotFound = withRouter(PgNotFound);"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK;AAEjB,SAASC,mBAAmB;AAC5B,SAAQC,UAAU;AAClB,SAAQC,GAAG;AACX,OAAOC,iBAAiB;AAIxB,MAAMC,UAAU,SAASL,KAAK,CAACM,SAAS,CAAoB;EAEjDC,WAAWA,CAACC,KAAwB,EAAE;IACzC,KAAK,CAACA,KAAK,CAAC;EAChB;EAEOC,MAAMA,CAAA,EAAoB;IAC7B,oBACIT,KAAA,CAAAU,aAAA,CAACN,iBAAiB;MAACO,IAAI,EAAEV,mBAAoB;MAACW,UAAU,EAAC;IAAc,gBACnEZ,KAAA,CAAAU,aAAA,CAACP,GAAG;MAACU,MAAM,EAAC,cAAc;MAACC,MAAM,EAAE,CAAC,IAAI,CAACN,KAAK,CAACO,QAAQ,CAACC,QAAQ;IAAE,CAAE,CACrD,CAAC;EAE5B;AACJ;AAAC;AAED,OAAO,MAAMC,YAAY,GAAGf,UAAU,CAACG,UAAU,CAAC"}
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
*
@@ -15,9 +16,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../../common/keycloak/web_modules/react.js";
import { withRouter } from "../../../../common/keycloak/web_modules/react-router-dom.js";
import { Alert, Button, DataList, DataListAction, DataListItemCells, DataListCell, DataListItem, DataListItemRow, EmptyState, EmptyStateVariant, EmptyStateBody, Split, SplitItem, Title, Dropdown, DropdownPosition, KebabToggle, PageSection, PageSectionVariants } from "../../../../common/keycloak/web_modules/@patternfly/react-core.js";
import * as React from "../../../keycloak.v2/web_modules/react.js";
import { withRouter } from "../../../keycloak.v2/web_modules/react-router-dom.js";
import { Alert, Button, DataList, DataListAction, DataListItemCells, DataListCell, DataListItem, DataListItemRow, EmptyState, EmptyStateVariant, EmptyStateBody, Split, SplitItem, Title, Dropdown, DropdownPosition, KebabToggle, PageSection, PageSectionVariants } from "../../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { AIACommand } from "../../util/AIACommand.js";
import TimeUtil from "../../util/TimeUtil.js";
import { AccountServiceContext } from "../../account-service/AccountServiceContext.js";
@@ -27,41 +29,37 @@ import { ContentPage } from "../ContentPage.js";
import { ContentAlert } from "../ContentAlert.js";
import { KeycloakContext } from "../../keycloak-service/KeycloakContext.js";
// A CredentialContainer is unique by combo of credential type and credential category
/**
* @author Stan Silvert ssilvert@redhat.com (C) 2018 Red Hat Inc.
*/
class SigningInPage extends React.Component {
constructor(props, context) {
super(props);
_defineProperty(this, "context", void 0);
_defineProperty(this, "handleRemove", (credentialId, userLabel) => {
this.context.doDelete("/credentials/" + credentialId).then(() => {
this.context.doDelete("/credentials/" + encodeURIComponent(credentialId)).then(() => {
this.getCredentialContainers();
ContentAlert.success("successRemovedMessage", [userLabel]);
});
});
this.context = context;
this.state = {
credentialContainers: new Map()
};
this.getCredentialContainers();
}
getCredentialContainers() {
this.context.doGet("/credentials").then(response => {
const allContainers = new Map();
const containers = response.data || [];
containers.forEach(container => {
let categoryMap = allContainers.get(container.category);
if (!categoryMap) {
categoryMap = new Map();
allContainers.set(container.category, categoryMap);
}
categoryMap.set(container.type, container);
});
this.setState({
@@ -69,18 +67,15 @@ class SigningInPage extends React.Component {
});
});
}
static credElementId(credType, credId, item) {
return `${credType}-${item}-${credId.substring(0, 8)}`;
}
render() {
return /*#__PURE__*/React.createElement(ContentPage, {
title: "signingIn",
introMessage: "signingInSubMessage"
}, this.renderCategories());
}
renderCategories() {
return Array.from(this.state.credentialContainers.keys()).map(category => /*#__PURE__*/React.createElement(PageSection, {
key: category,
@@ -93,12 +88,10 @@ class SigningInPage extends React.Component {
msgKey: category
})), this.renderTypes(category)));
}
renderTypes(category) {
let credTypeMap = this.state.credentialContainers.get(category);
return /*#__PURE__*/React.createElement(KeycloakContext.Consumer, null, keycloak => /*#__PURE__*/React.createElement(React.Fragment, null, Array.from(credTypeMap.keys()).map((credType, index, typeArray) => [this.renderCredTypeTitle(credTypeMap.get(credType), keycloak, category), this.renderUserCredentials(credTypeMap, credType, keycloak)])));
}
renderEmptyRow(type, isLast) {
if (isLast) return; // don't put empty row at the end
@@ -110,14 +103,12 @@ class SigningInPage extends React.Component {
dataListCells: [/*#__PURE__*/React.createElement(DataListCell, null)]
})));
}
renderUserCredentials(credTypeMap, credType, keycloak) {
const credContainer = credTypeMap.get(credType);
const userCredentialMetadatas = credContainer.userCredentialMetadatas;
const removeable = credContainer.removeable;
const type = credContainer.type;
const displayName = credContainer.displayName;
if (!userCredentialMetadatas || userCredentialMetadatas.length === 0) {
const localizedDisplayName = Msg.localize(displayName);
return /*#__PURE__*/React.createElement(DataList, {
@@ -144,21 +135,17 @@ class SigningInPage extends React.Component {
})]
}))));
}
userCredentialMetadatas.forEach(credentialMetadata => {
let credential = credentialMetadata.credential;
if (!credential.userLabel) credential.userLabel = Msg.localize(credential.type);
if (credential.hasOwnProperty('createdDate') && credential.createdDate && credential.createdDate > 0) {
credential.strCreatedDate = TimeUtil.format(credential.createdDate);
}
});
let updateAIA;
if (credContainer.updateAction) {
updateAIA = new AIACommand(keycloak, credContainer.updateAction);
}
let maxWidth = {
maxWidth: 689
};
@@ -195,7 +182,6 @@ class SigningInPage extends React.Component {
credRemover: this.handleRemove
})))))), " ");
}
credentialRowCells(credMetadata, type) {
const credRowCells = [];
const credential = credMetadata.credential;
@@ -208,7 +194,6 @@ class SigningInPage extends React.Component {
className: "pf-u-max-width",
style: maxWidth
}, credential.userLabel));
if (credential.strCreatedDate) {
credRowCells.push( /*#__PURE__*/React.createElement(DataListCell, {
id: `${SigningInPage.credElementId(type, credential.id, "created-at")}`,
@@ -222,18 +207,14 @@ class SigningInPage extends React.Component {
key: "spacer-" + credential.id
}));
}
return credRowCells;
}
renderCredTypeTitle(credContainer, keycloak, category) {
if (!credContainer.hasOwnProperty("helptext") && !credContainer.hasOwnProperty("createAction")) return;
let setupAction;
if (credContainer.createAction) {
setupAction = new AIACommand(keycloak, credContainer.createAction);
}
const credContainerDisplayName = Msg.localize(credContainer.displayName);
return /*#__PURE__*/React.createElement(React.Fragment, {
key: "credTypeTitle-" + credContainer.type
@@ -277,7 +258,7 @@ class SigningInPage extends React.Component {
}, /*#__PURE__*/React.createElement("span", {
className: "pf-c-button__icon"
}, /*#__PURE__*/React.createElement("i", {
className: "fas fa-plus-circle",
className: "fa fa-plus-circle",
"aria-hidden": "true"
})), /*#__PURE__*/React.createElement(Msg, {
msgKey: "setUpNew",
@@ -294,20 +275,16 @@ class SigningInPage extends React.Component {
}, /*#__PURE__*/React.createElement("span", {
className: "pf-c-button__icon"
}, /*#__PURE__*/React.createElement("i", {
className: "fas fa-plus-circle",
className: "fa fa-plus-circle",
"aria-hidden": "true"
})), /*#__PURE__*/React.createElement(Msg, {
msgKey: "setUpNew",
params: [credContainerDisplayName]
}))))));
}
}
_defineProperty(SigningInPage, "contextType", AccountServiceContext);
;
class CredentialAction extends React.Component {
render() {
if (this.props.updateAction) {
@@ -323,7 +300,6 @@ class CredentialAction extends React.Component {
msgKey: "update"
})));
}
if (this.props.removeable) {
const userLabel = this.props.credential.userLabel;
return /*#__PURE__*/React.createElement(DataListAction, {
@@ -339,12 +315,9 @@ class CredentialAction extends React.Component {
onContinue: () => this.props.credRemover(this.props.credential.id, userLabel)
}));
}
return /*#__PURE__*/React.createElement(React.Fragment, null);
}
}
const SigningInPageWithRouter = withRouter(SigningInPage);
export { SigningInPageWithRouter as SigningInPage };
//# sourceMappingURL=SigningInPage.js.map
File diff suppressed because one or more lines are too long
@@ -1,3 +1,3 @@
import * as React from "../../../common/keycloak/web_modules/react.js";
import * as React from "../../keycloak.v2/web_modules/react.js";
export const KeycloakContext = React.createContext(undefined);
//# sourceMappingURL=KeycloakContext.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../src/app/keycloak-service/KeycloakContext.tsx"],"names":["React","KeycloakContext","createContext","undefined"],"mappings":"AAAA,OAAO,KAAKA,KAAZ;AAGA,OAAO,MAAMC,eAAe,GAAGD,KAAK,CAACE,aAAN,CAAiDC,SAAjD,CAAxB","sourcesContent":["import * as React from 'react';\nimport { KeycloakService } from './keycloak.service';\n\nexport const KeycloakContext = React.createContext<KeycloakService | undefined>(undefined);"],"file":"KeycloakContext.js"}
{"version":3,"file":"KeycloakContext.js","names":["React","KeycloakContext","createContext","undefined"],"sources":["../../src/app/keycloak-service/KeycloakContext.tsx"],"sourcesContent":["import * as React from 'react';\nimport { KeycloakService } from './keycloak.service';\n\nexport const KeycloakContext = React.createContext<KeycloakService | undefined>(undefined);"],"mappings":"AAAA,OAAO,KAAKA,KAAK;AAGjB,OAAO,MAAMC,eAAe,GAAGD,KAAK,CAACE,aAAa,CAA8BC,SAAS,CAAC"}
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
@@ -16,55 +17,46 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export class KeycloakService {
constructor(keycloak) {
_defineProperty(this, "keycloakAuth", void 0);
this.keycloakAuth = keycloak;
}
authenticated() {
return this.keycloakAuth.authenticated ? this.keycloakAuth.authenticated : false;
}
audiencePresent() {
if (this.keycloakAuth.tokenParsed) {
const audience = this.keycloakAuth.tokenParsed['aud'];
return audience === 'account' || Array.isArray(audience) && audience.indexOf('account') >= 0;
}
return false;
}
login(options) {
this.keycloakAuth.login(options);
}
logout(redirectUri = baseUrl) {
this.keycloakAuth.logout({
redirectUri: redirectUri
});
}
account() {
this.keycloakAuth.accountManagement();
}
authServerUrl() {
const authServerUrl = this.keycloakAuth.authServerUrl;
return authServerUrl.charAt(authServerUrl.length - 1) === '/' ? authServerUrl : authServerUrl + '/';
}
realm() {
return this.keycloakAuth.realm;
}
getToken() {
return new Promise((resolve, reject) => {
if (this.keycloakAuth.token) {
this.keycloakAuth.updateToken(5).success(() => {
this.keycloakAuth.updateToken(5).then(() => {
resolve(this.keycloakAuth.token);
}).error(() => {
}).catch(() => {
reject('Failed to refresh token');
});
} else {
@@ -72,6 +64,5 @@ export class KeycloakService {
}
});
}
}
//# sourceMappingURL=keycloak.service.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../src/app/keycloak-service/keycloak.service.ts"],"names":["KeycloakService","constructor","keycloak","keycloakAuth","authenticated","audiencePresent","tokenParsed","audience","Array","isArray","indexOf","login","options","logout","redirectUri","baseUrl","account","accountManagement","authServerUrl","charAt","length","realm","getToken","Promise","resolve","reject","token","updateToken","success","error"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,OAAO,MAAMA,eAAN,CAAsB;AAGlBC,EAAAA,WAAW,CAACC,QAAD,EAA2B;AAAA;;AACzC,SAAKC,YAAL,GAAoBD,QAApB;AACH;;AAEME,EAAAA,aAAa,GAAY;AAC5B,WAAO,KAAKD,YAAL,CAAkBC,aAAlB,GAAkC,KAAKD,YAAL,CAAkBC,aAApD,GAAoE,KAA3E;AACH;;AAEMC,EAAAA,eAAe,GAAY;AAC9B,QAAI,KAAKF,YAAL,CAAkBG,WAAtB,EAAmC;AAC/B,YAAMC,QAAQ,GAAG,KAAKJ,YAAL,CAAkBG,WAAlB,CAA8B,KAA9B,CAAjB;AACA,aAAOC,QAAQ,KAAK,SAAb,IAA2BC,KAAK,CAACC,OAAN,CAAcF,QAAd,KAA2BA,QAAQ,CAACG,OAAT,CAAiB,SAAjB,KAA+B,CAA5F;AACH;;AACD,WAAO,KAAP;AACH;;AAEMC,EAAAA,KAAK,CAACC,OAAD,EAAuC;AAC/C,SAAKT,YAAL,CAAkBQ,KAAlB,CAAwBC,OAAxB;AACH;;AAEMC,EAAAA,MAAM,CAACC,WAAmB,GAAGC,OAAvB,EAAsC;AAC/C,SAAKZ,YAAL,CAAkBU,MAAlB,CAAyB;AAACC,MAAAA,WAAW,EAAEA;AAAd,KAAzB;AACH;;AAEME,EAAAA,OAAO,GAAS;AACnB,SAAKb,YAAL,CAAkBc,iBAAlB;AACH;;AAEMC,EAAAA,aAAa,GAAuB;AACvC,UAAMA,aAAa,GAAG,KAAKf,YAAL,CAAkBe,aAAxC;AACA,WAAOA,aAAa,CAAEC,MAAf,CAAsBD,aAAa,CAAEE,MAAf,GAAwB,CAA9C,MAAqD,GAArD,GAA2DF,aAA3D,GAA2EA,aAAa,GAAG,GAAlG;AACH;;AAEMG,EAAAA,KAAK,GAAuB;AAC/B,WAAO,KAAKlB,YAAL,CAAkBkB,KAAzB;AACH;;AAEMC,EAAAA,QAAQ,GAAoB;AAC/B,WAAO,IAAIC,OAAJ,CAAoB,CAACC,OAAD,EAAUC,MAAV,KAAqB;AAC5C,UAAI,KAAKtB,YAAL,CAAkBuB,KAAtB,EAA6B;AACzB,aAAKvB,YAAL,CACKwB,WADL,CACiB,CADjB,EAEKC,OAFL,CAEa,MAAM;AACXJ,UAAAA,OAAO,CAAC,KAAKrB,YAAL,CAAkBuB,KAAnB,CAAP;AACH,SAJL,EAKKG,KALL,CAKW,MAAM;AACTJ,UAAAA,MAAM,CAAC,yBAAD,CAAN;AACH,SAPL;AAQH,OATD,MASO;AACHA,QAAAA,MAAM,CAAC,eAAD,CAAN;AACH;AACJ,KAbM,CAAP;AAcH;;AAvDwB","sourcesContent":["/*\n * Copyright 2017 Red Hat, Inc. and/or its affiliates\n * and other contributors as indicated by the @author tags.\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 */\nimport Keycloak, { KeycloakLoginOptions } from \"../../../../../../../../../../adapters/oidc/js\";\n\ndeclare const baseUrl: string;\nexport type KeycloakClient = Keycloak;\n\nexport class KeycloakService {\n private keycloakAuth: KeycloakClient;\n\n public constructor(keycloak: KeycloakClient) {\n this.keycloakAuth = keycloak;\n }\n\n public authenticated(): boolean {\n return this.keycloakAuth.authenticated ? this.keycloakAuth.authenticated : false;\n }\n\n public audiencePresent(): boolean {\n if (this.keycloakAuth.tokenParsed) {\n const audience = this.keycloakAuth.tokenParsed['aud'];\n return audience === 'account' || (Array.isArray(audience) && audience.indexOf('account') >= 0);\n }\n return false;\n }\n\n public login(options?: KeycloakLoginOptions): void {\n this.keycloakAuth.login(options);\n }\n\n public logout(redirectUri: string = baseUrl): void {\n this.keycloakAuth.logout({redirectUri: redirectUri});\n }\n\n public account(): void {\n this.keycloakAuth.accountManagement();\n }\n\n public authServerUrl(): string | undefined {\n const authServerUrl = this.keycloakAuth.authServerUrl;\n return authServerUrl!.charAt(authServerUrl!.length - 1) === '/' ? authServerUrl : authServerUrl + '/';\n }\n\n public realm(): string | undefined {\n return this.keycloakAuth.realm;\n }\n\n public getToken(): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n if (this.keycloakAuth.token) {\n this.keycloakAuth\n .updateToken(5)\n .success(() => {\n resolve(this.keycloakAuth.token as string);\n })\n .error(() => {\n reject('Failed to refresh token');\n });\n } else {\n reject('Not logged in');\n }\n });\n }\n}\n"],"file":"keycloak.service.js"}
{"version":3,"file":"keycloak.service.js","names":["KeycloakService","constructor","keycloak","_defineProperty","keycloakAuth","authenticated","audiencePresent","tokenParsed","audience","Array","isArray","indexOf","login","options","logout","redirectUri","baseUrl","account","accountManagement","authServerUrl","charAt","length","realm","getToken","Promise","resolve","reject","token","updateToken","then","catch"],"sources":["../../src/app/keycloak-service/keycloak.service.ts"],"sourcesContent":["/*\n * Copyright 2017 Red Hat, Inc. and/or its affiliates\n * and other contributors as indicated by the @author tags.\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 */\nimport Keycloak, { KeycloakLoginOptions } from \"../../../../../../../../../../js/libs/keycloak-js\";\n\ndeclare const baseUrl: string;\nexport type KeycloakClient = Keycloak;\n\nexport class KeycloakService {\n private keycloakAuth: KeycloakClient;\n\n public constructor(keycloak: KeycloakClient) {\n this.keycloakAuth = keycloak;\n }\n\n public authenticated(): boolean {\n return this.keycloakAuth.authenticated ? this.keycloakAuth.authenticated : false;\n }\n\n public audiencePresent(): boolean {\n if (this.keycloakAuth.tokenParsed) {\n const audience = this.keycloakAuth.tokenParsed['aud'];\n return audience === 'account' || (Array.isArray(audience) && audience.indexOf('account') >= 0);\n }\n return false;\n }\n\n public login(options?: KeycloakLoginOptions): void {\n this.keycloakAuth.login(options);\n }\n\n public logout(redirectUri: string = baseUrl): void {\n this.keycloakAuth.logout({redirectUri: redirectUri});\n }\n\n public account(): void {\n this.keycloakAuth.accountManagement();\n }\n\n public authServerUrl(): string | undefined {\n const authServerUrl = this.keycloakAuth.authServerUrl;\n return authServerUrl!.charAt(authServerUrl!.length - 1) === '/' ? authServerUrl : authServerUrl + '/';\n }\n\n public realm(): string | undefined {\n return this.keycloakAuth.realm;\n }\n\n public getToken(): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n if (this.keycloakAuth.token) {\n this.keycloakAuth\n .updateToken(5)\n .then(() => {\n resolve(this.keycloakAuth.token as string);\n })\n .catch(() => {\n reject('Failed to refresh token');\n });\n } else {\n reject('Not logged in');\n }\n });\n }\n}\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAO,MAAMA,eAAe,CAAC;EAGlBC,WAAWA,CAACC,QAAwB,EAAE;IAAAC,eAAA;IACzC,IAAI,CAACC,YAAY,GAAGF,QAAQ;EAChC;EAEOG,aAAaA,CAAA,EAAY;IAC5B,OAAO,IAAI,CAACD,YAAY,CAACC,aAAa,GAAG,IAAI,CAACD,YAAY,CAACC,aAAa,GAAG,KAAK;EACpF;EAEOC,eAAeA,CAAA,EAAY;IAC9B,IAAI,IAAI,CAACF,YAAY,CAACG,WAAW,EAAE;MAC/B,MAAMC,QAAQ,GAAG,IAAI,CAACJ,YAAY,CAACG,WAAW,CAAC,KAAK,CAAC;MACrD,OAAOC,QAAQ,KAAK,SAAS,IAAKC,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,IAAIA,QAAQ,CAACG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAE;IAClG;IACA,OAAO,KAAK;EAChB;EAEOC,KAAKA,CAACC,OAA8B,EAAQ;IAC/C,IAAI,CAACT,YAAY,CAACQ,KAAK,CAACC,OAAO,CAAC;EACpC;EAEOC,MAAMA,CAACC,WAAmB,GAAGC,OAAO,EAAQ;IAC/C,IAAI,CAACZ,YAAY,CAACU,MAAM,CAAC;MAACC,WAAW,EAAEA;IAAW,CAAC,CAAC;EACxD;EAEOE,OAAOA,CAAA,EAAS;IACnB,IAAI,CAACb,YAAY,CAACc,iBAAiB,CAAC,CAAC;EACzC;EAEOC,aAAaA,CAAA,EAAuB;IACvC,MAAMA,aAAa,GAAG,IAAI,CAACf,YAAY,CAACe,aAAa;IACrD,OAAOA,aAAa,CAAEC,MAAM,CAACD,aAAa,CAAEE,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,GAAGF,aAAa,GAAGA,aAAa,GAAG,GAAG;EACzG;EAEOG,KAAKA,CAAA,EAAuB;IAC/B,OAAO,IAAI,CAAClB,YAAY,CAACkB,KAAK;EAClC;EAEOC,QAAQA,CAAA,EAAoB;IAC/B,OAAO,IAAIC,OAAO,CAAS,CAACC,OAAO,EAAEC,MAAM,KAAK;MAC5C,IAAI,IAAI,CAACtB,YAAY,CAACuB,KAAK,EAAE;QACzB,IAAI,CAACvB,YAAY,CACZwB,WAAW,CAAC,CAAC,CAAC,CACdC,IAAI,CAAC,MAAM;UACRJ,OAAO,CAAC,IAAI,CAACrB,YAAY,CAACuB,KAAe,CAAC;QAC9C,CAAC,CAAC,CACDG,KAAK,CAAC,MAAM;UACTJ,MAAM,CAAC,yBAAyB,CAAC;QACrC,CAAC,CAAC;MACV,CAAC,MAAM;QACHA,MAAM,CAAC,eAAe,CAAC;MAC3B;IACJ,CAAC,CAAC;EACN;AACJ"}
File diff suppressed because it is too large Load Diff
@@ -15,48 +15,6 @@
}
}
/* Linked Accounts screen */
.idp-icon-social {
width: 32px;
height: 32px;
}
#github-idp-icon-social {
background-image: url(../img/socialmedia/socialmedia_icons_github_transparent.svg);
}
#linkedin-idp-icon-social {
background-image: url(../img/socialmedia/socialmedia_icons_linkedin_transparent.svg);
}
#facebook-idp-icon-social {
background-image: url(../img/socialmedia/socialmedia_icons_facebook_transparent.svg);
}
#google-idp-icon-social {
background-image: url(../img/socialmedia/socialmedia_icons_google_transparent.svg);
}
#microsoft-idp-icon-social {
background-image: url(../img/socialmedia/socialmedia_icons_microsoft_transparent.svg);
}
#instagram-idp-icon-social {
background-image: url(../img/socialmedia/socialmedia_icons_instagram_transparent.svg);
}
#stackoverflow-idp-icon-social {
background-image: url(../img/socialmedia/socialmedia_icons_stack_transparent.svg);
}
#twitter-idp-icon-social {
background-image: url(../img/socialmedia/socialmedia_icons_twitter_transparent.svg);
}
#openshift-idp-icon-social {
background-image: url(../img/socialmedia/socialmedia_icons_openshift_transparent.svg);
}
/* Account Page screen */
.personal-info-form .pf-c-form__group-control {
max-width: 600px;
@@ -22,12 +22,10 @@ export class AIACommand {
this.keycloak = keycloak;
this.action = action;
}
execute() {
this.keycloak.login({
action: this.action
});
}
}
//# sourceMappingURL=AIACommand.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../src/app/util/AIACommand.ts"],"names":["AIACommand","constructor","keycloak","action","execute","login"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA,OAAO,MAAMA,UAAN,CAAiB;AAEpBC,EAAAA,WAAW,CAASC,QAAT,EAA4CC,MAA5C,EAA4D;AAAA,SAAnDD,QAAmD,GAAnDA,QAAmD;AAAA,SAAhBC,MAAgB,GAAhBA,MAAgB;AAAE;;AAElEC,EAAAA,OAAO,GAAS;AACnB,SAAKF,QAAL,CAAcG,KAAd,CAAoB;AAChBF,MAAAA,MAAM,EAAE,KAAKA;AADG,KAApB;AAIH;;AATmB","sourcesContent":["/*\n * Copyright 2019 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 {KeycloakService} from '../keycloak-service/keycloak.service';\n\n/**\n * @author Stan Silvert\n */\nexport class AIACommand {\n\n constructor(private keycloak: KeycloakService, private action: string) {}\n\n public execute(): void {\n this.keycloak.login({\n action: this.action,\n })\n\n }\n}"],"file":"AIACommand.js"}
{"version":3,"file":"AIACommand.js","names":["AIACommand","constructor","keycloak","action","execute","login"],"sources":["../../src/app/util/AIACommand.ts"],"sourcesContent":["/*\n * Copyright 2019 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 {KeycloakService} from '../keycloak-service/keycloak.service';\n\n/**\n * @author Stan Silvert\n */\nexport class AIACommand {\n\n constructor(private keycloak: KeycloakService, private action: string) {}\n\n public execute(): void {\n this.keycloak.login({\n action: this.action,\n })\n\n }\n}"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,CAAC;EAEpBC,WAAWA,CAASC,QAAyB,EAAUC,MAAc,EAAE;IAAA,KAAnDD,QAAyB,GAAzBA,QAAyB;IAAA,KAAUC,MAAc,GAAdA,MAAc;EAAG;EAEjEC,OAAOA,CAAA,EAAS;IACnB,IAAI,CAACF,QAAQ,CAACG,KAAK,CAAC;MAChBF,MAAM,EAAE,IAAI,CAACA;IACjB,CAAC,CAAC;EAEN;AACJ"}
@@ -6,14 +6,11 @@ function parse(linkHeader) {
if (!matcher) return {};
const linkUrl = matcher[1];
const rel = matcher[2].match(/\s*(.+)\s*=\s*"?([^"]+)"?/);
if (rel) {
acc[rel[2]] = linkUrl;
}
return acc;
}, {});
}
export default parse;
//# sourceMappingURL=ParseLink.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../src/app/util/ParseLink.ts"],"names":["parse","linkHeader","links","split","reduce","acc","link","matcher","match","linkUrl","rel"],"mappings":"AAMA,SAASA,KAAT,CAAeC,UAAf,EAAsD;AACpD,MAAI,CAACA,UAAL,EAAiB,OAAO,EAAP;AACjB,QAAMC,KAAK,GAAGD,UAAU,CAACE,KAAX,CAAiB,OAAjB,CAAd;AACA,SAAOD,KAAK,CAACE,MAAN,CAAoB,CAACC,GAAD,EAAaC,IAAb,KAAqC;AAC9D,UAAMC,OAAO,GAAGD,IAAI,CAACE,KAAL,CAAW,gBAAX,CAAhB;AACA,QAAI,CAACD,OAAL,EAAc,OAAO,EAAP;AACd,UAAME,OAAO,GAAGF,OAAO,CAAC,CAAD,CAAvB;AACA,UAAMG,GAAG,GAAGH,OAAO,CAAC,CAAD,CAAP,CAAWC,KAAX,CAAiB,2BAAjB,CAAZ;;AACA,QAAIE,GAAJ,EAAS;AACLL,MAAAA,GAAG,CAACK,GAAG,CAAC,CAAD,CAAJ,CAAH,GAAcD,OAAd;AACH;;AACD,WAAOJ,GAAP;AACD,GATM,EASJ,EATI,CAAP;AAUD;;AAED,eAAeL,KAAf","sourcesContent":["\nexport interface Links {\n prev?: string;\n next?: string;\n}\n\nfunction parse(linkHeader: string | undefined): Links {\n if (!linkHeader) return {};\n const links = linkHeader.split(/,\\s*</);\n return links.reduce<Links>((acc: Links, link: string): Links => {\n const matcher = link.match(/<?([^>]*)>(.*)/);\n if (!matcher) return {};\n const linkUrl = matcher[1];\n const rel = matcher[2].match(/\\s*(.+)\\s*=\\s*\"?([^\"]+)\"?/);\n if (rel) {\n acc[rel[2]] = linkUrl;\n }\n return acc;\n }, {});\n}\n\nexport default parse;"],"file":"ParseLink.js"}
{"version":3,"file":"ParseLink.js","names":["parse","linkHeader","links","split","reduce","acc","link","matcher","match","linkUrl","rel"],"sources":["../../src/app/util/ParseLink.ts"],"sourcesContent":["\nexport interface Links {\n prev?: string;\n next?: string;\n}\n\nfunction parse(linkHeader: string | undefined): Links {\n if (!linkHeader) return {};\n const links = linkHeader.split(/,\\s*</);\n return links.reduce<Links>((acc: Links, link: string): Links => {\n const matcher = link.match(/<?([^>]*)>(.*)/);\n if (!matcher) return {};\n const linkUrl = matcher[1];\n const rel = matcher[2].match(/\\s*(.+)\\s*=\\s*\"?([^\"]+)\"?/);\n if (rel) {\n acc[rel[2]] = linkUrl;\n }\n return acc;\n }, {});\n}\n\nexport default parse;"],"mappings":"AAMA,SAASA,KAAKA,CAACC,UAA8B,EAAS;EACpD,IAAI,CAACA,UAAU,EAAE,OAAO,CAAC,CAAC;EAC1B,MAAMC,KAAK,GAAGD,UAAU,CAACE,KAAK,CAAC,OAAO,CAAC;EACvC,OAAOD,KAAK,CAACE,MAAM,CAAQ,CAACC,GAAU,EAAEC,IAAY,KAAY;IAC9D,MAAMC,OAAO,GAAGD,IAAI,CAACE,KAAK,CAAC,gBAAgB,CAAC;IAC5C,IAAI,CAACD,OAAO,EAAE,OAAO,CAAC,CAAC;IACvB,MAAME,OAAO,GAAGF,OAAO,CAAC,CAAC,CAAC;IAC1B,MAAMG,GAAG,GAAGH,OAAO,CAAC,CAAC,CAAC,CAACC,KAAK,CAAC,2BAA2B,CAAC;IACzD,IAAIE,GAAG,EAAE;MACLL,GAAG,CAACK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAGD,OAAO;IACzB;IACA,OAAOJ,GAAG;EACZ,CAAC,EAAE,CAAC,CAAC,CAAC;AACR;AAEA,eAAeL,KAAK"}
@@ -24,7 +24,6 @@
*/
export const createRedirect = currentLocation => {
let redirectUri = baseUrl;
if (typeof referrer !== 'undefined') {
// '_hash_' is a workaround for when uri encoding is not
// sufficient to escape the # character properly.
@@ -33,7 +32,6 @@ export const createRedirect = currentLocation => {
// it sees the hash in the redirect param and stops.
redirectUri += "?referrer=" + referrer + "&referrer_uri=" + referrerUri.replace('#', '_hash_');
}
return encodeURIComponent(redirectUri) + encodeURIComponent("/#" + currentLocation);
};
//# sourceMappingURL=RedirectUri.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../src/app/util/RedirectUri.ts"],"names":["createRedirect","currentLocation","redirectUri","baseUrl","referrer","referrerUri","replace","encodeURIComponent"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,cAAc,GAAIC,eAAD,IAAqC;AAC/D,MAAIC,WAAmB,GAAGC,OAA1B;;AAEA,MAAI,OAAOC,QAAP,KAAoB,WAAxB,EAAqC;AACjC;AACA;AACA;AACA;AACA;AACAF,IAAAA,WAAW,IAAI,eAAeE,QAAf,GAA0B,gBAA1B,GAA6CC,WAAW,CAACC,OAAZ,CAAoB,GAApB,EAAyB,QAAzB,CAA5D;AACH;;AAED,SAAOC,kBAAkB,CAACL,WAAD,CAAlB,GAAkCK,kBAAkB,CAAC,OAAON,eAAR,CAA3D;AACH,CAbM","sourcesContent":["/*\n * Copyright 2019 Red Hat, Inc. and/or its affiliates\n * and other contributors as indicated by the @author tags.\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\ndeclare const baseUrl: string;\ndeclare const referrer: string;\ndeclare const referrerUri: string;\n\n/**\n * Create a redirect uri that can return to this application with referrer and referrer_uri intact.\n * \n * @param currentLocation The ReactRouter location to return to.\n * \n * @author Stan Silvert\n */\nexport const createRedirect = (currentLocation: string): string => {\n let redirectUri: string = baseUrl;\n \n if (typeof referrer !== 'undefined') {\n // '_hash_' is a workaround for when uri encoding is not\n // sufficient to escape the # character properly.\n // The problem is that both the redirect and the application URL contain a hash.\n // The browser will consider anything after the first hash to be client-side. So\n // it sees the hash in the redirect param and stops.\n redirectUri += \"?referrer=\" + referrer + \"&referrer_uri=\" + referrerUri.replace('#', '_hash_');\n }\n\n return encodeURIComponent(redirectUri) + encodeURIComponent(\"/#\" + currentLocation); \n}"],"file":"RedirectUri.js"}
{"version":3,"file":"RedirectUri.js","names":["createRedirect","currentLocation","redirectUri","baseUrl","referrer","referrerUri","replace","encodeURIComponent"],"sources":["../../src/app/util/RedirectUri.ts"],"sourcesContent":["/*\n * Copyright 2019 Red Hat, Inc. and/or its affiliates\n * and other contributors as indicated by the @author tags.\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\ndeclare const baseUrl: string;\ndeclare const referrer: string;\ndeclare const referrerUri: string;\n\n/**\n * Create a redirect uri that can return to this application with referrer and referrer_uri intact.\n * \n * @param currentLocation The ReactRouter location to return to.\n * \n * @author Stan Silvert\n */\nexport const createRedirect = (currentLocation: string): string => {\n let redirectUri: string = baseUrl;\n \n if (typeof referrer !== 'undefined') {\n // '_hash_' is a workaround for when uri encoding is not\n // sufficient to escape the # character properly.\n // The problem is that both the redirect and the application URL contain a hash.\n // The browser will consider anything after the first hash to be client-side. So\n // it sees the hash in the redirect param and stops.\n redirectUri += \"?referrer=\" + referrer + \"&referrer_uri=\" + referrerUri.replace('#', '_hash_');\n }\n\n return encodeURIComponent(redirectUri) + encodeURIComponent(\"/#\" + currentLocation); \n}"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,cAAc,GAAIC,eAAuB,IAAa;EAC/D,IAAIC,WAAmB,GAAGC,OAAO;EAEjC,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;IACjC;IACA;IACA;IACA;IACA;IACAF,WAAW,IAAI,YAAY,GAAGE,QAAQ,GAAG,gBAAgB,GAAGC,WAAW,CAACC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC;EAClG;EAEA,OAAOC,kBAAkB,CAACL,WAAW,CAAC,GAAGK,kBAAkB,CAAC,IAAI,GAAGN,eAAe,CAAC;AACvF,CAAC"}
@@ -1,5 +1,6 @@
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2020 Red Hat, Inc. and/or its affiliates.
*
@@ -28,9 +29,7 @@ class TimeUtil {
hour: 'numeric',
minute: 'numeric'
});
_defineProperty(this, "formatter", void 0);
try {
this.formatter = new Intl.DateTimeFormat(locale, this.options);
} catch (e) {
@@ -38,13 +37,10 @@ class TimeUtil {
this.formatter = new Intl.DateTimeFormat('en', this.options);
}
}
format(time) {
return this.formatter.format(time);
}
}
const TimeUtilInstance = new TimeUtil();
export default TimeUtilInstance;
//# sourceMappingURL=TimeUtil.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../src/app/util/TimeUtil.ts"],"names":["TimeUtil","constructor","year","month","day","hour","minute","formatter","Intl","DateTimeFormat","locale","options","e","format","time","TimeUtilInstance"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA,MAAMA,QAAN,CAAe;AAIXC,EAAAA,WAAW,GAAG;AAAA,qCAHI;AAAEC,MAAAA,IAAI,EAAE,SAAR;AAAmBC,MAAAA,KAAK,EAAE,MAA1B;AAAkCC,MAAAA,GAAG,EAAE,SAAvC;AAAkDC,MAAAA,IAAI,EAAE,SAAxD;AAAmEC,MAAAA,MAAM,EAAE;AAA3E,KAGJ;;AAAA;;AACV,QAAI;AACA,WAAKC,SAAL,GAAiB,IAAIC,IAAI,CAACC,cAAT,CAAwBC,MAAxB,EAAgC,KAAKC,OAArC,CAAjB;AACH,KAFD,CAEE,OAAMC,CAAN,EAAS;AACP;AACA,WAAKL,SAAL,GAAiB,IAAIC,IAAI,CAACC,cAAT,CAAwB,IAAxB,EAA8B,KAAKE,OAAnC,CAAjB;AACH;AACJ;;AAEDE,EAAAA,MAAM,CAACC,IAAD,EAAuB;AACzB,WAAO,KAAKP,SAAL,CAAeM,MAAf,CAAsBC,IAAtB,CAAP;AACH;;AAfU;;AAkBf,MAAMC,gBAA0B,GAAG,IAAIf,QAAJ,EAAnC;AACA,eAAee,gBAAf","sourcesContent":["/*\n * Copyright 2020 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\ndeclare const locale: string;\n\n/**\n * @author Stan Silvert\n */\nclass TimeUtil {\n private options = { year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' };\n private formatter: Intl.DateTimeFormat;\n\n constructor() {\n try {\n this.formatter = new Intl.DateTimeFormat(locale, this.options);\n } catch(e) {\n // unknown locale falling back to English\n this.formatter = new Intl.DateTimeFormat('en', this.options);\n }\n }\n\n format(time: number): string {\n return this.formatter.format(time);\n }\n}\n\nconst TimeUtilInstance: TimeUtil = new TimeUtil();\nexport default TimeUtilInstance as TimeUtil;"],"file":"TimeUtil.js"}
{"version":3,"file":"TimeUtil.js","names":["TimeUtil","constructor","_defineProperty","year","month","day","hour","minute","formatter","Intl","DateTimeFormat","locale","options","e","format","time","TimeUtilInstance"],"sources":["../../src/app/util/TimeUtil.ts"],"sourcesContent":["/*\n * Copyright 2020 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\ndeclare const locale: string;\n\n/**\n * @author Stan Silvert\n */\nclass TimeUtil {\n private options: Intl.DateTimeFormatOptions = { year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' };\n private formatter: Intl.DateTimeFormat;\n\n constructor() {\n try {\n this.formatter = new Intl.DateTimeFormat(locale, this.options);\n } catch(e) {\n // unknown locale falling back to English\n this.formatter = new Intl.DateTimeFormat('en', this.options);\n }\n }\n\n format(time: number): string {\n return this.formatter.format(time);\n }\n}\n\nconst TimeUtilInstance: TimeUtil = new TimeUtil();\nexport default TimeUtilInstance as TimeUtil;"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA,MAAMA,QAAQ,CAAC;EAIXC,WAAWA,CAAA,EAAG;IAAAC,eAAA,kBAHgC;MAAEC,IAAI,EAAE,SAAS;MAAEC,KAAK,EAAE,MAAM;MAAEC,GAAG,EAAE,SAAS;MAAEC,IAAI,EAAE,SAAS;MAAEC,MAAM,EAAE;IAAU,CAAC;IAAAL,eAAA;IAIhI,IAAI;MACA,IAAI,CAACM,SAAS,GAAG,IAAIC,IAAI,CAACC,cAAc,CAACC,MAAM,EAAE,IAAI,CAACC,OAAO,CAAC;IAClE,CAAC,CAAC,OAAMC,CAAC,EAAE;MACP;MACA,IAAI,CAACL,SAAS,GAAG,IAAIC,IAAI,CAACC,cAAc,CAAC,IAAI,EAAE,IAAI,CAACE,OAAO,CAAC;IAChE;EACJ;EAEAE,MAAMA,CAACC,IAAY,EAAU;IACzB,OAAO,IAAI,CAACP,SAAS,CAACM,MAAM,CAACC,IAAI,CAAC;EACtC;AACJ;AAEA,MAAMC,gBAA0B,GAAG,IAAIhB,QAAQ,CAAC,CAAC;AACjD,eAAegB,gBAAgB"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
function n(...o){const r=[],e={}.hasOwnProperty;return o.filter(Boolean).forEach(o=>{const t=typeof o;if("string"===t||"number"===t)r.push(o);else if(Array.isArray(o)&&o.length){const e=n(...o);e&&r.push(e)}else if("object"===t)for(const n in o)e.call(o,n)&&o[n]&&r.push(n)}),r.join(" ")}export{n as css};
//# sourceMappingURL=react-styles.js.map
@@ -0,0 +1 @@
{"version":3,"file":"react-styles.js","sources":["../../node_modules/.pnpm/@patternfly+react-styles@4.92.8/node_modules/@patternfly/react-styles/dist/esm/index.js"],"sourcesContent":["/** Joins args into a className string\n *\n * @param {any} args list of objects, string, or arrays to reduce\n */\nexport function css(...args) {\n // Adapted from https://github.com/JedWatson/classnames/blob/master/index.js\n const classes = [];\n const hasOwn = {}.hasOwnProperty;\n args.filter(Boolean).forEach((arg) => {\n const argType = typeof arg;\n if (argType === 'string' || argType === 'number') {\n classes.push(arg);\n }\n else if (Array.isArray(arg) && arg.length) {\n const inner = css(...arg);\n if (inner) {\n classes.push(inner);\n }\n }\n else if (argType === 'object') {\n for (const key in arg) {\n if (hasOwn.call(arg, key) && arg[key]) {\n classes.push(key);\n }\n }\n }\n });\n return classes.join(' ');\n}\n//# sourceMappingURL=index.js.map"],"names":["css","args","classes","hasOwn","hasOwnProperty","filter","Boolean","forEach","arg","argType","push","Array","isArray","length","inner","key","call","join"],"mappings":"AAIO,SAASA,KAAOC,GAEnB,MAAMC,EAAU,GACVC,EAAS,GAAGC,eAoBlB,OAnBAH,EAAKI,OAAOC,SAASC,QAASC,IAC1B,MAAMC,SAAiBD,EACvB,GAAgB,WAAZC,GAAoC,WAAZA,EACxBP,EAAQQ,KAAKF,QAEZ,GAAIG,MAAMC,QAAQJ,IAAQA,EAAIK,OAAQ,CACvC,MAAMC,EAAQd,KAAOQ,GACjBM,GACAZ,EAAQQ,KAAKI,QAGhB,GAAgB,WAAZL,EACL,IAAK,MAAMM,KAAOP,EACVL,EAAOa,KAAKR,EAAKO,IAAQP,EAAIO,IAC7Bb,EAAQQ,KAAKK,KAKtBb,EAAQe,KAAK"}
@@ -0,0 +1,2 @@
function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function t(e,t){return e(t={exports:{}},t.exports),t.exports}function r(){}function n(){}n.resetWarningCache=r;var o=function(){function e(e,t,r,n,o,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}function t(){return e}e.isRequired=e;var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:n,resetWarningCache:r};return o.PropTypes=o,o},a=t((function(e){e.exports=o()}));export{a as P,t as c,e as u};
//# sourceMappingURL=index-e491ad49.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index-e491ad49.js","sources":["../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js","../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js","../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js"],"sourcesContent":["/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n"],"names":["emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","props","propName","componentName","location","propFullName","secret","err","Error","name","getShim","isRequired","ReactPropTypes","array","bigint","bool","func","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","module","exports","require$$0"],"mappings":"iKAWA,SAASA,KACT,SAASC,KACTA,EAAuBC,kBAAoBF,EAE3C,MAAiB,WACf,SAASG,EAAKC,EAAOC,EAAUC,EAAeC,EAAUC,EAAcC,GACpE,GCRuB,iDDQnBA,EAAJ,CAIA,IAAIC,EAAM,IAAIC,MACZ,mLAKF,MADAD,EAAIE,KAAO,sBACLF,GAGR,SAASG,IACP,OAAOV,EAFTA,EAAKW,WAAaX,EAMlB,IAAIY,EAAiB,CACnBC,MAAOb,EACPc,OAAQd,EACRe,KAAMf,EACNgB,KAAMhB,EACNiB,OAAQjB,EACRkB,OAAQlB,EACRmB,OAAQnB,EACRoB,OAAQpB,EAERqB,IAAKrB,EACLsB,QAASZ,EACTa,QAASvB,EACTwB,YAAaxB,EACbyB,WAAYf,EACZgB,KAAM1B,EACN2B,SAAUjB,EACVkB,MAAOlB,EACPmB,UAAWnB,EACXoB,MAAOpB,EACPqB,MAAOrB,EAEPsB,eAAgBlC,EAChBC,kBAAmBF,GAKrB,OAFAe,EAAeqB,UAAYrB,EAEpBA,oBE9CPsB,EAAcC,QAAGC"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
{
"imports": {
"@patternfly/react-core": "./@patternfly/react-core.js",
"@patternfly/react-icons": "./@patternfly/react-icons.js",
"@patternfly/react-styles": "./@patternfly/react-styles.js",
"react": "./react.js",
"react-dom": "./react-dom.js",
"react-router-dom": "./react-router-dom.js"
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
@@ -17,9 +17,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../common/keycloak/web_modules/react.js";
import { Modal, ModalVariant, Button } from "../../../common/keycloak/web_modules/@patternfly/react-core.js";
import * as React from "../../keycloak.v2/web_modules/react.js";
import { Modal, ModalVariant, Button } from "../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { Msg } from "./Msg.js";
/**
* For any of these properties that are strings, you can
* pass in a localization key instead of a static string.
@@ -34,7 +36,6 @@ import { Msg } from "./Msg.js";
export class ContinueCancelModal extends React.Component {
constructor(props) {
super(props);
_defineProperty(this, "handleModalToggle", () => {
this.setState(({
isModalOpen
@@ -43,17 +44,14 @@ export class ContinueCancelModal extends React.Component {
}));
if (this.props.onClose) this.props.onClose();
});
_defineProperty(this, "handleContinue", () => {
this.handleModalToggle();
this.props.onContinue();
});
this.state = {
isModalOpen: false
};
}
render() {
const {
isModalOpen
@@ -89,15 +87,12 @@ export class ContinueCancelModal extends React.Component {
msgKey: this.props.modalMessage
})));
}
}
_defineProperty(ContinueCancelModal, "defaultProps", {
buttonVariant: 'primary',
modalContinueButtonLabel: 'continue',
modalCancelButtonLabel: 'doCancel',
isDisabled: false
});
;
//# sourceMappingURL=ContinueCancelModal.js.map
File diff suppressed because one or more lines are too long
@@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../common/keycloak/web_modules/react.js";
import { EmptyState, EmptyStateVariant, Title, EmptyStateIcon, EmptyStateBody } from "../../../common/keycloak/web_modules/@patternfly/react-core.js";
import * as React from "../../keycloak.v2/web_modules/react.js";
import { EmptyState, EmptyStateVariant, Title, EmptyStateIcon, EmptyStateBody } from "../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { Msg } from "./Msg.js";
export default class EmptyMessageState extends React.Component {
constructor(props) {
super(props);
}
render() {
return /*#__PURE__*/React.createElement(EmptyState, {
variant: EmptyStateVariant.full
@@ -33,6 +33,5 @@ export default class EmptyMessageState extends React.Component {
msgKey: this.props.messageKey
})), /*#__PURE__*/React.createElement(EmptyStateBody, null, this.props.children));
}
}
//# sourceMappingURL=EmptyMessageState.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../src/app/widgets/EmptyMessageState.tsx"],"names":["React","EmptyState","EmptyStateVariant","Title","EmptyStateIcon","EmptyStateBody","Msg","EmptyMessageState","Component","constructor","props","render","full","icon","messageKey","children"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ;AACA,SACIC,UADJ,EAEIC,iBAFJ,EAGIC,KAHJ,EAIIC,cAJJ,EAKIC,cALJ;AAQA,SAASC,GAAT;AAQA,eAAe,MAAMC,iBAAN,SAAgCP,KAAK,CAACQ,SAAtC,CAA4E;AACvFC,EAAAA,WAAW,CAACC,KAAD,EAAgC;AACvC,UAAMA,KAAN;AACH;;AAEDC,EAAAA,MAAM,GAAG;AACL,wBACI,oBAAC,UAAD;AAAY,MAAA,OAAO,EAAET,iBAAiB,CAACU;AAAvC,oBACI,oBAAC,cAAD;AAAgB,MAAA,IAAI,EAAE,KAAKF,KAAL,CAAWG;AAAjC,MADJ,eAEI,oBAAC,KAAD;AAAO,MAAA,YAAY,EAAC,IAApB;AAAyB,MAAA,IAAI,EAAC;AAA9B,oBACI,oBAAC,GAAD;AAAK,MAAA,MAAM,EAAE,KAAKH,KAAL,CAAWI;AAAxB,MADJ,CAFJ,eAKI,oBAAC,cAAD,QACK,KAAKJ,KAAL,CAAWK,QADhB,CALJ,CADJ;AAWH;;AAjBsF","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';\nimport {\n EmptyState,\n EmptyStateVariant,\n Title,\n EmptyStateIcon,\n EmptyStateBody,\n} from '@patternfly/react-core'\n\nimport { Msg } from './Msg';\nimport {SVGIconProps} from '@patternfly/react-icons/dist/esm/createIcon';\n\nexport interface EmptyMessageStateProps {\n icon: React.ComponentType<SVGIconProps>;\n messageKey: string;\n}\n\nexport default class EmptyMessageState extends React.Component<EmptyMessageStateProps, {}> {\n constructor(props: EmptyMessageStateProps) {\n super(props);\n }\n\n render() {\n return (\n <EmptyState variant={EmptyStateVariant.full}>\n <EmptyStateIcon icon={this.props.icon} />\n <Title headingLevel=\"h5\" size=\"lg\">\n <Msg msgKey={this.props.messageKey} />\n </Title>\n <EmptyStateBody>\n {this.props.children}\n </EmptyStateBody>\n </EmptyState>\n );\n }\n}\n"],"file":"EmptyMessageState.js"}
{"version":3,"file":"EmptyMessageState.js","names":["React","EmptyState","EmptyStateVariant","Title","EmptyStateIcon","EmptyStateBody","Msg","EmptyMessageState","Component","constructor","props","render","createElement","variant","full","icon","headingLevel","size","msgKey","messageKey","children"],"sources":["../../src/app/widgets/EmptyMessageState.tsx"],"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';\nimport {\n EmptyState,\n EmptyStateVariant,\n Title,\n EmptyStateIcon,\n EmptyStateBody,\n} from '@patternfly/react-core'\n\nimport { Msg } from './Msg';\nimport {SVGIconProps} from '@patternfly/react-icons/dist/esm/createIcon';\n\nexport interface EmptyMessageStateProps {\n icon: React.ComponentType<SVGIconProps>;\n messageKey: string;\n}\n\nexport default class EmptyMessageState extends React.Component<EmptyMessageStateProps, {}> {\n constructor(props: EmptyMessageStateProps) {\n super(props);\n }\n\n render() {\n return (\n <EmptyState variant={EmptyStateVariant.full}>\n <EmptyStateIcon icon={this.props.icon} />\n <Title headingLevel=\"h5\" size=\"lg\">\n <Msg msgKey={this.props.messageKey} />\n </Title>\n <EmptyStateBody>\n {this.props.children}\n </EmptyStateBody>\n </EmptyState>\n );\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK;AACjB,SACIC,UAAU,EACVC,iBAAiB,EACjBC,KAAK,EACLC,cAAc,EACdC,cAAc;AAGlB,SAASC,GAAG;AAQZ,eAAe,MAAMC,iBAAiB,SAASP,KAAK,CAACQ,SAAS,CAA6B;EACvFC,WAAWA,CAACC,KAA6B,EAAE;IACvC,KAAK,CAACA,KAAK,CAAC;EAChB;EAEAC,MAAMA,CAAA,EAAG;IACL,oBACIX,KAAA,CAAAY,aAAA,CAACX,UAAU;MAACY,OAAO,EAAEX,iBAAiB,CAACY;IAAK,gBACxCd,KAAA,CAAAY,aAAA,CAACR,cAAc;MAACW,IAAI,EAAE,IAAI,CAACL,KAAK,CAACK;IAAK,CAAE,CAAC,eACzCf,KAAA,CAAAY,aAAA,CAACT,KAAK;MAACa,YAAY,EAAC,IAAI;MAACC,IAAI,EAAC;IAAI,gBAC9BjB,KAAA,CAAAY,aAAA,CAACN,GAAG;MAACY,MAAM,EAAE,IAAI,CAACR,KAAK,CAACS;IAAW,CAAE,CAClC,CAAC,eACRnB,KAAA,CAAAY,aAAA,CAACP,cAAc,QACV,IAAI,CAACK,KAAK,CAACU,QACA,CACR,CAAC;EAErB;AACJ"}
@@ -13,15 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../common/keycloak/web_modules/react.js";
import { FormSelect, FormSelectOption } from "../../../common/keycloak/web_modules/@patternfly/react-core.js";
import * as React from "../../keycloak.v2/web_modules/react.js";
import { FormSelect, FormSelectOption } from "../../keycloak.v2/web_modules/@patternfly/react-core.js";
import { Msg } from "./Msg.js";
;
export class LocaleSelector extends React.Component {
constructor(props) {
super(props);
}
render() {
return /*#__PURE__*/React.createElement(FormSelect, {
id: "locale-select",
@@ -36,6 +35,5 @@ export class LocaleSelector extends React.Component {
label: locale.label
})));
}
}
//# sourceMappingURL=LocaleSelectors.js.map
@@ -1 +1 @@
{"version":3,"sources":["../../src/app/widgets/LocaleSelectors.tsx"],"names":["React","FormSelect","FormSelectOption","Msg","LocaleSelector","Component","constructor","props","render","value","event","onChange","localize","availableLocales","map","locale","index","label"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,KAAZ;AAEA,SACIC,UADJ,EAEIC,gBAFJ;AAKA,SAASC,GAAT;AAKC;AAKD,OAAO,MAAMC,cAAN,SAA6BJ,KAAK,CAACK,SAAnC,CAAuF;AAE1FC,EAAAA,WAAW,CAACC,KAAD,EAA6B;AACpC,UAAMA,KAAN;AACH;;AAEDC,EAAAA,MAAM,GAAoB;AACtB,wBACI,oBAAC,UAAD;AACI,MAAA,EAAE,EAAC,eADP;AAEI,MAAA,KAAK,EAAE,KAAKD,KAAL,CAAWE,KAFtB;AAGI,MAAA,QAAQ,EAAE,CAACA,KAAD,EAAQC,KAAR,KAAkB;AAAE,YAAI,KAAKH,KAAL,CAAWI,QAAf,EAAyB,KAAKJ,KAAL,CAAWI,QAAX,CAAoBF,KAApB,EAA2BC,KAA3B;AAAmC,OAH9F;AAII,oBAAYP,GAAG,CAACS,QAAJ,CAAa,cAAb;AAJhB,OAMKC,gBAAgB,CAACC,GAAjB,CAAqB,CAACC,MAAD,EAASC,KAAT,kBAClB,oBAAC,gBAAD;AACI,MAAA,GAAG,EAAEA,KADT;AAEI,MAAA,KAAK,EAAED,MAAM,CAACA,MAFlB;AAGI,MAAA,KAAK,EAAEA,MAAM,CAACE;AAHlB,MADH,CANL,CADJ;AAgBH;;AAvByF","sourcesContent":["/*\n * Copyright 2019 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 */\nimport * as React from 'react';\n\nimport {\n FormSelect,\n FormSelectOption,\n FormSelectProps\n} from '@patternfly/react-core';\nimport { Msg } from './Msg';\n\ninterface AvailableLocale {\n locale: string;\n label: string;\n};\ndeclare const availableLocales: [AvailableLocale];\n\ninterface LocaleSelectorProps extends Omit<FormSelectProps, 'children'> { }\ninterface LocaleSelectorState { }\nexport class LocaleSelector extends React.Component<LocaleSelectorProps, LocaleSelectorState> {\n\n constructor(props: LocaleSelectorProps) {\n super(props);\n }\n\n render(): React.ReactNode {\n return (\n <FormSelect\n id=\"locale-select\"\n value={this.props.value}\n onChange={(value, event) => { if (this.props.onChange) this.props.onChange(value, event) }}\n aria-label={Msg.localize('selectLocale')}\n >\n {availableLocales.map((locale, index) =>\n <FormSelectOption\n key={index}\n value={locale.locale}\n label={locale.label}\n />)\n }\n </FormSelect>\n );\n }\n}"],"file":"LocaleSelectors.js"}
{"version":3,"file":"LocaleSelectors.js","names":["React","FormSelect","FormSelectOption","Msg","LocaleSelector","Component","constructor","props","render","createElement","id","value","onChange","event","localize","availableLocales","map","locale","index","key","label"],"sources":["../../src/app/widgets/LocaleSelectors.tsx"],"sourcesContent":["/*\n * Copyright 2019 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 */\nimport * as React from 'react';\n\nimport {\n FormSelect,\n FormSelectOption,\n FormSelectProps\n} from '@patternfly/react-core';\nimport { Msg } from './Msg';\n\ninterface AvailableLocale {\n locale: string;\n label: string;\n};\ndeclare const availableLocales: [AvailableLocale];\n\ninterface LocaleSelectorProps extends Omit<FormSelectProps, 'children'> { }\ninterface LocaleSelectorState { }\nexport class LocaleSelector extends React.Component<LocaleSelectorProps, LocaleSelectorState> {\n\n constructor(props: LocaleSelectorProps) {\n super(props);\n }\n\n render(): React.ReactNode {\n return (\n <FormSelect\n id=\"locale-select\"\n value={this.props.value}\n onChange={(value, event) => { if (this.props.onChange) this.props.onChange(value, event) }}\n aria-label={Msg.localize('selectLocale')}\n >\n {availableLocales.map((locale, index) =>\n <FormSelectOption\n key={index}\n value={locale.locale}\n label={locale.label}\n />)\n }\n </FormSelect>\n );\n }\n}"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,KAAK;AAEjB,SACIC,UAAU,EACVC,gBAAgB;AAGpB,SAASC,GAAG;AAKX;AAKD,OAAO,MAAMC,cAAc,SAASJ,KAAK,CAACK,SAAS,CAA2C;EAE1FC,WAAWA,CAACC,KAA0B,EAAE;IACpC,KAAK,CAACA,KAAK,CAAC;EAChB;EAEAC,MAAMA,CAAA,EAAoB;IACtB,oBACIR,KAAA,CAAAS,aAAA,CAACR,UAAU;MACPS,EAAE,EAAC,eAAe;MAClBC,KAAK,EAAE,IAAI,CAACJ,KAAK,CAACI,KAAM;MACxBC,QAAQ,EAAEA,CAACD,KAAK,EAAEE,KAAK,KAAK;QAAE,IAAI,IAAI,CAACN,KAAK,CAACK,QAAQ,EAAE,IAAI,CAACL,KAAK,CAACK,QAAQ,CAACD,KAAK,EAAEE,KAAK,CAAC;MAAC,CAAE;MAC3F,cAAYV,GAAG,CAACW,QAAQ,CAAC,cAAc;IAAE,GAExCC,gBAAgB,CAACC,GAAG,CAAC,CAACC,MAAM,EAAEC,KAAK,kBAChClB,KAAA,CAAAS,aAAA,CAACP,gBAAgB;MACbiB,GAAG,EAAED,KAAM;MACXP,KAAK,EAAEM,MAAM,CAACA,MAAO;MACrBG,KAAK,EAAEH,MAAM,CAACG;IAAM,CACvB,CAAC,CAEE,CAAC;EAErB;AACJ"}
@@ -13,15 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../common/keycloak/web_modules/react.js";
import * as React from "../../keycloak.v2/web_modules/react.js";
import { Msg } from "./Msg.js";
import { KeycloakContext } from "../keycloak-service/KeycloakContext.js";
import { Button, DropdownItem } from "../../../common/keycloak/web_modules/@patternfly/react-core.js";
import { Button, DropdownItem } from "../../keycloak.v2/web_modules/@patternfly/react-core.js";
function handleLogout(keycloak) {
keycloak.logout();
}
export class LogoutButton extends React.Component {
render() {
return /*#__PURE__*/React.createElement(KeycloakContext.Consumer, null, keycloak => /*#__PURE__*/React.createElement(Button, {
@@ -31,7 +30,6 @@ export class LogoutButton extends React.Component {
msgKey: "doSignOut"
})));
}
}
export class LogoutDropdownItem extends React.Component {
render() {
@@ -41,6 +39,5 @@ export class LogoutDropdownItem extends React.Component {
onClick: () => handleLogout(keycloak)
}, Msg.localize('doSignOut')));
}
}
//# sourceMappingURL=Logout.js.map
@@ -1 +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,wBACI,oBAAC,eAAD,CAAiB,QAAjB,QACEJ,QAAQ,iBACN,oBAAC,MAAD;AAAQ,MAAA,EAAE,EAAC,eAAX;AAA2B,MAAA,OAAO,EAAE,MAAMD,YAAY,CAACC,QAAD;AAAtD,oBAAmE,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,wBACI,oBAAC,eAAD,CAAiB,QAAjB,QACMJ,QAAQ,iBACV,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"}
{"version":3,"file":"Logout.js","names":["React","Msg","KeycloakContext","Button","DropdownItem","handleLogout","keycloak","logout","LogoutButton","Component","render","createElement","Consumer","id","onClick","msgKey","LogoutDropdownItem","key","localize"],"sources":["../../src/app/widgets/Logout.tsx"],"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}"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,KAAK;AAEjB,SAAQC,GAAG;AAEX,SAASC,eAAe;AAExB,SAAQC,MAAM,EAAEC,YAAY;AAE5B,SAASC,YAAYA,CAACC,QAAyB,EAAQ;EACnDA,QAAQ,CAACC,MAAM,CAAC,CAAC;AACrB;AAGA,OAAO,MAAMC,YAAY,SAASR,KAAK,CAACS,SAAS,CAAc;EACpDC,MAAMA,CAAA,EAAoB;IAC7B,oBACIV,KAAA,CAAAW,aAAA,CAACT,eAAe,CAACU,QAAQ,QACvBN,QAAQ,iBACNN,KAAA,CAAAW,aAAA,CAACR,MAAM;MAACU,EAAE,EAAC,eAAe;MAACC,OAAO,EAAEA,CAAA,KAAMT,YAAY,CAACC,QAAS;IAAE,gBAACN,KAAA,CAAAW,aAAA,CAACV,GAAG;MAACc,MAAM,EAAC;IAAW,CAAC,CAAS,CAE9E,CAAC;EAGnC;AACJ;AAGA,OAAO,MAAMC,kBAAkB,SAAShB,KAAK,CAACS,SAAS,CAA0B;EACtEC,MAAMA,CAAA,EAAoB;IAC7B,oBACIV,KAAA,CAAAW,aAAA,CAACT,eAAe,CAACU,QAAQ,QACnBN,QAAQ,iBACVN,KAAA,CAAAW,aAAA,CAACP,YAAY;MAACS,EAAE,EAAC,aAAa;MAACI,GAAG,EAAC,QAAQ;MAACH,OAAO,EAAEA,CAAA,KAAMT,YAAY,CAACC,QAAS;IAAE,GAC9EL,GAAG,CAACiB,QAAQ,CAAC,WAAW,CACf,CAEQ,CAAC;EAEnC;AACJ"}
@@ -13,57 +13,53 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as React from "../../../common/keycloak/web_modules/react.js";
import * as React from "../../keycloak.v2/web_modules/react.js";
export class Msg extends React.Component {
constructor(props) {
super(props);
}
render() {
if (this.props.children) {
return Msg.localizeWithChildren(this.props.msgKey, this.props.children);
}
return /*#__PURE__*/React.createElement(React.Fragment, null, Msg.localize(this.props.msgKey, this.props.params));
}
static localizeWithChildren(msgKey, children) {
const message = l18nMsg[this.processKey(msgKey)];
const parts = message.split(/\{\{param_\d*}}/);
const count = React.Children.count(children);
return React.Children.map(children, (child, i) => [parts[i], child, count === i + 1 ? parts[count] : '']);
}
static localize(msgKey, params) {
let message = l18nMsg[this.processKey(msgKey)];
if (message === undefined) message = msgKey;
if (params !== undefined && params.length > 0) {
params.forEach((value, index) => {
value = this.processParam(value);
message = message.replace('{{param_' + index + '}}', value);
});
}
return message;
} // if the message key has Freemarker syntax, remove it
}
// if the message key has Freemarker syntax, remove it
static processKey(msgKey) {
if (!(msgKey.startsWith('${') && msgKey.endsWith('}'))) return msgKey; // remove Freemarker syntax
if (!(msgKey.startsWith('${') && msgKey.endsWith('}'))) return msgKey;
// remove Freemarker syntax
return msgKey.substring(2, msgKey.length - 1);
} // if the param has Freemarker syntax, try to look up its value
}
// if the param has Freemarker syntax, try to look up its value
static processParam(param) {
if (!(param.startsWith('${') && param.endsWith('}'))) return param; // remove Freemarker syntax
if (!(param.startsWith('${') && param.endsWith('}'))) return param;
// remove Freemarker syntax
const key = param.substring(2, param.length - 1);
let value = l18nMsg[key];
if (value === undefined) return param;
return value;
}
}
//# sourceMappingURL=Msg.js.map
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More