{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/components/unifiedPublishingAlert/UnifiedPublishingAlert.tsx","webpack:///./src/components/unifiedPublishingAlert/data/DataService.ts","webpack:///./src/components/unifiedPublishingAlert/classes/Alert.ts","webpack:///./src/components/unifiedPublishingAlert/classes/Text.ts","webpack:///./src/components/unifiedPublishingAlert/UnifiedPublishingModal.tsx","webpack:///./src/components/unifiedPublishingAlert/UnifiedPublishingModalContent.tsx","webpack:///./src/components/unifiedPublishingAlert/UnifiedPublishingLiveAlertDetail.tsx","webpack:///./src/components/unifiedPublishingAlert/UnifiedPublishingNoAlertsDetail.tsx","webpack:///./src/components/unifiedPublishingAlert/UnifiedPublishingUnminimizeButton.tsx","webpack:///./src/components/unifiedPublishingAlert/sessionStorage/SessionStorage.tsx","webpack:///./src/components/common/modalHtmlClassHack/ModalHtmlClassHack.tsx","webpack:///./src/components/unifiedPublishingAlert/demoPage/unifiedPublishingAlertPage2.tsx","webpack:///./src/components/EnviroConfig.ts","webpack:///./src/components/Common/LoadingSpinner/LoadingSpinner.tsx"],"names":["i","chunkIds","length","deferredModules","j","deferredModule","enumerable","get","getter","value","key","bind","module","Object","prototype","hasOwnProperty","call","object","property","jsonpArray","webpackJsonpCallback","UnifiedPublishingAlert","props","getWhetherToShowDummyAlert","showAlert","theLocation","location","search","substring","querystringObj","showAlerts","setInitialState","dataService","onMinimizeModal","onUnminimizeModal","this","loadLiveAlerts","event","preventDefault","setModalAsMinimized","setState","modalIsMinimized","setModalAsUnminimized","modalIsOpen","state","displayModal","liveAlerts","numAjaxRequests","text","numAlerts","getBlankInternationalizedText","getIfModalIsMinimized","getNumAjaxRequests","error","alerts","errorsHaveOccurred","loading","minimize","new","noAlerts","noAlertsDescription","isReload","addOneAJAXCallToCount","serviceMethodName","returnDummyAlerts","params","JSON","stringify","fetchWithTimeoutRace","then","response","handleResponseErrors","subtractOneAJAXCallFromCount","json","handleReturnedAlerts","addError","message","undefined","d","convertToIAlert","liveAlertIDs","thisAlert","push","alertId","previousLiveAlertIDs","getLiveAlertIDs","setLiveAlertIDs","loadInternationalizedText","Array","isArray","Error","thisResponseAlert","newAlert","AlertId","alertType","AlertType","body","Body","expiryDate","Date","Expiry","title","Title","incrementNumAjaxRequests","decrementNumAjaxRequests","DataService","url","headers","Headers","append","baseURL","unifiedPublishingAlertServiceURL","Promise","race","fetch","method","credentials","_","reject","setTimeout","methodName","ok","statusText","isIAlertResponse","obj","isIText","UnifiedPublishingModal","context","parentElementSelector","setAppElement","isOpen","parentSelector","document","querySelector","className","overlayClassName","shouldCloseOnOverlayClick","shouldCloseOnEsc","onRequestClose","onClickCloseModalButton","UnifiedPublishingModalContent","liveAlertComponents","showSpinner","map","alert","href","onClick","loadingText","UnifiedPublishingLiveAlertDetail","isFirstDisplayOfThisAlert","alertIDsAlreadySeen","getAlertIDsAlreadySeen","indexOf","setAlertIDsAlreadySeen","showStar","dangerouslySetInnerHTML","__html","UnifiedPublishingNoAlertsDetail","UnifiedPublishingUnminimizeButton","minimizeBtnClassName","alertsText","type","SessionStorage","sessionStorage","setItem","sessionStorage_modalIsMinimised","modalIsMinimised","modalIsMinimisedInSessionStorage","getItem","rawPreviousliveAlertIDs","sessionStorage_liveAlertIDs","split","join","rawAlertIDsAlreadySeen","sessionStorage_alertIDsAlreadySeen","alertIDs","rawNumReqs","sessionStorage_numAjaxRequests","parseInt","numReqs","setNumAjaxRequests","numRequests","toString","ModalHtmlClassHack","addClass","removeClass","components","getElementsByClassName","Component","elem","portletInstanceId","attributes","nodeValue","EnviroConfig","toBoolean","x","useProductionConfig","newsroomServiceURL","createAlertServiceURL","portletLibraryServiceURL","iconpickerServiceURL","newsroomApiBaseUrl","quicklinkportletServiceURL","searchServiceURL","staffDirServiceURL","calendarServiceURL","unifiedPublishingBaseURL","bannerServiceURL","socialMediaManagementURL","emailPopupPath","modernSocialMediaAlertsInTestMode","ngrokURL","process","env","NGROK_URL","LoadingSpinner"],"mappings":"aACA,cAQA,IAPA,IAMA,I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AAWC,QAAQC,IAAIC,UAC7BnL,KAAKkK,mBAAqBc,EAAW,aACrChL,KAAKmK,sBAAwBa,EAAW,gBACxChL,KAAKoK,yBAA2BY,EAAW,kBAC3ChL,KAAKqK,qBAAuBW,EAAW,eACvChL,KAAKsK,mBAAqBU,EAAW,sBACrChL,KAAKuK,2BAA6BS,EAAW,4BAC7ChL,KAAKwK,iBAAmBQ,EAAW,kBACnChL,KAAKyK,mBAAqBO,EAAW,mBACrChL,KAAK0K,mBAAqBM,EAAW,aACrChL,KAAK2K,yBAA2BK,EAAW,sBAC3ChL,KAAK4E,iCAAmCoG,EAAW,2BACnDhL,KAAK4K,iBAAmBI,EAAW,WACnChL,KAAK6K,yBAA2BG,EAAW,WAC3ChL,KAAK8K,eAAiB,KACtB9K,KAAK+K,mCAAoC,IA3E7C,4CA+EI/K,KAAKkK,mBAAqB,oBAC1BlK,KAAKmK,sBAAwB,kEAC7BnK,KAAKoK,yBAA2B,kBAChCpK,KAAKqK,qBAAuB,4BAC5BrK,KAAKsK,mBAAqB,sBAC1BtK,KAAKuK,2BAA6B,4BAClCvK,KAAKwK,iBAAmB,kBACxBxK,KAAKyK,mBAAqB,8DAC1BzK,KAAK0K,mBAAqB,oEAC1B1K,KAAK2K,yBAA2B,sBAChC3K,KAAK4E,iCAAmC,kEACxC5E,KAAK4K,iBAAmB,iBACxB5K,KAAK6K,yBAA2B,WAChC7K,KAAK8K,eAAiB,uFACtB9K,KAAK+K,mCAAoC,IA7F7C,2I,iLAAajB,a,+dCHN,I,IAAMsB,EAAiB,SAACjM,GAC3B,OAAIA,EAAMwH,YAEF,uBAAKR,UAAU,qBAAqBjC,MAAO/E,EAAM6H,YAAW,cAAc,QAAO,uBAAKb,UAAU,iBAG7F,O,4FANFiF,E","file":"unifiedPublishingAlert.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t16: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"../Common/JavaScript/resourcelibrary/reactportlets/\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([1720,0,20]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","import \"whatwg-fetch\"; // Polyfill for Fetch for IE.\r\n\r\nimport * as React from \"react\";\r\n\r\nimport difference from \"lodash.difference\";\r\nimport * as querystring from \"querystring\";\r\n\r\nimport { DataService } from \"./data/DataService\";\r\nimport { Errors } from \"./Errors\";\r\n\r\nimport { IAlert, IAlertResponse, isIAlertResponse } from \"./classes/Alert\";\r\nimport { isIText, IText } from \"./classes/Text\";\r\n\r\nimport { ModalHtmlClassHack } from \"../common/modalHtmlClassHack/ModalHtmlClassHack\";\r\nimport { UnifiedPublishingModal } from \"./UnifiedPublishingModal\";\r\nimport { UnifiedPublishingUnminimizeButton } from \"./UnifiedPublishingUnminimizeButton\";\r\n\r\nimport { SessionStorage } from \"./sessionStorage/SessionStorage\";\r\n\r\nimport { EnviroConfig } from \"../EnviroConfig\";\r\n\r\nimport \"../../../node_modules/font-awesome/scss/font-awesome.scss\"; // Font-Awesome SASS CSS sheet, not included in final build.\r\nimport \"../common/styles/presenceFramework.css\"; // Not included in final build.\r\nimport \"./UnifiedPublishing.css\";\r\n\r\nexport interface IUnifiedPublishingAlertProps extends React.Props {\r\n portletInstanceID: number;\r\n}\r\n\r\nexport interface IUnifiedPublishingAlertState {\r\n error: string;\r\n liveAlerts: IAlert[];\r\n displayModal: boolean;\r\n modalIsMinimized: boolean;\r\n numAjaxRequests: number;\r\n text: IText;\r\n}\r\n\r\nexport default class UnifiedPublishingAlert extends React.Component {\r\n\r\n private dataService: DataService;\r\n\r\n public constructor(props: IUnifiedPublishingAlertProps) {\r\n super(props);\r\n\r\n this.setInitialState();\r\n this.dataService = new DataService();\r\n\r\n this.onMinimizeModal = this.onMinimizeModal.bind(this);\r\n this.onUnminimizeModal = this.onUnminimizeModal.bind(this);\r\n }\r\n\r\n public componentDidMount() {\r\n this.loadLiveAlerts();\r\n }\r\n\r\n public onMinimizeModal(event) {\r\n event.preventDefault();\r\n SessionStorage.setModalAsMinimized();\r\n this.setState({ modalIsMinimized: true });\r\n }\r\n\r\n public onUnminimizeModal(event) {\r\n\r\n event.preventDefault();\r\n\r\n this.loadLiveAlerts(true);\r\n\r\n SessionStorage.setModalAsUnminimized();\r\n this.setState({ modalIsMinimized: false });\r\n }\r\n\r\n public render() {\r\n\r\n const modalIsOpen = this.state.displayModal && !this.state.modalIsMinimized;\r\n\r\n return (\r\n \r\n\r\n \r\n\r\n {modalIsOpen &&\r\n \r\n }\r\n\r\n \r\n\r\n {/**/}\r\n\r\n \r\n );\r\n }\r\n\r\n private setInitialState() {\r\n const error = \"\";\r\n const liveAlerts: IAlert[] = [];\r\n const displayModal = false;\r\n const text = this.getBlankInternationalizedText();\r\n const modalIsMinimized = SessionStorage.getIfModalIsMinimized();\r\n const numAjaxRequests = SessionStorage.getNumAjaxRequests();\r\n\r\n this.state = {\r\n error,\r\n liveAlerts,\r\n displayModal,\r\n modalIsMinimized,\r\n numAjaxRequests,\r\n text,\r\n };\r\n }\r\n\r\n private getBlankInternationalizedText(): IText {\r\n const text: IText = {\r\n alerts: \"\",\r\n errorsHaveOccurred: \"\",\r\n loading: \"\",\r\n minimize: \"\",\r\n new: \" \", // leave set as \" \" (space)! Used as flag whether int text has been loaded, if changed will cause New alert icons not to show on UnifiedPublishingLiveAlertDetail\r\n noAlerts: \"\",\r\n noAlertsDescription: \"\",\r\n };\r\n return text;\r\n }\r\n\r\n private loadLiveAlerts(isReload: boolean = false): void {\r\n\r\n this.addOneAJAXCallToCount();\r\n\r\n const serviceMethodName = \"GetActiveAlerts\";\r\n\r\n const returnDummyAlerts = this.getWhetherToShowDummyAlert();\r\n const params = JSON.stringify({ returnDummyAlerts });\r\n\r\n this.dataService.fetchWithTimeoutRace(serviceMethodName, params)\r\n .then((response) => {\r\n return this.dataService.handleResponseErrors(response, serviceMethodName);\r\n })\r\n .then((response) => {\r\n this.subtractOneAJAXCallFromCount();\r\n return response.json(); // json() returns a Promise, now need for that Promise to resolve:\r\n })\r\n .then((json) => {\r\n this.handleReturnedAlerts(json, isReload);\r\n }).catch((error) => {\r\n this.addError(error.message);\r\n this.subtractOneAJAXCallFromCount();\r\n });\r\n }\r\n\r\n private getWhetherToShowDummyAlert = (): boolean => {\r\n let showAlert = false;\r\n let theLocation = location.search;\r\n if (theLocation && theLocation.length > 0 && theLocation[0] === \"?\") { theLocation = theLocation.substring(1, theLocation.length); }\r\n const querystringObj = querystring.parse(theLocation);\r\n if (querystringObj && (querystringObj.showAlert || querystringObj.showAlerts)) {\r\n if (querystringObj.showAlert === \"true\" || querystringObj.showAlerts === \"true\") {\r\n showAlert = true;\r\n }\r\n }\r\n return showAlert;\r\n }\r\n\r\n private handleReturnedAlerts(json: any, isReload: boolean) {\r\n\r\n // .NET services wrap response in a 'd' property:\r\n if (json.d !== undefined) {\r\n json = json.d;\r\n }\r\n\r\n // Get the current live alert IDs.\r\n const liveAlerts = this.convertToIAlert(json);\r\n const liveAlertIDs: string[] = [];\r\n for (const thisAlert of liveAlerts) { liveAlertIDs.push(thisAlert.alertId); }\r\n\r\n // Check whether to unminimise the modal in the case that new alerts have arrived since it was minimised.\r\n const previousLiveAlertIDs = SessionStorage.getLiveAlertIDs();\r\n if (previousLiveAlertIDs.length > 0) {\r\n if (difference(liveAlertIDs, previousLiveAlertIDs).length > 0) {\r\n this.setState({ modalIsMinimized: false });\r\n }\r\n } else {\r\n if (liveAlerts.length > 0) {\r\n this.setState({ modalIsMinimized: false });\r\n }\r\n }\r\n\r\n // Update the locally stored live alert IDs.\r\n SessionStorage.setLiveAlertIDs(liveAlertIDs);\r\n\r\n // Decide whether modal+uniminimise button should appear at all.\r\n let displayModal = true;\r\n if (!isReload) {\r\n displayModal = liveAlerts.length > 0;\r\n }\r\n\r\n // Only request internationalised text from service if there is at least one active alert, and this is not a re-opening of the minimised alerts modal.\r\n if (!isReload && liveAlerts.length > 0) {\r\n this.loadInternationalizedText();\r\n }\r\n\r\n this.setState({ liveAlerts, displayModal });\r\n }\r\n\r\n private convertToIAlert(response: any): IAlert[] {\r\n const alerts = [];\r\n\r\n if (!Array.isArray(response)) {\r\n throw new Error(\"Alerts response is not an array.\");\r\n }\r\n\r\n for (const thisResponseAlert of response) {\r\n // Verify data returned by service matches IText interface;\r\n if (isIAlertResponse(thisResponseAlert)) {\r\n const newAlert: IAlert = {\r\n alertId: thisResponseAlert.AlertId,\r\n alertType: thisResponseAlert.AlertType,\r\n body: thisResponseAlert.Body,\r\n expiryDate: new Date(thisResponseAlert.Expiry),\r\n title: thisResponseAlert.Title,\r\n };\r\n alerts.push(newAlert);\r\n } else {\r\n throw new Error(\"Alert data for an alert is not valid, missing expected fields.\");\r\n }\r\n }\r\n\r\n return alerts;\r\n }\r\n\r\n private loadInternationalizedText(): void {\r\n\r\n this.addOneAJAXCallToCount();\r\n\r\n const serviceMethodName = \"GetInternationalizedText\";\r\n\r\n this.dataService.fetchWithTimeoutRace(serviceMethodName, null)\r\n .then((response) => {\r\n return this.dataService.handleResponseErrors(response, serviceMethodName);\r\n })\r\n .then((response) => {\r\n this.subtractOneAJAXCallFromCount();\r\n return response.json(); // json() returns a Promise, now need for that Promise to resolve:\r\n })\r\n .then((json) => {\r\n // .NET services wrap response in a 'd' property:\r\n if (json.d !== undefined) {\r\n json = json.d;\r\n }\r\n if (isIText(json)) { // Verify data returned by service matches IText interface;\r\n const text: IText = json;\r\n this.setState({ text });\r\n } else {\r\n this.addError(\"Internationalised text data returned by service is incomplete.\");\r\n }\r\n }).catch((error) => {\r\n this.addError(error.message);\r\n this.subtractOneAJAXCallFromCount();\r\n });\r\n\r\n }\r\n\r\n private addOneAJAXCallToCount() {\r\n SessionStorage.incrementNumAjaxRequests();\r\n this.setState({ numAjaxRequests: SessionStorage.getNumAjaxRequests() });\r\n }\r\n\r\n private subtractOneAJAXCallFromCount() {\r\n SessionStorage.decrementNumAjaxRequests();\r\n this.setState({ numAjaxRequests: SessionStorage.getNumAjaxRequests() });\r\n }\r\n\r\n private addError(error: string) {\r\n this.setState({ error });\r\n }\r\n\r\n}\r\n","import \"whatwg-fetch\"; // Polyfill for Fetch for IE.\r\n\r\nimport { EnviroConfig } from \"../../EnviroConfig\";\r\n\r\nexport class DataService {\r\n\r\n public fetchWithTimeoutRace(url: string, params: string) {\r\n\r\n const timeout = 10000;\r\n\r\n const body = params;\r\n\r\n const headers = new Headers();\r\n headers.append(\"Accept\", \"application/json, text/javascript, */*; q=0.01\");\r\n headers.append(\"Content-Type\", \"application/json; charset=UTF-8\");\r\n\r\n const config = new EnviroConfig();\r\n const baseURL = config.unifiedPublishingAlertServiceURL;\r\n\r\n return Promise.race(\r\n [\r\n fetch(baseURL + url, { method: \"POST\", headers, body, credentials: \"same-origin\" }),\r\n\r\n new Promise((_, reject) =>\r\n setTimeout(() => reject(new Error(\"The request to the service for \" + url + \" timed out.\")), timeout),\r\n ),\r\n ]);\r\n\r\n }\r\n\r\n public handleResponseErrors(response: any, methodName: string) {\r\n if (!response.ok) {\r\n throw Error(methodName + \" service: \" + response.statusText);\r\n }\r\n return response;\r\n }\r\n\r\n}\r\n","export interface IAlert {\r\n alertId: string;\r\n title: string;\r\n body: string;\r\n alertType: string;\r\n expiryDate: Date;\r\n}\r\n\r\n// Note: IAlertResponse is the data returned from service, uses CAPITALISED property names and Expiry instead of ExpiryDate.\r\n\r\nexport interface IAlertResponse {\r\n AlertId: string;\r\n Title: string;\r\n Body: string;\r\n AlertType: string;\r\n Expiry: Date;\r\n}\r\n\r\nexport const isIAlertResponse = (obj: object): obj is IAlertResponse => {\r\n\r\n // Check all properties exist.\r\n if ((obj as IAlertResponse).AlertId === undefined) { return false; };\r\n if ((obj as IAlertResponse).Title === undefined) { return false; };\r\n if ((obj as IAlertResponse).Body === undefined) { return false; };\r\n if ((obj as IAlertResponse).AlertType === undefined) { return false; };\r\n if ((obj as IAlertResponse).Expiry === undefined) { return false; };\r\n\r\n return true;\r\n};\r\n","export interface IText {\r\n alerts: string;\r\n errorsHaveOccurred: string;\r\n loading: string;\r\n minimize: string;\r\n new: string;\r\n noAlerts: string;\r\n noAlertsDescription: string;\r\n}\r\n\r\nexport const isIText = (obj: object): obj is IText => {\r\n\r\n // Check all properties exist.\r\n if ((obj as IText).alerts === undefined) { return false; };\r\n if ((obj as IText).errorsHaveOccurred === undefined) { return false; };\r\n if ((obj as IText).loading === undefined) { return false; };\r\n if ((obj as IText).minimize === undefined) { return false; };\r\n if ((obj as IText).new === undefined) { return false; };\r\n if ((obj as IText).noAlerts === undefined) { return false; };\r\n if ((obj as IText).noAlertsDescription === undefined) { return false; };\r\n\r\n return true;\r\n};\r\n","import * as React from \"react\";\r\n\r\nimport Modal from \"react-modal\";\r\n\r\nimport { IAlert } from \"./classes/Alert\";\r\nimport { IText } from \"./classes/Text\";\r\n\r\nimport { UnifiedPublishingModalContent } from \"./UnifiedPublishingModalContent\";\r\n\r\n/*\r\nSee\r\nhttps://github.com/reactjs/react-modal/issues/497\r\nhttps://github.com/webpack/webpack/issues/6576\r\n*/\r\n\r\nexport interface IUnifiedPublishingModal {\r\n\tliveAlerts: IAlert[];\r\n\tdisplayModal: boolean;\r\n\tmodalIsMinimized: boolean;\r\n\tnumAjaxRequests: number;\r\n\ttext: IText;\r\n\tonMinimizeModal: (event: any) => any;\r\n}\r\n\r\nexport class UnifiedPublishingModal extends React.Component {\r\n\r\n\tprivate parentElementSelector = \"body\";\r\n\r\n\tconstructor(props, context) {\r\n\t\tsuper(props, context);\r\n\t}\r\n\r\n\tpublic componentWillMount() {\r\n\t\tModal.setAppElement(this.parentElementSelector);\r\n\t}\r\n\r\n\tpublic render() {\r\n\r\n\t\tconst props = this.props;\r\n\r\n\t\tconst getParent = () => {\r\n\t\t\treturn document.querySelector(this.parentElementSelector);\r\n\t\t};\r\n\r\n\t\tif (props.displayModal && !props.modalIsMinimized) {\r\n\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\r\n\t\t\t);\r\n\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t}\r\n};\r\n","import * as React from \"react\";\r\n\r\nimport { IAlert } from \"./classes/Alert\";\r\nimport { IText } from \"./classes/Text\";\r\n\r\nimport { LoadingSpinner } from \"../Common/LoadingSpinner/LoadingSpinner\";\r\nimport { UnifiedPublishingLiveAlertDetail } from \"./UnifiedPublishingLiveAlertDetail\";\r\nimport { UnifiedPublishingNoAlertsDetail } from \"./UnifiedPublishingNoAlertsDetail\";\r\n\r\nexport interface IUnifiedPublishingModalContentProps {\r\n liveAlerts: IAlert[];\r\n numAjaxRequests: number;\r\n text: IText;\r\n onClickCloseModalButton: (event: any) => any;\r\n}\r\n\r\nexport const UnifiedPublishingModalContent = (props: IUnifiedPublishingModalContentProps) => {\r\n\r\n const onMinimise = (event) => {\r\n event.preventDefault();\r\n props.onClickCloseModalButton(event);\r\n };\r\n\r\n let liveAlertComponents: any = null;\r\n let noAlerts = false;\r\n\r\n const showSpinner = props.numAjaxRequests > 0;\r\n\r\n if (props.numAjaxRequests === 0 && props.text.new !== \" \") { // Leave the \" \" in props.text.new !== \" \" there! Used as flag whether internationalised text has finished loading, otherwise re-renders component and messes up displaying New icon.\r\n liveAlertComponents = props.liveAlerts.map((alert) => );\r\n noAlerts = liveAlertComponents.length === 0;\r\n }\r\n\r\n return (\r\n \r\n\r\n \r\n \r\n {props.text.minimize}\r\n \r\n\r\n
\r\n
{props.text.alerts}
\r\n
\r\n\r\n \r\n\r\n {liveAlertComponents}\r\n\r\n {noAlerts &&\r\n \r\n }\r\n\r\n
\r\n
\r\n\r\n
\r\n );\r\n};\r\n","import * as React from \"react\";\r\n\r\nimport { IAlert } from \"./classes/Alert\";\r\nimport { IText } from \"./classes/Text\";\r\n\r\nimport { SessionStorage } from \"./sessionStorage/SessionStorage\";\r\n\r\nexport interface IUnifiedPublishingLiveAlertDetail {\r\n alert: IAlert;\r\n text: IText;\r\n}\r\n\r\nexport const UnifiedPublishingLiveAlertDetail = (props: IUnifiedPublishingLiveAlertDetail) => {\r\n\r\n // Track whether the user has already seen this alert.\r\n const storageKey = \"alertIDsAlreadySeen\";\r\n let isFirstDisplayOfThisAlert = true;\r\n\r\n const alertIDsAlreadySeen = SessionStorage.getAlertIDsAlreadySeen();\r\n if (alertIDsAlreadySeen.indexOf(props.alert.alertId) !== -1) {\r\n isFirstDisplayOfThisAlert = false;\r\n }\r\n\r\n if (isFirstDisplayOfThisAlert) {\r\n alertIDsAlreadySeen.push(props.alert.alertId);\r\n SessionStorage.setAlertIDsAlreadySeen(alertIDsAlreadySeen);\r\n }\r\n\r\n let className = \"A_alert\";\r\n let showStar = false;\r\n if (isFirstDisplayOfThisAlert) {\r\n className += \" A_new\";\r\n showStar = true;\r\n }\r\n\r\n return (\r\n
\r\n
\r\n {showStar &&\r\n {props.text.new} \r\n }\r\n {props.alert.title}
\r\n
\r\n
\r\n );\r\n};\r\n","import * as React from \"react\";\r\n\r\nimport { IText } from \"./classes/Text\";\r\n\r\nexport interface IUnifiedPublishingNoAlertsDetail {\r\n text: IText;\r\n}\r\n\r\nexport const UnifiedPublishingNoAlertsDetail = (props: IUnifiedPublishingNoAlertsDetail) => {\r\n return (\r\n
\r\n
{props.text.noAlerts}
\r\n
{props.text.noAlertsDescription}
\r\n
\r\n );\r\n};\r\n","import * as React from \"react\";\r\n\r\nimport { IText } from \"./classes/Text\";\r\n\r\nexport interface IUnifiedPublishingUnminimizeButton {\r\n displayModal: boolean;\r\n modalIsMinimized: boolean;\r\n numAlerts: number;\r\n text: IText;\r\n onUnminimizeModal: (event: any) => any;\r\n\r\n}\r\n\r\nexport const UnifiedPublishingUnminimizeButton = (props: IUnifiedPublishingUnminimizeButton) => {\r\n\r\n if (props.displayModal && props.numAlerts > 0) {\r\n\r\n let minimizeBtnClassName = \"A_maximizeButton\";\r\n if (props.displayModal && props.modalIsMinimized) { minimizeBtnClassName += \" A_mbVisible\"; }\r\n\r\n let alertsText = \"\";\r\n if (props.text) {\r\n alertsText = props.text.alerts;\r\n }\r\n\r\n return (\r\n \r\n \r\n {alertsText} \r\n {props.numAlerts}\r\n \r\n );\r\n\r\n } else {\r\n return null;\r\n }\r\n\r\n};\r\n","export class SessionStorage {\r\n\r\n public static setModalAsMinimized() {\r\n sessionStorage.setItem(this.sessionStorage_modalIsMinimised, \"minimized\");\r\n }\r\n\r\n public static setModalAsUnminimized() {\r\n sessionStorage.setItem(this.sessionStorage_modalIsMinimised, \"unminimized\");\r\n }\r\n\r\n public static getIfModalIsMinimized(): boolean {\r\n // Check whether the modal was minimised (possibly on a previous page view).\r\n let modalIsMinimised = false;\r\n const modalIsMinimisedInSessionStorage = sessionStorage.getItem(this.sessionStorage_modalIsMinimised);\r\n if (modalIsMinimisedInSessionStorage !== undefined) {\r\n if (modalIsMinimisedInSessionStorage === \"minimized\") {\r\n modalIsMinimised = true;\r\n } else {\r\n modalIsMinimised = false;\r\n }\r\n }\r\n return modalIsMinimised;\r\n }\r\n\r\n public static getLiveAlertIDs(): string[] {\r\n const rawPreviousliveAlertIDs = sessionStorage.getItem(this.sessionStorage_liveAlertIDs);\r\n if (rawPreviousliveAlertIDs) {\r\n return rawPreviousliveAlertIDs.split(\",\");\r\n } else {\r\n return [];\r\n }\r\n }\r\n\r\n public static setLiveAlertIDs(liveAlertIDs: string[]) {\r\n sessionStorage.setItem(this.sessionStorage_liveAlertIDs, liveAlertIDs.join(\",\"));\r\n }\r\n\r\n public static getAlertIDsAlreadySeen(): string[] {\r\n const rawAlertIDsAlreadySeen = sessionStorage.getItem(this.sessionStorage_alertIDsAlreadySeen);\r\n if (rawAlertIDsAlreadySeen) {\r\n return rawAlertIDsAlreadySeen.split(\",\");\r\n } else {\r\n return [];\r\n }\r\n }\r\n\r\n public static setAlertIDsAlreadySeen(alertIDs: string[]) {\r\n sessionStorage.setItem(this.sessionStorage_alertIDsAlreadySeen, alertIDs.join(\",\"));\r\n }\r\n\r\n public static getNumAjaxRequests(): number {\r\n const rawNumReqs = sessionStorage.getItem(this.sessionStorage_numAjaxRequests);\r\n if (rawNumReqs) {\r\n return parseInt(rawNumReqs, 10);\r\n } else {\r\n return 0;\r\n }\r\n }\r\n\r\n public static incrementNumAjaxRequests() {\r\n let numReqs = this.getNumAjaxRequests();\r\n numReqs = numReqs + 1;\r\n this.setNumAjaxRequests(numReqs);\r\n }\r\n\r\n public static decrementNumAjaxRequests() {\r\n let numReqs = this.getNumAjaxRequests();\r\n numReqs = numReqs - 1;\r\n this.setNumAjaxRequests(numReqs);\r\n }\r\n\r\n private static sessionStorage_modalIsMinimised = \"modalIsMinimised\";\r\n private static sessionStorage_liveAlertIDs = \"liveAlertIDs\";\r\n private static sessionStorage_alertIDsAlreadySeen = \"alertIDsAlreadySeen\";\r\n private static sessionStorage_numAjaxRequests = \"numAjaxRequests\";\r\n\r\n private static setNumAjaxRequests(numRequests: number) {\r\n sessionStorage.setItem(this.sessionStorage_numAjaxRequests, numRequests.toString());\r\n }\r\n\r\n}\r\n","import * as React from \"react\";\r\n\r\nimport $ from \"jquery\";\r\n\r\nexport interface IModalHtmlClassHack {\r\n modalIsOpen: boolean;\r\n}\r\n\r\nexport const ModalHtmlClassHack = (props: IModalHtmlClassHack) => {\r\n\r\n // Have to add a class to the HTML tag while the react modal is open to prevent the body from scrolling.\r\n\r\n if (props.modalIsOpen) {\r\n $(\"html\").addClass(\"CMS_PF_dialog_open\");\r\n } else {\r\n $(\"html\").removeClass(\"CMS_PF_dialog_open\");\r\n }\r\n\r\n return null;\r\n};\r\n","import * as React from \"react\";\r\nimport * as ReactDOM from \"react-dom\";\r\n\r\nimport UnifiedPublishingAlert from \"../UnifiedPublishingAlert\";\r\n\r\n// For hot reloading\r\ndeclare var module: any;\r\nif (module.hot) {\r\n module.hot.accept();\r\n}\r\n\r\n// Doing this with plain old JS (not JQuery) to avoid dependency on JQuery.\r\nconst components = document.getElementsByClassName(\"unifiedPublishingAlertComponent\");\r\n\r\nfor (let i = 0; i < components.length; i++) { // tslint:disable-line prefer-for-of\r\n\r\n const elem = components[i];\r\n const portletInstanceId: number = elem.attributes[\"data-portlet-instance-id\"].nodeValue;\r\n\r\n const render = (Component) => {\r\n ReactDOM.render(\r\n ,\r\n elem,\r\n );\r\n };\r\n\r\n render(UnifiedPublishingAlert);\r\n}\r\n","export interface IEnviroConfig {\r\n readonly bannerServiceURL: string;\r\n readonly calendarServiceURL: string;\r\n readonly emailPopupPath: string;\r\n readonly socialMediaManagementURL: string;\r\n readonly staffDirServiceURL: string;\r\n readonly unifiedPublishingAlertServiceURL: string;\r\n readonly modernSocialMediaAlertsInTestMode: boolean;\r\n}\r\n\r\nexport class EnviroConfig implements IEnviroConfig {\r\n public bannerServiceURL: string;\r\n public calendarServiceURL: string;\r\n public newsroomServiceURL: string;\r\n public createAlertServiceURL: string;\r\n public emailPopupPath: string;\r\n public iconpickerServiceURL: string;\r\n public newsroomApiBaseUrl: string;\r\n public portletLibraryServiceURL: string;\r\n public quicklinkportletServiceURL: string;\r\n public searchServiceURL: string;\r\n public socialMediaManagementURL: string;\r\n public staffDirServiceURL: string;\r\n public unifiedPublishingBaseURL: string;\r\n public unifiedPublishingAlertServiceURL: string;\r\n\r\n public modernSocialMediaAlertsInTestMode: boolean;\r\n\r\n constructor() {\r\n // When webpack_config_prod.ts builds the code, it has mode:production set, which sets process.env.NODE_ENV === \"production\"\r\n // When webpack_config_dev.ts builds the code, it has mode:development set, which sets process.env.NODE_ENV === \"development\"\r\n if (process.env.NODE_ENV === \"production\") {\r\n this.useProductionConfig();\r\n } else if (this.toBoolean(process.env.USE_NGROK) === true) {\r\n // NGROK is for exposing your local site and services via ngrok at an external URL. See webpack_config_dev.ts\r\n this.useNgrokConfig();\r\n } else {\r\n this.useDevConfig();\r\n }\r\n\r\n // // This is for accessing the site and services via my machine's local IP address. Change this to your machine's IP address if you need to debug off another machine.\r\n // // Occasionally useful for testing on other machines.\r\n // if (process.env.NODE_ENV === \"remote_dev\") {\r\n // const localURL = \"http://192.168.3.124:3000\";\r\n // this.staffDirServiceURL = localURL + \"/staffDirectory/\";\r\n // this.calendarServiceURL = localURL + \"/calendar/\";\r\n // this.unifiedPublishingAlertServiceURL = localURL + \"/unifiedPublishingAlert/\";\r\n // this.emailPopupPath = \"./\";\r\n // }\r\n }\r\n\r\n private useDevConfig() {\r\n this.newsroomServiceURL = \"http://localhost:3000/newsroom/\";\r\n this.createAlertServiceURL = \"http://localhost:3000/createAlert/\";\r\n this.portletLibraryServiceURL = \"http://localhost:3000/WebApi/portal/\";\r\n this.iconpickerServiceURL = \"http://localhost:3000/iconpicker/\";\r\n this.newsroomApiBaseUrl = \"http://localhost:3000/unifiedPublishing/\";\r\n this.quicklinkportletServiceURL = \"http://localhost:3000/quicklinkportlet/\";\r\n this.searchServiceURL = \"http://localhost:3000/WebApi/search/\";\r\n this.staffDirServiceURL = \"http://localhost:3000/staffDirectory/\";\r\n this.calendarServiceURL = \"http://localhost:3000/calendar/\";\r\n this.unifiedPublishingBaseURL = \"http://localhost:3000/unifiedPublishing/\";\r\n this.unifiedPublishingAlertServiceURL = \"http://localhost:3000/unifiedPublishingAlert/\";\r\n this.bannerServiceURL = \"http://localhost:3000/banner/\";\r\n this.socialMediaManagementURL = \"http://localhost:3000/webapi/\";\r\n this.emailPopupPath = \"./\";\r\n this.modernSocialMediaAlertsInTestMode = true;\r\n }\r\n\r\n private useNgrokConfig() {\r\n const ngrokURL = process.env.NGROK_URL;\r\n this.newsroomServiceURL = ngrokURL + \"/newsroom/\";\r\n this.createAlertServiceURL = ngrokURL + \"/createAlert/\";\r\n this.portletLibraryServiceURL = ngrokURL + \"/WebApi/portal/\";\r\n this.iconpickerServiceURL = ngrokURL + \"/iconpicker/\";\r\n this.newsroomApiBaseUrl = ngrokURL + \"/unifiedPublishing/\";\r\n this.quicklinkportletServiceURL = ngrokURL + \"/WebApi/quicklinkportlet/\";\r\n this.searchServiceURL = ngrokURL + \"/WebApi/search/\";\r\n this.staffDirServiceURL = ngrokURL + \"/staffDirectory/\";\r\n this.calendarServiceURL = ngrokURL + \"/calendar/\";\r\n this.unifiedPublishingBaseURL = ngrokURL + \"/unifiedPublishing/\";\r\n this.unifiedPublishingAlertServiceURL = ngrokURL + \"/unifiedPublishingAlert/\";\r\n this.bannerServiceURL = ngrokURL + \"/banner/\";\r\n this.socialMediaManagementURL = ngrokURL + \"/webapi/\";\r\n this.emailPopupPath = \"./\";\r\n this.modernSocialMediaAlertsInTestMode = true;\r\n }\r\n\r\n private useProductionConfig() {\r\n this.newsroomServiceURL = \"/WebApi/Newsroom/\";\r\n this.createAlertServiceURL = \"../WebServices/UnifiedPublishing/UnifiedPublishingService.asmx/\";\r\n this.portletLibraryServiceURL = \"/WebApi/portal/\";\r\n this.iconpickerServiceURL = \"/WebApi/quicklinkportlet/\";\r\n this.newsroomApiBaseUrl = \"/unifiedPublishing/\";\r\n this.quicklinkportletServiceURL = \"/WebApi/quicklinkportlet/\";\r\n this.searchServiceURL = \"/WebApi/search/\";\r\n this.staffDirServiceURL = \"../Common/controls/StaffDirectory/ws/StaffDirectoryWS.asmx/\";\r\n this.calendarServiceURL = \"../Common/controls/WorkspaceCalendar/ws/WorkspaceCalendarWS.asmx/\";\r\n this.unifiedPublishingBaseURL = \"/unifiedPublishing/\";\r\n this.unifiedPublishingAlertServiceURL = \"../WebServices/UnifiedPublishing/UnifiedPublishingService.asmx/\";\r\n this.bannerServiceURL = \"/WebApi/Banner\";\r\n this.socialMediaManagementURL = \"/WebApi/\";\r\n this.emailPopupPath = \"../common/controls/General/Email/Default.aspx?action=staffDirectoryEmail&recipients=\";\r\n this.modernSocialMediaAlertsInTestMode = false;\r\n }\r\n\r\n private toBoolean = (x) => !!x;\r\n}\r\n","import * as React from \"react\";\r\n\r\nexport interface ILoadingSpinner {\r\n showSpinner: boolean;\r\n loadingText: string;\r\n}\r\n\r\nexport const LoadingSpinner = (props: ILoadingSpinner) => {\r\n if (props.showSpinner) {\r\n return (\r\n
\r\n );\r\n } else {\r\n return null;\r\n }\r\n};\r\n"],"sourceRoot":""}