{"version":3,"names":[],"mappings":"","sources":["internal-confidential-search.js"],"sourcesContent":["import * as capSvc from './services/internal-confidential-service.js';\r\nimport internalConfidentialRequest from './models/internal-Confidential/searchRequestModel.js'\r\nimport internalConfidentialDisplay from \"./models/internal-Confidential/searchDisplayModel.js\";\r\nimport {keyTabNavigation} from \"../utilities/navigation.js\";\r\nimport {footer} from \"./internal-confidential-searchFooter.js\";\r\n\r\nwindow.loadJobDetail = loadJobDetail;\r\nwindow.hideCaliNotice = hideCaliNotice;\r\nwindow.acceptGdpr = acceptGdpr;\r\n\r\nlet brandId;\r\nconsole.log('brand1: ' + sessionStorage.getItem('brandId'));\r\nbrandId = capSvc.getBrand();\r\nconsole.log('brand2: ' + sessionStorage.getItem('brandId'));\r\nlet direction = \"asc\"\r\n\r\nconst columns = [\r\n {path: \"title\", name: \"Title\", justification: \"text-left\"},\r\n {path: \"id\", name: \"ID\", justification: \"text-left\"},\r\n {path: \"city\", name: \"City\", justification: \"text-left\"},\r\n {path: \"stateProvince\", name: \"State\", justification: \"text-center\"},\r\n {path: \"datePosted\", name: \"Date Posted\", justification: \"text-center\"}\r\n];\r\n\r\nlet bodyRequest = internalConfidentialRequest\r\nlet displayData = internalConfidentialDisplay\r\n\r\nif (window.location.search === \"\") {\r\n //\r\n const searchDiv = document.getElementById(\"brandBody\");\r\n searchDiv.innerHTML =\r\n `\r\n ${sessionStorage.getItem('headerHtml')}\r\n`\r\n const tableSearchDisplayDiv = document.createElement(\"div\")\r\n tableSearchDisplayDiv.setAttribute(\"id\", \"searchTableDiv\")\r\n tableSearchDisplayDiv.setAttribute(\"class\", \"container clearfix pb-1\")\r\n\r\n const searchTable = document.createElement(\"div\")\r\n searchTable.setAttribute(\"id\", \"searchTable\")\r\n searchTable.setAttribute(\"class\", \"container\")\r\n tableSearchDisplayDiv.appendChild(searchTable)\r\n\r\n const s = document.createElement(\"script\")\r\n s.type = 'module'\r\n s.src = '../assets/js/internal-confidential-searchFilter.js'\r\n tableSearchDisplayDiv.appendChild(s)\r\n\r\n const jobs = capSvc.getInternalJobs(bodyRequest)\r\n const jobs2 = jobs.then(res => res.json())\r\n jobs2.then(json => {\r\n displayData = json\r\n if (displayData.searchResults !== null) {\r\n populateSearchTable(displayData)\r\n footer(displayData.totalResults, bodyRequest[\"resultsPerPage\"], 1)\r\n setSortHeader()\r\n keyTabNavigation()\r\n }\r\n })\r\n searchDiv.appendChild(tableSearchDisplayDiv)\r\n removePreloader();\r\n}\r\n\r\nfunction loadJobDetail(jobId, stateProvince) {\r\n if (stateProvince === 'CA') {\r\n capSvc.showCaliNotice(jobId + \".html\");\r\n } else {\r\n window.open(jobId + \".html\", \"_self\");\r\n }\r\n}\r\n\r\nfunction populateSearchTable(displayData, pageSize = null) {\r\n // console.log(displayData);\r\n\r\n searchTable.innerHTML = `\r\n
${displayData['totalResults']} Positions Found
\r\n${name}\r\n \r\n | `\r\n )).join('')}\r\n\t\t\t\t\t\t
---|
Sorry, we couldn't find any positions matching your criteria.
\r\n