feat: initial commit
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
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; }
|
||||
|
||||
/*
|
||||
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* 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 { Msg } from "./Msg.js";
|
||||
/**
|
||||
* For any of these properties that are strings, you can
|
||||
* pass in a localization key instead of a static string.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class renders a button that provides a continue/cancel modal dialog when clicked. If the user selects 'Continue'
|
||||
* then the onContinue function is executed.
|
||||
*
|
||||
* @author Stan Silvert ssilvert@redhat.com (C) 2019 Red Hat Inc.
|
||||
*/
|
||||
export class ContinueCancelModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
_defineProperty(this, "handleModalToggle", () => {
|
||||
this.setState(({
|
||||
isModalOpen
|
||||
}) => ({
|
||||
isModalOpen: !isModalOpen
|
||||
}));
|
||||
if (this.props.onClose) this.props.onClose();
|
||||
});
|
||||
|
||||
_defineProperty(this, "handleContinue", () => {
|
||||
this.handleModalToggle();
|
||||
this.props.onContinue();
|
||||
});
|
||||
|
||||
this.state = {
|
||||
isModalOpen: false
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
isModalOpen
|
||||
} = this.state;
|
||||
return /*#__PURE__*/React.createElement(React.Fragment, null, !this.props.render && /*#__PURE__*/React.createElement(Button, {
|
||||
id: this.props.buttonId,
|
||||
variant: this.props.buttonVariant,
|
||||
onClick: this.handleModalToggle,
|
||||
isDisabled: this.props.isDisabled
|
||||
}, /*#__PURE__*/React.createElement(Msg, {
|
||||
msgKey: this.props.buttonTitle
|
||||
})), this.props.render && this.props.render(this.handleModalToggle), /*#__PURE__*/React.createElement(Modal, _extends({}, this.props, {
|
||||
variant: ModalVariant.small,
|
||||
title: Msg.localize(this.props.modalTitle),
|
||||
isOpen: isModalOpen,
|
||||
onClose: this.handleModalToggle,
|
||||
actions: [/*#__PURE__*/React.createElement(Button, {
|
||||
id: "modal-confirm",
|
||||
key: "confirm",
|
||||
variant: "primary",
|
||||
onClick: this.handleContinue
|
||||
}, /*#__PURE__*/React.createElement(Msg, {
|
||||
msgKey: this.props.modalContinueButtonLabel
|
||||
})), /*#__PURE__*/React.createElement(Button, {
|
||||
id: "modal-cancel",
|
||||
key: "cancel",
|
||||
variant: "secondary",
|
||||
onClick: this.handleModalToggle
|
||||
}, /*#__PURE__*/React.createElement(Msg, {
|
||||
msgKey: this.props.modalCancelButtonLabel
|
||||
}))]
|
||||
}), !this.props.modalMessage && this.props.children, this.props.modalMessage && /*#__PURE__*/React.createElement(Msg, {
|
||||
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
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* 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 { Msg } from "./Msg.js";
|
||||
export default class EmptyMessageState extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
return /*#__PURE__*/React.createElement(EmptyState, {
|
||||
variant: EmptyStateVariant.full
|
||||
}, /*#__PURE__*/React.createElement(EmptyStateIcon, {
|
||||
icon: this.props.icon
|
||||
}), /*#__PURE__*/React.createElement(Title, {
|
||||
headingLevel: "h5",
|
||||
size: "lg"
|
||||
}, /*#__PURE__*/React.createElement(Msg, {
|
||||
msgKey: this.props.messageKey
|
||||
})), /*#__PURE__*/React.createElement(EmptyStateBody, null, this.props.children));
|
||||
}
|
||||
|
||||
}
|
||||
//# sourceMappingURL=EmptyMessageState.js.map
|
||||
@@ -0,0 +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"}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* 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 { Msg } from "./Msg.js";
|
||||
;
|
||||
export class LocaleSelector extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
return /*#__PURE__*/React.createElement(FormSelect, {
|
||||
id: "locale-select",
|
||||
value: this.props.value,
|
||||
onChange: (value, event) => {
|
||||
if (this.props.onChange) this.props.onChange(value, event);
|
||||
},
|
||||
"aria-label": Msg.localize('selectLocale')
|
||||
}, availableLocales.map((locale, index) => /*#__PURE__*/React.createElement(FormSelectOption, {
|
||||
key: index,
|
||||
value: locale.locale,
|
||||
label: locale.label
|
||||
})));
|
||||
}
|
||||
|
||||
}
|
||||
//# sourceMappingURL=LocaleSelectors.js.map
|
||||
@@ -0,0 +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"}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* 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 { Msg } from "./Msg.js";
|
||||
import { KeycloakContext } from "../keycloak-service/KeycloakContext.js";
|
||||
import { Button, DropdownItem } from "../../../common/keycloak/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, {
|
||||
id: "signOutButton",
|
||||
onClick: () => handleLogout(keycloak)
|
||||
}, /*#__PURE__*/React.createElement(Msg, {
|
||||
msgKey: "doSignOut"
|
||||
})));
|
||||
}
|
||||
|
||||
}
|
||||
export class LogoutDropdownItem extends React.Component {
|
||||
render() {
|
||||
return /*#__PURE__*/React.createElement(KeycloakContext.Consumer, null, keycloak => /*#__PURE__*/React.createElement(DropdownItem, {
|
||||
id: "signOutLink",
|
||||
key: "logout",
|
||||
onClick: () => handleLogout(keycloak)
|
||||
}, Msg.localize('doSignOut')));
|
||||
}
|
||||
|
||||
}
|
||||
//# sourceMappingURL=Logout.js.map
|
||||
@@ -0,0 +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"}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import * as React from "../../../common/keycloak/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
|
||||
|
||||
|
||||
static processKey(msgKey) {
|
||||
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
|
||||
|
||||
|
||||
static processParam(param) {
|
||||
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
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* 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 { Msg } from "./Msg.js";
|
||||
import { DropdownItem } from "../../../common/keycloak/web_modules/@patternfly/react-core.js";
|
||||
import { ArrowIcon } from "../../../common/keycloak/web_modules/@patternfly/react-icons.js";
|
||||
|
||||
/**
|
||||
* @author Stan Silvert ssilvert@redhat.com (C) 2018 Red Hat Inc.
|
||||
*/
|
||||
export class ReferrerDropdownItem extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
return /*#__PURE__*/React.createElement(DropdownItem, {
|
||||
id: "referrerMobileLink",
|
||||
href: referrerUri
|
||||
}, /*#__PURE__*/React.createElement(ArrowIcon, null), " ", Msg.localize('backTo', [referrerName]));
|
||||
}
|
||||
|
||||
}
|
||||
;
|
||||
//# sourceMappingURL=ReferrerDropdownItem.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/app/widgets/ReferrerDropdownItem.tsx"],"names":["React","Msg","DropdownItem","ArrowIcon","ReferrerDropdownItem","Component","constructor","props","render","referrerUri","localize","referrerName"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ;AAEA,SAAQC,GAAR;AAEA,SAAQC,YAAR;AACA,SAAQC,SAAR;;AAQA;AACA;AACA;AACA,OAAO,MAAMC,oBAAN,SAAmCJ,KAAK,CAACK,SAAzC,CAA8E;AAE1EC,EAAAA,WAAW,CAACC,KAAD,EAAmC;AACjD,UAAMA,KAAN;AACH;;AAEMC,EAAAA,MAAM,GAAoB;AAE7B,wBACI,oBAAC,YAAD;AAAc,MAAA,EAAE,EAAC,oBAAjB;AAAsC,MAAA,IAAI,EAAEC;AAA5C,oBACI,oBAAC,SAAD,OADJ,OACmBR,GAAG,CAACS,QAAJ,CAAa,QAAb,EAAuB,CAACC,YAAD,CAAvB,CADnB,CADJ;AAKH;;AAbgF;AAcpF","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 '../widgets/Msg';\n\nimport {DropdownItem} from '@patternfly/react-core';\nimport {ArrowIcon} from '@patternfly/react-icons';\n\ndeclare const referrerName: string;\ndeclare const referrerUri: string;\n\nexport interface ReferrerDropdownItemProps {\n}\n\n/**\n * @author Stan Silvert ssilvert@redhat.com (C) 2018 Red Hat Inc.\n */\nexport class ReferrerDropdownItem extends React.Component<ReferrerDropdownItemProps> {\n\n public constructor(props: ReferrerDropdownItemProps) {\n super(props);\n }\n\n public render(): React.ReactNode {\n\n return (\n <DropdownItem id=\"referrerMobileLink\" href={referrerUri}>\n <ArrowIcon /> {Msg.localize('backTo', [referrerName])}\n </DropdownItem>\n );\n }\n};"],"file":"ReferrerDropdownItem.js"}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright 2018 Red Hat, Inc. and/or its affiliates.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* 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 { Msg } from "./Msg.js";
|
||||
import { ArrowIcon } from "../../../common/keycloak/web_modules/@patternfly/react-icons.js";
|
||||
|
||||
/**
|
||||
* @author Stan Silvert ssilvert@redhat.com (C) 2018 Red Hat Inc.
|
||||
*/
|
||||
export class ReferrerLink extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
/*#__PURE__*/
|
||||
// '_hash_' is a workaround for when uri encoding is not
|
||||
// sufficient to escape the # character properly.
|
||||
// See AppInitiatedActionPage for more details.
|
||||
React.createElement("a", {
|
||||
id: "referrerLink",
|
||||
href: referrerUri.replace('_hash_', '#')
|
||||
}, /*#__PURE__*/React.createElement(ArrowIcon, null), " ", /*#__PURE__*/React.createElement(Msg, {
|
||||
msgKey: "backTo",
|
||||
params: [referrerName]
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
;
|
||||
//# sourceMappingURL=ReferrerLink.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/app/widgets/ReferrerLink.tsx"],"names":["React","Msg","ArrowIcon","ReferrerLink","Component","constructor","props","render","referrerUri","replace","referrerName"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,KAAKA,KAAZ;AAEA,SAAQC,GAAR;AAEA,SAAQC,SAAR;;AAQA;AACA;AACA;AACA,OAAO,MAAMC,YAAN,SAA2BH,KAAK,CAACI,SAAjC,CAA8D;AAE1DC,EAAAA,WAAW,CAACC,KAAD,EAA2B;AACzC,UAAMA,KAAN;AACH;;AAEMC,EAAAA,MAAM,GAAoB;AAC7B;AAAA;AACI;AACA;AACA;AACA;AAAG,QAAA,EAAE,EAAC,cAAN;AAAqB,QAAA,IAAI,EAAEC,WAAW,CAACC,OAAZ,CAAoB,QAApB,EAA8B,GAA9B;AAA3B,sBACG,oBAAC,SAAD,OADH,oBACgB,oBAAC,GAAD;AAAK,QAAA,MAAM,EAAC,QAAZ;AAAqB,QAAA,MAAM,EAAE,CAACC,YAAD;AAA7B,QADhB;AAJJ;AAQH;;AAfgE;AAgBpE","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';\n\nimport {ArrowIcon} from '@patternfly/react-icons';\n \ndeclare const referrerName: string;\ndeclare const referrerUri: string;\n\nexport interface ReferrerLinkProps {\n}\n\n/**\n * @author Stan Silvert ssilvert@redhat.com (C) 2018 Red Hat Inc.\n */\nexport class ReferrerLink extends React.Component<ReferrerLinkProps> {\n\n public constructor(props: ReferrerLinkProps) {\n super(props);\n }\n\n public render(): React.ReactNode {\n return (\n // '_hash_' is a workaround for when uri encoding is not\n // sufficient to escape the # character properly.\n // See AppInitiatedActionPage for more details.\n <a id=\"referrerLink\" href={referrerUri.replace('_hash_', '#')}>\n <ArrowIcon/> <Msg msgKey=\"backTo\" params={[referrerName]}/>\n </a>\n );\n }\n};"],"file":"ReferrerLink.js"}
|
||||
@@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=features.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"features.js"}
|
||||
Reference in New Issue
Block a user