From c834273079555c9ca6cc74f506c6fe45e366ce8a Mon Sep 17 00:00:00 2001 From: cmiqueo <64917520+cmiqueo@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:30:27 -0800 Subject: [PATCH] MWPW-160237: Caas Bulk Publisher v2 (Beta) (#3176) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "MWPW-156749: Fix video CLS " (#2899) (#2900) Revert "MWPW-156749: Fix video CLS (#2849)" This reverts commit d4134c85979cfbb88a01d331f8d946eb67251de5. * [MWPW-159903] Fix quiz video marquees (#3009) (#3013) fix quiz marquees * [MWPW-159328] handle a case where there are not placeholders availabl… (#3014) [MWPW-159328] handle a case where there are not placeholders available (#2998) * [MWPW-159328] handle a case where there are not palceholders availble * fixed typos --------- Co-authored-by: Denys Fedotov Co-authored-by: Denys Fedotov * MWPW-146211 [MILO][MEP] Option to select all elements (#2976) (#3023) * stash * stash * stash * working well * set updated command list for inline * remove querySelector function * unit test and custom block fix * updates for in-block * merch-card-collection unit test fixed * unit test updates * more unit test repair * linting errors * more linting * Fix Invalid selector test * add coverage * force git checks to refire * remove comment * pass rootEl to getSelectedElements for use when needed (gnav) * skip if clause in codecov --------- Co-authored-by: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com> Co-authored-by: markpadbe * MWPW-158455: Promobar overlays with localnav elements in devices (#2991) * Revert "MWPW-156749: Fix video CLS " (#2899) (#2900) Revert "MWPW-156749: Fix video CLS (#2849)" This reverts commit d4134c85979cfbb88a01d331f8d946eb67251de5. * Changing z-index of promobar and popup * Changing z-index of promobar and popup * Reverting z-index to 4 for promobar --------- Co-authored-by: milo-pr-merge[bot] <169241390+milo-pr-merge[bot]@users.noreply.github.com> Co-authored-by: Okan Sahin <39759830+mokimo@users.noreply.github.com> Co-authored-by: Blaine Gunn Co-authored-by: Akansha Arora <> * MWPW-160237: Caas Bulk Publisher v2 (Beta) * Fixes ESLint errors * Fixes ESLint errors II * Fixes ESLint errors III * Fixes ESLint errors IV * Fixes ESLint errors V * Renames variables * Fixes ESLint errors -- finaly --------- Co-authored-by: milo-pr-merge[bot] <169241390+milo-pr-merge[bot]@users.noreply.github.com> Co-authored-by: Okan Sahin <39759830+mokimo@users.noreply.github.com> Co-authored-by: Blaine Gunn Co-authored-by: Denys Fedotov Co-authored-by: Denys Fedotov Co-authored-by: Rares Munteanu Co-authored-by: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com> Co-authored-by: markpadbe Co-authored-by: Akansha Arora --- .../send-to-caas/bulk-publish-to-caas.beta.js | 543 ++++++++++++++++ tools/send-to-caas/bulkpublish.beta.css | 592 ++++++++++++++++++ tools/send-to-caas/bulkpublisher.beta.html | 223 +++++++ 3 files changed, 1358 insertions(+) create mode 100644 tools/send-to-caas/bulk-publish-to-caas.beta.js create mode 100644 tools/send-to-caas/bulkpublish.beta.css create mode 100644 tools/send-to-caas/bulkpublisher.beta.html diff --git a/tools/send-to-caas/bulk-publish-to-caas.beta.js b/tools/send-to-caas/bulk-publish-to-caas.beta.js new file mode 100644 index 0000000000..bce0ca4bfa --- /dev/null +++ b/tools/send-to-caas/bulk-publish-to-caas.beta.js @@ -0,0 +1,543 @@ +/* eslint-disable no-continue */ +import { loadScript, loadStyle } from '../../libs/utils/utils.js'; +import { getImsToken } from '../utils/utils.js'; +import { + loadTingleModalFiles, + showAlert, + showConfirm, +} from './send-to-caas.js'; +import { + getCardMetadata, + getCaasProps, + loadCaasTags, + postDataToCaaS, + getConfig, + setConfig, +} from './send-utils.js'; +import comEnterpriseToCaasTagMap from './comEnterpriseToCaasTagMap.js'; + +const BODY = document.body; +const SIGNEDIN = BODY.querySelector('.status-signed-in'); +const SIGNEDOUT = BODY.querySelector('.status-signed-out'); + +const LS_KEY = 'bulk-publish-caas'; +const FIELDS = ['presetSelector', 'host', 'repo', 'owner', 'caasEnvSelector', 'urls', 'contentType', 'publishToFloodgate']; +const FIELDS_CB = ['draftOnly', 'useHtml', 'usePreview']; +const DEFAULT_VALUES = { + preset: 'default', + caasEnv: 'prod', + contentType: 'caas:content-type/article', + excelFile: '', + host: 'business.adobe.com', + owner: 'adobecom', + repo: 'bacom', + urls: '', + publishToFloodgate: 'default', +}; +const DEFAULT_VALUES_CB = { + draftOnly: false, + usePreview: false, + useHtml: false, +}; + +const fetchExcelJson = async (url) => { + const resp = await fetch(url); + if (resp.ok) { + const json = await resp.json(); + return json.data; + } + return []; +}; + +const checkIms = async (prompt = true) => { + const accessToken = await getImsToken(loadScript); + if (!accessToken && prompt) { + const shouldLogIn = await showConfirm( + 'You must be logged in with an Adobe ID in order to publish to CaaS.\nDo you want to log in?', + ); + if (shouldLogIn) { + const { signInContext } = getConfig(); + window.adobeIMS.signIn(signInContext); + } + return false; + } + return accessToken; +}; + +const getPageDom = async (url, now) => { + try { + const resp = await fetch(`${url}?timestamp=${now.getTime()}`); + if (!resp.ok) return { error: `${resp.status}: ${resp.statusText}` }; + const html = await resp.text(); + const dp = new DOMParser(); + const dom = dp.parseFromString(html, 'text/html'); + return { dom, lastModified: resp.headers.get('last-modified') }; + } catch (err) { + return { error: err.message }; + } +}; + +const updateTagsFromSheetData = (tags, sheetTagsStr) => { + const sheetTags = sheetTagsStr.split(','); + const tagSet = new Set(tags.map((t) => t.id)); + + sheetTags.forEach((sheetTag) => { + if (sheetTag.startsWith('caas:')) { + tagSet.add(sheetTag); + return; + } + const newTag = comEnterpriseToCaasTagMap[sheetTag]; + if (newTag) { + tagSet.add(newTag); + } + }); + + return [...tagSet].map((t) => ({ id: t })); +}; + +const showClearResultsTables = () => { + const clearResultsButton = document.querySelector('.clear-results'); + clearResultsButton.style.display = 'block'; +}; + +const resetResultsTables = () => { + const successTable = document.querySelector('.success-table'); + const successTBody = successTable.querySelector('tbody'); + successTBody.innerHTML = ''; + successTable.style.display = 'none'; + const errorTable = document.querySelector('.error-table'); + const errorTBody = errorTable.querySelector('tbody'); + errorTBody.innerHTML = ''; + errorTable.style.display = 'none'; +}; + +const showSuccessTable = (successArr) => { + showClearResultsTables(); + const env = getConfig().caasEnv === 'prod' ? '' : `-${getConfig().caasEnv}`; + const chimeraEndpoint = `https://14257-chimera${env}.adobeioruntime.net/api/v1/web/chimera-0.0.1/collection?debug=1&featuredCards=`; + const successTable = document.querySelector('.success-table'); + const tableBody = successTable.querySelector('tbody'); + successTable.style.display = 'block'; + let index = 0; + /* eslint-disable no-plusplus */ + successArr.forEach(([pageUrl, response]) => { + tableBody.innerHTML += ` + ${++index} + OK + ${pageUrl} + ${response} + `; + }); + /* eslint-enable no-plusplus */ +}; + +const showErrorTable = (errorArr) => { + showClearResultsTables(); + const errorTable = document.querySelector('.error-table'); + const tableBody = errorTable.querySelector('tbody'); + errorTable.style.display = 'block'; + let index = 0; + /* eslint-disable no-plusplus */ + errorArr.forEach(([pageUrl, response]) => { + index += 1; + const message = response.error ? response.error.replace(/:.*/, '') : response; + tableBody.innerHTML += ` + ${index} + Failed + ${pageUrl} + ${message} + `; + }); + /* eslint-enable no-plusplus */ +}; + +const processData = async (data, accessToken) => { + const errorArr = []; + const successArr = []; + let index = 0; + let keepGoing = true; + const now = new Date(); + + const statusModal = showAlert('', { btnText: 'Cancel', onClose: () => { keepGoing = false; } }); + const { + caasEnv, + draftOnly, + host, + owner, + repo, + useHtml, + usePreview, + publishToFloodgate, + } = getConfig(); + + if (!repo) { + showAlert('You must select a Preset, or use the Advanced option to enter the necessary information.', { error: true }); + if (statusModal.modal) statusModal.close(); + return; + } + + let domain = `https://${host}`; + + if (usePreview) { + domain = `https://stage--${repo}--${owner}.hlx.page`; + } else if (publishToFloodgate !== 'default') { + domain = `https://main--${repo}--${owner}.hlx.live`; + } + + for (const page of data) { + if (!keepGoing) break; + + try { + const rawUrl = page.Path || page.path || page.url || page.URL || page.Url || page; + + const { pathname } = new URL(rawUrl); + const pathnameNoHtml = pathname.replace('.html', ''); + const pageUrl = usePreview ? `${domain}${pathnameNoHtml}` : `${domain}${pathname}`; + const prodUrl = `${host}${pathnameNoHtml}${useHtml ? '.html' : ''}`; + + index += 1; + statusModal.setContent(`Publishing ${index} of ${data.length}:
${pageUrl}`); + + if (pageUrl === 'stop') break; // debug, stop on empty line + + const { dom, error, lastModified } = await getPageDom(pageUrl, now); + if (error) { + errorArr.push([pageUrl, error]); + continue; + } + + setConfig({ bulkPublish: true, doc: dom, pageUrl, lastModified }); + const { caasMetadata, errors } = await getCardMetadata({ + prodUrl, + floodgatecolor: publishToFloodgate, + }); + + if (errors.length) { + errorArr.push([pageUrl, errors]); + continue; + } + + const tagField = page['cq:tags'] || page.tags; + if (tagField) { + const updatedTags = updateTagsFromSheetData(caasMetadata.tags, tagField); + caasMetadata.tags = updatedTags; + } + + if (!caasMetadata.tags.length) { + errorArr.push([pageUrl, 'No tags on page']); + continue; + } + + const caasProps = getCaasProps(caasMetadata); + + const response = await postDataToCaaS({ + accessToken, + caasEnv: caasEnv?.toLowerCase(), + caasProps, + draftOnly, + }); + + if (response.success) { + successArr.push([pageUrl, caasMetadata.entityid]); + } else { + errorArr.push([pageUrl, response]); + } + } catch (e) { + // eslint-disable-next-line no-console + console.log(`ERROR: ${e.message}`); + } + } + + if (statusModal.modal) statusModal.close(); + + SIGNEDIN.style.display = 'none'; + SIGNEDOUT.style.display = 'none'; + resetResultsTables(); + if (successArr.length) { + showSuccessTable(successArr); + } + if (errorArr.length) { + showErrorTable(errorArr); + } + + showAlert(`Successfully published ${successArr.length} pages. \n\n Failed to publish ${errorArr.length} pages.`); +}; + +const bulkPublish = async () => { + const accessToken = await checkIms(); + if (!accessToken) return; + + const { urls } = getConfig(); + + if (!urls) { + await showAlert('Enter a URL or list of URLs, each on a separate line, to be sent to CaaS.', { error: true }); + } + + const data = urls ? urls.split('\n') : ''; + + await processData(data, accessToken); +}; + +const loadFromLS = () => { + BODY.classList = ''; + const ls = localStorage.getItem(LS_KEY); + if (!ls || !ls.includes('presetSelector')) return; + try { + setConfig(JSON.parse(ls)); + const config = getConfig(); + FIELDS.forEach((field) => { + document.getElementById(field).value = config[field] ?? DEFAULT_VALUES[field]; + if (field === 'presetSelector' && config[field] === 'advanced') { + BODY.classList = 'advanced'; + } else if (field === 'presetSelector' && config[field] !== 'default') { + BODY.classList = 'preset'; + } + }); + FIELDS_CB.forEach((field) => { + document.getElementById(field).checked = config[field] ?? DEFAULT_VALUES_CB[field]; + }); + + /* c8 ignore next */ + } catch (e) { /* do nothing */ } +}; + +const publishWarning = document.querySelector('.publish-warning'); +const checkCaasEnv = () => { + // eslint-disable-next-line no-undef + const caasEnvValue = caasEnvSelector.value || 'prod'; + // eslint-disable-next-line no-undef + if (caasEnvValue === 'prod' && !draftOnly.checked) { + publishWarning.style.height = '30px'; + } else { + publishWarning.style.height = '0'; + } +}; + +// preset options +const presetsJsonPath = 'https://milo.adobe.com/drafts/caas/bppresets.json'; +let presetsData = {}; + +fetchExcelJson(presetsJsonPath).then((presets) => { + const separator = document.querySelector('.separator'); + const parent = separator.parentElement; + presetsData = presets; + presets.forEach((preset) => { + const option = document.createElement('option'); + option.value = preset.repo; + option.text = `${preset.name} (${preset.repo})`; + parent.insertBefore(option, separator); + }); +}); + +const resetAdvancedOptions = () => { + /* eslint-disable no-undef */ + caasEnvSelector.value = 'prod'; + draftOnly.checked = false; + useHtml.checked = false; + usePreview.checked = false; + publishToFloodgate.value = 'default'; + /* eslint-enable no-undef */ +}; + +/* eslint-disable no-nested-ternary */ +const useDarkTheme = localStorage.getItem('bp-theme') === 'dark' + ? true + : localStorage.getItem('bp-theme') === 'light' + ? false + : window.matchMedia('(prefers-color-scheme: dark)').matches; +/* eslint-enable no-nested-ternary */ + +if (useDarkTheme) { + document.querySelector('.bulk-publisher').classList.add('dark'); + document.querySelector('#option-dark').checked = true; +} else { + document.querySelector('#option-light').checked = true; +} + +// eslint-disable-next-line no-undef +presetSelector.addEventListener('change', () => { + // eslint-disable-next-line no-undef + const { value } = presetSelector; + const selectedPreset = presetsData.find((item) => item.id === value) || {}; + BODY.classList = ''; + resetAdvancedOptions(); + + if (value === 'advanced') { + BODY.classList.add('advanced'); + return; + } + if (value === 'default') { + BODY.classList = ''; + } else { + BODY.classList.add('preset'); + } + + const ls = localStorage.getItem(LS_KEY); + const config = ls ? JSON.parse(ls) : {}; + config.presetSelector = selectedPreset.id || 'default'; + config.host = selectedPreset.host || ''; + config.owner = selectedPreset.owner || ''; + config.repo = selectedPreset.repo || ''; + config.contentType = selectedPreset.contentType; + setConfig(config); + window.localStorage.setItem(LS_KEY, JSON.stringify(getConfig())); + loadFromLS(); + checkCaasEnv(); +}); + +const clearResultsButton = document.querySelector('.clear-results'); +clearResultsButton.addEventListener('click', () => { + resetResultsTables(); + clearResultsButton.style.display = 'none'; + SIGNEDIN.style.display = 'block'; +}); + +// eslint-disable-next-line no-undef +caasEnvSelector.addEventListener('change', () => { + checkCaasEnv(); +}); + +// eslint-disable-next-line no-undef +draftOnly.addEventListener('change', () => { + checkCaasEnv(); +}); + +const checkUserStatus = async () => { + const accessToken = await checkIms(false); + if (accessToken) { + document.querySelector('.status-checking').style.display = 'none'; + SIGNEDIN.style.display = 'block'; + } else { + document.querySelector('.status-checking').style.display = 'none'; + SIGNEDOUT.style.display = 'block'; + } + return true; +}; + +const feecbackButton = document.querySelector('.feedback'); +feecbackButton.addEventListener('click', () => { + showAlert(`

Feedback and Comments

+

Feedback for this tool is always welcome.

+

For reporting issues or sharing comments, please use the #javelin-friends channel on Slack

+

The Javelin Team

`); +}); + +const helpButtons = document.querySelectorAll('.help'); +helpButtons.forEach((btn) => { + btn.addEventListener('click', (e) => { + e.preventDefault(); + const el = e.target.classList[1]; + switch (el) { + case 'host': + showAlert(`

Host

Enter the host of the site you are publishing content to.

+

+   milo.adobe.com
+   blog.adobe.com
+   business.adobe.com.

`); + break; + + case 'repo': + showAlert(`

Repo

+

The Repo is the name of the repository where the content will be published.

+

For example:

+

https://main--{repo}--{owner}.hlx.live`); + break; + + case 'owner': + showAlert(`

Repo Owner

+

The Repo Owner is the owner of the repository where the content will be published. For example:

+

https://main--{repo}--{owner}.hlx.live`); + break; + + case 'content-type-fallback': + showAlert(`

ContentType Fallback

+

This is the content-type tag that will be applied to all cards that do not have + a specific content-type tag included in their metadata.

`); + break; + + case 'caas-env': + showAlert(`

CaaS Enviroment

+

This is the CaaS environment where the content will be published.

`); + break; + + case 'floodgate': + showAlert(`

FloodGate

+

Use this option to select the FloodGate color for the content.

`); + break; + + case 'publish-to-draft': + showAlert(`

Publish to CaaS DRAFT only

+

When this is option checked, the content will be sent to the CaaS DRAFT container only.

+

With this option unchecked, the content is sent to both, the CaaS LIVE and DRAFT containers.

`); + break; + + case 'use-html': + showAlert(`

Add HTML to Links

+

When this option is checked, the bulkpublisher will add the .html extension to the CTA links.

`); + break; + + case 'use-preview': + showAlert(`

Use Preview Content +

When this option is checked, the tool will publish content from: +

https://main--{repo}--{owner}.hlx.page +

This can be useful for testing before publishing to production.

`); + break; + + default: + showAlert(`

Help

Help for "${el}" is on its way! Stay tuned.

`); + break; + } + }); +}); + +const themeOptions = document.querySelectorAll('.theme-options'); +themeOptions.forEach((btn) => { + btn.addEventListener('click', (e) => { + if (e.target.value === 'dark') { + document.querySelector('.bulk-publisher').classList.add('dark'); + localStorage.setItem('bp-theme', 'dark'); + } else { + document.querySelector('.bulk-publisher').classList.remove('dark'); + localStorage.setItem('bp-theme', 'light'); + } + }); +}); + +const init = async () => { + await loadTingleModalFiles(loadScript, loadStyle); + await loadCaasTags(); + loadFromLS(); + checkCaasEnv(); + checkUserStatus(); + + window.addEventListener('beforeunload', () => { + FIELDS.forEach((field) => { + setConfig({ [field]: document.getElementById(field).value }); + }); + FIELDS_CB.forEach((field) => { + setConfig({ [field]: document.getElementById(field).checked }); + }); + window.localStorage.setItem(LS_KEY, JSON.stringify(getConfig())); + }); + + const bulkPublishBtn = document.querySelector('#bulkpublish'); + bulkPublishBtn.addEventListener('click', () => { + setConfig({ + host: document.getElementById('host').value, + project: '', + branch: 'main', + caasEnv: document.getElementById('caasEnvSelector').value || 'prod', + contentType: document.getElementById('contentType').value, + repo: document.getElementById('repo').value, + owner: document.getElementById('owner').value, + urls: document.getElementById('urls').value, + publishToFloodgate: document.getElementById('publishToFloodgate').value, + draftOnly: document.getElementById('draftOnly').checked, + useHtml: document.getElementById('useHtml').checked, + usePreview: document.getElementById('usePreview').checked, + }); + bulkPublish(); + }); +}; + +export default init; diff --git a/tools/send-to-caas/bulkpublish.beta.css b/tools/send-to-caas/bulkpublish.beta.css new file mode 100644 index 0000000000..0f1255422e --- /dev/null +++ b/tools/send-to-caas/bulkpublish.beta.css @@ -0,0 +1,592 @@ + +body { + font-family: ui-sans-serif, system-ui, "Adobe Clean", adobe-clean, sans-serif; + padding: 0; + margin: 0; +} + +/* *** Page header *** */ + +.page-title h1 { + font-size: 2em; + margin-bottom: 16px; + position: relative; +} + +.feedback { + font-family: ui-sans-serif, system-ui, "Adobe Clean", adobe-clean, sans-serif; + display: inline-block; + position: absolute; + right: 0; + bottom: 0; + font-size: 16px; + font-weight: 200; + cursor: pointer; + background: transparent; + border: solid 1px #ccc; + color: #fff; + text-shadow: 1px 1px 0 #000; + padding: 6px 12px; + border-radius: 13px; +} + +.feedback:hover { + background: #6f9b00; +} + +/* *** Bulk publisher *** */ + +.bulk-publisher { + font-weight: 300; + margin: 32px; + margin: 0; +} + +.main { + display: flex; + height: calc(100% - 126px); +} + +.bulk-publisher .title { + grid-template-columns: 1fr; +} + +/* *** Options panel *** */ + +.options-panel { + min-width: 350px; + background: linear-gradient(45deg, #aaa, #eee); + border-right: solid 1px #aaa; + overflow-y: auto; + height: 100%; +} + +dd.content { + background-color: transparent; +} + +dd.content.is-expanded { + margin-top: 0; +} + +dd.content h4 { + margin: 5px 20px 10px; + font-size: 20px; + font-weight: 500; +} + +dd.content .field { + padding: 0 20px; + margin: 12px 0 +} + +dd.content .field label { + margin-bottom: 4px; + font-size: 15px; + color: #202020; +} + +.bulk-publisher dd.content { + color: #000; +} + +dd.content .field select, +dd.content .field input[type="text"] { + border: none; + background: #eaeaea; + color: #202020; + width: 100%; + font-weight: 200; +} + +body:not(.preset) dd.content .field input { + border: solid 1px #bababa; +} + +.content.is-expanded .field.checkbox { + flex-direction: row; + justify-content: flex-start; +} + +.content.is-expanded input[type=checkbox] { + align-self: center; +} + +select#presetSelector { + border: solid 2px #6f9b00; + border: solid 2px #c00; + border-radius: 8px; + padding: 10px 4px; + margin-bottom: 10px; +} + +body.preset select#presetSelector, +body.advanced select#presetSelector { + border: solid 1px #6f9b00; +} + +.preset-options, +.advanced-options { + height: 0; + margin: 0; + padding: 0; + overflow: hidden; + transition: height .5s; + border: solid 1px #666; + border-radius: 10px; + border-width: 0; +} + +.preset-options { + height: 110px; + transition: height .5s; + border: solid 1px #aaa; + border-radius: 10px; + margin: 20px; + padding: 10px 0; +} + +dd.content .preset-options .field:not(:first-of-type) { + display: none; +} + +body.preset dd.content .preset-options .field { + display: flex; + align-items: baseline; + margin: 0; +} + +body.advanced dd.content .preset-options .field { + display: block; +} + +body.preset { + position: relative; +} + +h5.basic-settings { + display: none; + margin: 15px 20px; + font-size: 16px; + font-weight: 400; +} + +body.advanced h5.basic-settings { + display: block; + margin-bottom: -5px; +} + +body.preset .preset-options { + height: 196px; +} + +body.preset dd.content .preset-options .field label { + width: 90px; +} + +body.preset .preset-options .help { + display: none; +} + +body.advanced .preset-options, +body.advanced .advanced-options { + height: 368px; + border-width: 1px; + border: solid 1px #aaa; + border-radius: 10px; + margin: 20px; + background: linear-gradient(45deg, #eee6, transparent); +} + +body.advanced .advanced-options { + padding: 10px 0; +} + +body.advanced .bulk-publisher.dark .preset-options, +body.advanced .bulk-publisher.dark .advanced-options { + background: linear-gradient(45deg, #20202066, transparent); + border-color: #666; +} + +body.preset dd.content .preset-options .field input[type="text"] { + background: transparent; + color: #666; +} + +.page-title { + margin: 0; + background: linear-gradient(360deg, #6f9b01, #fff); + padding: 43px 30px 2px; + border-bottom: solid 1px #ddd; + color: #202020; +} + +.page-title i { + font-style: normal; + font-weight: 400; +} + +.page-title span.beta { + font-size: 27px; + font-variant: small-caps; + font-weight: 200; + color: #fff; + text-shadow: 1px 1px 1px #000; +} + +div#caas-draft-cb { + margin-top: 15px; +} + +/* *** Content panel *** */ + +.content-panel { + padding: 0 50px; + width: 100%; + background: #f6f6f6; + position: relative; +} + +.content-panel h2 { + margin-bottom: 0; + font-size: 22px; + font-weight: 500; +} + +.content-panel b { + font-weight: 500; +} + +.urls, +textarea#urls, +textarea#errors, +textarea#success { + width: 100%; +} + +#urls { + width: 100%; + height: 520px; + height: 250px; + margin-top: 6px; + font-family: system-ui; + font-size: 16px; + font-weight: 200; + border-radius: 16px; + padding: 15px 20px; +} + +textarea#errors, +textarea#success { + border: none; + background: #eee; +} + +textarea#success { + border: solid green; +} + +textarea#errors{ + border: solid red; +} + +.button-area { + text-align: center; +} + +.publish-warning { + margin-bottom: 0; + height: 0; + overflow: hidden; + transition: height .3s; +} + +span.warning-icon { + color: orange; + font-size: 24px; +} + +#bulkpublish { + margin: 20px 0; + font-size: 16px; + background: #6e9b00; + border: solid 1px lightgreen; + padding: 8px 30px; + border-radius: 12px; + color: white; + cursor: pointer; +} + +.config-msg { + color: #aaa; + display: inline-block; +} + +body.preset .config-msg, +body.advanced .config-msg { + display: none; +} + +span.help { + padding: 1px; + margin-left: 2px; + border-radius: 10px; + cursor: pointer; + background: transparent; + color: #999; + letter-spacing: 1px; + font-size: 12px; + vertical-align: super; +} + +span.help:hover { + background: #999; + color: #fff; +} + +.success, +.errors { + display: none; +} + +.success label, +.errors label { + font-size: 18px; + margin: 16px 0 0; + display: block; +} + +.errors label { + color: red; + display: flex; + justify-content: space-between; +} + +.success label { + color: green; +} + +.errors label span { + font-size: 22px; + border: solid 1px #000; + width: 30px; + text-align: center; + border-radius: 50%; + color: #fff; + top: 15px; + position: relative; + background: darkred; + right: -12px; +} + +.hidden { + display: none; +} + +p.status-signed-in i, +p.status-signed-out i { + font-size: 24px; + padding: 0 5px; + font-weight: 600; + vertical-align: -2px; + margin-right: 8px; + border: solid 1px #aaa; + border-radius: 15px; +} + +p.status-signed-in i { + color: #6e9b00; +} + +p.status-signed-out i { + font-style: normal; + color: red; +} + +.status { + position: relative; +} + +.status button.clear-results { + position: absolute; + right: 20px; + background: transparent; + border: solid 1px #bababa; + padding: 6px 16px; + border-radius: 6px; +} + +.status button.clear-results:hover { + background: linear-gradient(0deg, #ddd, transparent); +} + +table.error-table, +table.success-table { + width: 100%; + border-top: solid 1px red; + border-collapse: collapse; + margin-top: 20px; +} + +table.success-table { + border-top: solid 1px green; +} + +table.error-table th, +table.success-table th { + font-weight: 500; + text-align: left; + padding: 6px 0; +} + +table.error-table td:not(.error), +table.success-table td:not(.ok) { + font-size: 15px; + padding: 6px 0; + font-weight: 200; +} + +tr th:first-child, +tr td:first-child { + padding-left: 6px !important; +} + +table.success-table td.entityid { + font-family: monospace; + font-size: 14px; + cursor: pointer; +} + +table.success-table tr th:first-child, +table.error-table tr th:first-child { + min-width: 80px !important; +} + +td.ok, +td.error { + padding: 0 6px; + font-weight: bold; +} + +td.ok { + color: green; +} + +td.error { + color: #e00; +} + +thead tr { + background: #f0f0f0; +} + +tbody tr:hover { + background: #f0f0ff; +} + +/* *** themes style overrides *** */ + +.theme-options { + position: absolute; + right: 30px; + top: 10px; + font-size: 15px; +} + +.bulk-publisher.dark .divider { + border-color: #161616; +} + +.bulk-publisher.dark .options-panel { + background: linear-gradient(45deg, #000, #404040); +} + +.bulk-publisher.dark dd.content { + color: #EFEFEF; +} + +.bulk-publisher.dark .content-panel { + background: #444; + color: #fafafa; +} + +.bulk-publisher.dark dd.content .field label { + color: #aaa; +} + +.bulk-publisher.dark dd.content .field select, +.bulk-publisher.dark dd.content .field input { + border: none; + background: #3C3C3C; + color: #EFEFEF; +} + +.bulk-publisher.dark .content-panel textarea#urls { + background: #505050; + color: white; + border-color: #999; +} + +.bulk-publisher.dark .content-panel textarea#urls::placeholder { + color: #b0b0b0; +} + +.bulk-publisher.dark .content-panel thead tr { + background: #333; + color: white; +} + +.bulk-publisher.dark .content-panel tbody tr:hover { + background: #505050; +} + +.bulk-publisher.dark .content-panel a, +.bulk-publisher.dark .content-panel table.error-table a{ + color: #ccc; +} + +.bulk-publisher.dark .content-panel table td:not(.error) { + color: #ccc; +} + +.bulk-publisher.dark .content-panel table.success-table td.ok { + color: #99d600; +} + +.bulk-publisher.dark .status button.clear-results { + color: #bababa +} + +.status button.clear-results:hover { + background: linear-gradient(0deg, #333, transparent); +} + +/* *** Modal *** */ +.modal { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: #000c; + justify-content: center; + display: none; +} + +.modal-content { + background: white; + width: 80%; + height: 80%; + max-width: 960px; + align-self: center; + position: relative; +} + +.modal-content .close { + position: absolute; + right: 0; + top: -12px; + font-size: 40px; + cursor: pointer; + color: #666; +} diff --git a/tools/send-to-caas/bulkpublisher.beta.html b/tools/send-to-caas/bulkpublisher.beta.html new file mode 100644 index 0000000000..de2b6206de --- /dev/null +++ b/tools/send-to-caas/bulkpublisher.beta.html @@ -0,0 +1,223 @@ + + + + + + + +
+

+ CaaS BulkPublisher Tool + beta + +

+
+ +
+
+
+
+ Settings +
+
+ +
+

Consumer Presets

+
+ +
+ +
Basic Settings
+ +
+ + +
+
+ + +
+
+ + +
+
+ +
+

Advanced Options

+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+ +
+
+
+ +
+ +
Theme: + Light + Dark +
+ +
+

URLs

+

Note: This tool is in BETA stage. Please report any issues in the #javelin-friends channel on Slack.

+

Enter a URL or list of URLs, each on a separate line, to be sent to CaaS.

+ + +

+ Warning: You are publishing content to CaaS Production/LIVE environment. + Use the Advanced Options to change the settings. +

+
+ +   * Please Select a Preset or Custom Settings +
+ +
+ +
+ +

Status

+

Checking...

+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+ + +
+
+ +
+
+
+ + + +