Skip to content

Commit

Permalink
Added messaging to clairfy the status of the SVG
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonHowellSlavin committed Feb 24, 2025
1 parent b66faf6 commit 44a4504
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions libs/blocks/preflight/panels/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const NOT_FOUND = {
live: { lastModified: DEF_NOT_FOUND },
};
const DA_DOMAIN = 'da.live';
const nonEDSContent = 'Non AEM EDS Content';

const content = signal({});

Expand All @@ -21,22 +22,19 @@ function getAdminUrl(url, type) {

async function getStatus(url) {
const adminUrl = getAdminUrl(url, 'status');
const urlToFetch = adminUrl || url;
let resp;
try {
resp = await fetch(urlToFetch);
} catch (e) {
console.log('Erorr making request, cors', e);
if (!adminUrl) {
const resp = await fetch(url);
if (!resp.ok) return {};
return {
url,
edit: null,
preview: 'N/A',
live: 'N/A',
publish: 'N/A',
preview: nonEDSContent,
live: nonEDSContent,
publish: nonEDSContent,
};
}
const resp = await fetch(adminUrl);
if (!resp.ok) return {};
console.log(resp);
const json = await resp.json();
const preview = json.preview.lastModified || DEF_NEVER;
const live = json.live.lastModified || DEF_NEVER;
Expand Down Expand Up @@ -186,7 +184,7 @@ function usePublishProps(item) {
function Item({ name, item, idx }) {
const { publishText, disablePublish } = usePublishProps(item);
const isChecked = item.checked ? ' is-checked' : '';
const isFetching = item.edit || item.preview === 'N/A' ? '' : ' is-fetching';
const isFetching = item.edit || item.preview === nonEDSContent ? '' : ' is-fetching';
const editIcon = item.edit && item.edit.includes(DA_DOMAIN) ? 'da-icon' : 'sharepoint-icon';
if (!item.url) return undefined;

Expand Down

0 comments on commit 44a4504

Please sign in to comment.