|
|
@ -7,6 +7,7 @@ |
|
|
Modal, |
|
|
Modal, |
|
|
Page, |
|
|
Page, |
|
|
notifications, |
|
|
notifications, |
|
|
|
|
|
Notification, |
|
|
Body, |
|
|
Body, |
|
|
Search, |
|
|
Search, |
|
|
} from "@budibase/bbui" |
|
|
} from "@budibase/bbui" |
|
|
@ -37,6 +38,7 @@ |
|
|
let searchTerm = "" |
|
|
let searchTerm = "" |
|
|
let cloud = $admin.cloud |
|
|
let cloud = $admin.cloud |
|
|
let creatingFromTemplate = false |
|
|
let creatingFromTemplate = false |
|
|
|
|
|
let automationErrors |
|
|
|
|
|
|
|
|
const resolveWelcomeMessage = (auth, apps) => { |
|
|
const resolveWelcomeMessage = (auth, apps) => { |
|
|
const userWelcome = auth?.user?.firstName |
|
|
const userWelcome = auth?.user?.firstName |
|
|
@ -59,7 +61,8 @@ |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
$: lockedApps = filteredApps.filter(app => app?.lockedYou || app?.lockedOther) |
|
|
$: lockedApps = filteredApps.filter(app => app?.lockedYou || app?.lockedOther) |
|
|
$: unlocked = lockedApps?.length == 0 |
|
|
$: unlocked = lockedApps?.length === 0 |
|
|
|
|
|
$: automationErrors = getAutomationErrors(enrichedApps) |
|
|
|
|
|
|
|
|
const enrichApps = (apps, user, sortBy) => { |
|
|
const enrichApps = (apps, user, sortBy) => { |
|
|
const enrichedApps = apps.map(app => ({ |
|
|
const enrichedApps = apps.map(app => ({ |
|
|
@ -89,6 +92,33 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getAutomationErrors = apps => { |
|
|
|
|
|
const automationErrors = {} |
|
|
|
|
|
for (let app of apps) { |
|
|
|
|
|
if (app.automationErrors) { |
|
|
|
|
|
automationErrors[app.devId] = app.automationErrors |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return automationErrors |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const goToAutomationError = appId => { |
|
|
|
|
|
const params = new URLSearchParams({ tab: "Automation History" }) |
|
|
|
|
|
$goto(`../overview/${appId}?${params.toString()}`) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const errorCount = appId => { |
|
|
|
|
|
return Object.values(automationErrors[appId]).reduce( |
|
|
|
|
|
(prev, next) => prev + next, |
|
|
|
|
|
0 |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const automationErrorMessage = appId => { |
|
|
|
|
|
const app = enrichedApps.find(app => app.devId === appId) |
|
|
|
|
|
return `${app.name} - Automation error (${errorCount(appId)})` |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const initiateAppCreation = () => { |
|
|
const initiateAppCreation = () => { |
|
|
if ($apps?.length) { |
|
|
if ($apps?.length) { |
|
|
$goto("/builder/portal/apps/create") |
|
|
$goto("/builder/portal/apps/create") |
|
|
@ -208,6 +238,19 @@ |
|
|
<Page wide> |
|
|
<Page wide> |
|
|
<Layout noPadding gap="M"> |
|
|
<Layout noPadding gap="M"> |
|
|
{#if loaded} |
|
|
{#if loaded} |
|
|
|
|
|
{#if automationErrors} |
|
|
|
|
|
{#each Object.keys(automationErrors) as appId} |
|
|
|
|
|
<Notification |
|
|
|
|
|
wide |
|
|
|
|
|
dismissable |
|
|
|
|
|
action={() => goToAutomationError(appId)} |
|
|
|
|
|
type="error" |
|
|
|
|
|
icon="Alert" |
|
|
|
|
|
actionMessage={errorCount(appId) > 1 ? "View errors" : "View error"} |
|
|
|
|
|
message={automationErrorMessage(appId)} |
|
|
|
|
|
/> |
|
|
|
|
|
{/each} |
|
|
|
|
|
{/if} |
|
|
<div class="title"> |
|
|
<div class="title"> |
|
|
<div class="welcome"> |
|
|
<div class="welcome"> |
|
|
<Layout noPadding gap="XS"> |
|
|
<Layout noPadding gap="XS"> |
|
|
|