diff --git a/dashboard/.eslintrc.js b/dashboard/.eslintrc.cjs similarity index 100% rename from dashboard/.eslintrc.js rename to dashboard/.eslintrc.cjs diff --git a/dashboard/jsconfig.json b/dashboard/jsconfig.json index 8ab59b4..64c293b 100644 --- a/dashboard/jsconfig.json +++ b/dashboard/jsconfig.json @@ -1,9 +1,9 @@ { - "include": ["./src/**/*", "src2/components/AddressableErrorDialog.vue"], + "include": ["./src2/**/*"], "compilerOptions": { "baseUrl": ".", "paths": { - "@/*": ["src/*"] + "@/*": ["src2/*"] } } } diff --git a/dashboard/package.json b/dashboard/package.json index c18f144..df0803d 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -10,7 +10,7 @@ "generate-theme-config": "node ./generateThemeConfig.cjs", "test": "vitest", "coverage": "vitest run --coverage", - "lint": "eslint src" + "lint": "eslint src2" }, "dependencies": { "@codemirror/autocomplete": "^6.18.1", diff --git a/dashboard/src/App.vue b/dashboard/src/App.vue deleted file mode 100644 index 9b01c49..0000000 --- a/dashboard/src/App.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - diff --git a/dashboard/src/components/AlertBillingInformation.vue b/dashboard/src/components/AlertBillingInformation.vue deleted file mode 100644 index e4003a1..0000000 --- a/dashboard/src/components/AlertBillingInformation.vue +++ /dev/null @@ -1,65 +0,0 @@ - - diff --git a/dashboard/src/components/AlertSiteActivation.vue b/dashboard/src/components/AlertSiteActivation.vue deleted file mode 100644 index 4f7427c..0000000 --- a/dashboard/src/components/AlertSiteActivation.vue +++ /dev/null @@ -1,32 +0,0 @@ - - diff --git a/dashboard/src/components/AlertSiteUpdate.vue b/dashboard/src/components/AlertSiteUpdate.vue deleted file mode 100644 index 81747c5..0000000 --- a/dashboard/src/components/AlertSiteUpdate.vue +++ /dev/null @@ -1,165 +0,0 @@ - - diff --git a/dashboard/src/components/AlertUpdate.vue b/dashboard/src/components/AlertUpdate.vue deleted file mode 100644 index 81a305a..0000000 --- a/dashboard/src/components/AlertUpdate.vue +++ /dev/null @@ -1,172 +0,0 @@ - - diff --git a/dashboard/src/components/AppSourceSelector.vue b/dashboard/src/components/AppSourceSelector.vue deleted file mode 100644 index 1bb0f89..0000000 --- a/dashboard/src/components/AppSourceSelector.vue +++ /dev/null @@ -1,110 +0,0 @@ - - diff --git a/dashboard/src/components/AppSubscriptionSummary.vue b/dashboard/src/components/AppSubscriptionSummary.vue deleted file mode 100644 index bfc4ce4..0000000 --- a/dashboard/src/components/AppSubscriptionSummary.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - diff --git a/dashboard/src/components/BackupFilesUploader.vue b/dashboard/src/components/BackupFilesUploader.vue deleted file mode 100644 index c403b58..0000000 --- a/dashboard/src/components/BackupFilesUploader.vue +++ /dev/null @@ -1,147 +0,0 @@ - - diff --git a/dashboard/src/components/BenchAppUpdates.vue b/dashboard/src/components/BenchAppUpdates.vue deleted file mode 100644 index 91dc401..0000000 --- a/dashboard/src/components/BenchAppUpdates.vue +++ /dev/null @@ -1,105 +0,0 @@ - - diff --git a/dashboard/src/components/BillingInformationDialog.vue b/dashboard/src/components/BillingInformationDialog.vue deleted file mode 100644 index b40d28a..0000000 --- a/dashboard/src/components/BillingInformationDialog.vue +++ /dev/null @@ -1,35 +0,0 @@ - - diff --git a/dashboard/src/components/BuyPrepaidCredits.vue b/dashboard/src/components/BuyPrepaidCredits.vue deleted file mode 100644 index 27af80b..0000000 --- a/dashboard/src/components/BuyPrepaidCredits.vue +++ /dev/null @@ -1,201 +0,0 @@ - - diff --git a/dashboard/src/components/ChangeAppPlanSelector.vue b/dashboard/src/components/ChangeAppPlanSelector.vue deleted file mode 100644 index 74e91fe..0000000 --- a/dashboard/src/components/ChangeAppPlanSelector.vue +++ /dev/null @@ -1,115 +0,0 @@ - - - diff --git a/dashboard/src/components/ChangePaymentModeDialog.vue b/dashboard/src/components/ChangePaymentModeDialog.vue deleted file mode 100644 index d3f15d9..0000000 --- a/dashboard/src/components/ChangePaymentModeDialog.vue +++ /dev/null @@ -1,135 +0,0 @@ - - diff --git a/dashboard/src/components/ClickToCopyField.vue b/dashboard/src/components/ClickToCopyField.vue deleted file mode 100644 index 2ea8eb9..0000000 --- a/dashboard/src/components/ClickToCopyField.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/dashboard/src/components/ConfigEditor.vue b/dashboard/src/components/ConfigEditor.vue deleted file mode 100644 index 3b2c91e..0000000 --- a/dashboard/src/components/ConfigEditor.vue +++ /dev/null @@ -1,341 +0,0 @@ - - - diff --git a/dashboard/src/components/ConfirmDialogs.vue b/dashboard/src/components/ConfirmDialogs.vue deleted file mode 100644 index 1f300b9..0000000 --- a/dashboard/src/components/ConfirmDialogs.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - diff --git a/dashboard/src/components/DescriptionList.vue b/dashboard/src/components/DescriptionList.vue deleted file mode 100644 index d583cfc..0000000 --- a/dashboard/src/components/DescriptionList.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/dashboard/src/components/FeatureList.vue b/dashboard/src/components/FeatureList.vue deleted file mode 100644 index bee0e38..0000000 --- a/dashboard/src/components/FeatureList.vue +++ /dev/null @@ -1,19 +0,0 @@ - - - diff --git a/dashboard/src/components/Form.vue b/dashboard/src/components/Form.vue deleted file mode 100644 index 05cd0de..0000000 --- a/dashboard/src/components/Form.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - diff --git a/dashboard/src/components/FrappeCloudLogo.vue b/dashboard/src/components/FrappeCloudLogo.vue deleted file mode 100644 index 07285f9..0000000 --- a/dashboard/src/components/FrappeCloudLogo.vue +++ /dev/null @@ -1,95 +0,0 @@ - diff --git a/dashboard/src/components/InvoiceUsageCard.vue b/dashboard/src/components/InvoiceUsageCard.vue deleted file mode 100644 index 2f58c47..0000000 --- a/dashboard/src/components/InvoiceUsageCard.vue +++ /dev/null @@ -1,39 +0,0 @@ - - diff --git a/dashboard/src/components/InvoiceUsageTable.vue b/dashboard/src/components/InvoiceUsageTable.vue deleted file mode 100644 index 5347459..0000000 --- a/dashboard/src/components/InvoiceUsageTable.vue +++ /dev/null @@ -1,150 +0,0 @@ - - diff --git a/dashboard/src/components/MarketplaceAppCard.vue b/dashboard/src/components/MarketplaceAppCard.vue deleted file mode 100644 index f24d32d..0000000 --- a/dashboard/src/components/MarketplaceAppCard.vue +++ /dev/null @@ -1,30 +0,0 @@ - - - diff --git a/dashboard/src/components/MarketplaceAppDescriptions.vue b/dashboard/src/components/MarketplaceAppDescriptions.vue deleted file mode 100644 index 3a64de0..0000000 --- a/dashboard/src/components/MarketplaceAppDescriptions.vue +++ /dev/null @@ -1,184 +0,0 @@ - - - diff --git a/dashboard/src/components/MarketplaceAppReleaseList.vue b/dashboard/src/components/MarketplaceAppReleaseList.vue deleted file mode 100644 index 95c71c2..0000000 --- a/dashboard/src/components/MarketplaceAppReleaseList.vue +++ /dev/null @@ -1,313 +0,0 @@ - - - diff --git a/dashboard/src/components/MarketplaceAppScreenshots.vue b/dashboard/src/components/MarketplaceAppScreenshots.vue deleted file mode 100644 index 5d7e0bd..0000000 --- a/dashboard/src/components/MarketplaceAppScreenshots.vue +++ /dev/null @@ -1,86 +0,0 @@ - - - diff --git a/dashboard/src/components/Modal.vue b/dashboard/src/components/Modal.vue deleted file mode 100644 index 85225a8..0000000 --- a/dashboard/src/components/Modal.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - diff --git a/dashboard/src/components/Navbar.vue b/dashboard/src/components/Navbar.vue deleted file mode 100644 index 71ab073..0000000 --- a/dashboard/src/components/Navbar.vue +++ /dev/null @@ -1,143 +0,0 @@ - - - diff --git a/dashboard/src/components/NewAppRepositories.vue b/dashboard/src/components/NewAppRepositories.vue deleted file mode 100644 index 72f5789..0000000 --- a/dashboard/src/components/NewAppRepositories.vue +++ /dev/null @@ -1,108 +0,0 @@ - - diff --git a/dashboard/src/components/Notification.vue b/dashboard/src/components/Notification.vue deleted file mode 100644 index 6e1a82d..0000000 --- a/dashboard/src/components/Notification.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/dashboard/src/components/NotificationToasts.vue b/dashboard/src/components/NotificationToasts.vue deleted file mode 100644 index 5b75b22..0000000 --- a/dashboard/src/components/NotificationToasts.vue +++ /dev/null @@ -1,20 +0,0 @@ - - - diff --git a/dashboard/src/components/PlanIcon.vue b/dashboard/src/components/PlanIcon.vue deleted file mode 100644 index 1babbc2..0000000 --- a/dashboard/src/components/PlanIcon.vue +++ /dev/null @@ -1,25 +0,0 @@ - diff --git a/dashboard/src/components/Popover.vue b/dashboard/src/components/Popover.vue deleted file mode 100644 index 4866c8d..0000000 --- a/dashboard/src/components/Popover.vue +++ /dev/null @@ -1,194 +0,0 @@ - - - - diff --git a/dashboard/src/components/ProgressArc.vue b/dashboard/src/components/ProgressArc.vue deleted file mode 100644 index 7c5103f..0000000 --- a/dashboard/src/components/ProgressArc.vue +++ /dev/null @@ -1,61 +0,0 @@ - - diff --git a/dashboard/src/components/Report.vue b/dashboard/src/components/Report.vue deleted file mode 100644 index c429995..0000000 --- a/dashboard/src/components/Report.vue +++ /dev/null @@ -1,60 +0,0 @@ - - diff --git a/dashboard/src/components/Sidebar.vue b/dashboard/src/components/Sidebar.vue deleted file mode 100644 index b8bcce4..0000000 --- a/dashboard/src/components/Sidebar.vue +++ /dev/null @@ -1,253 +0,0 @@ - - - diff --git a/dashboard/src/components/SiteAppUpdateCard.vue b/dashboard/src/components/SiteAppUpdateCard.vue deleted file mode 100644 index 3d18b93..0000000 --- a/dashboard/src/components/SiteAppUpdateCard.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - diff --git a/dashboard/src/components/SitePlansTable.vue b/dashboard/src/components/SitePlansTable.vue deleted file mode 100644 index 941acee..0000000 --- a/dashboard/src/components/SitePlansTable.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - diff --git a/dashboard/src/components/SiteUpdateCard.vue b/dashboard/src/components/SiteUpdateCard.vue deleted file mode 100644 index a6b9618..0000000 --- a/dashboard/src/components/SiteUpdateCard.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - diff --git a/dashboard/src/components/Steps.vue b/dashboard/src/components/Steps.vue deleted file mode 100644 index ce1b51d..0000000 --- a/dashboard/src/components/Steps.vue +++ /dev/null @@ -1,90 +0,0 @@ - - diff --git a/dashboard/src/components/StripeCard.vue b/dashboard/src/components/StripeCard.vue deleted file mode 100644 index 3854340..0000000 --- a/dashboard/src/components/StripeCard.vue +++ /dev/null @@ -1,281 +0,0 @@ - - - diff --git a/dashboard/src/components/StripeLogo.vue b/dashboard/src/components/StripeLogo.vue deleted file mode 100644 index 377ddfc..0000000 --- a/dashboard/src/components/StripeLogo.vue +++ /dev/null @@ -1,32 +0,0 @@ - - diff --git a/dashboard/src/components/SwitchTeamDialog.vue b/dashboard/src/components/SwitchTeamDialog.vue deleted file mode 100644 index 2473b10..0000000 --- a/dashboard/src/components/SwitchTeamDialog.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - diff --git a/dashboard/src/components/Tabs.vue b/dashboard/src/components/Tabs.vue deleted file mode 100644 index 7ac0619..0000000 --- a/dashboard/src/components/Tabs.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - diff --git a/dashboard/src/components/Tags.vue b/dashboard/src/components/Tags.vue deleted file mode 100644 index 72480d7..0000000 --- a/dashboard/src/components/Tags.vue +++ /dev/null @@ -1,158 +0,0 @@ - - diff --git a/dashboard/src/components/WizardCard.vue b/dashboard/src/components/WizardCard.vue deleted file mode 100644 index 4f7e3d6..0000000 --- a/dashboard/src/components/WizardCard.vue +++ /dev/null @@ -1,16 +0,0 @@ - - diff --git a/dashboard/src/components/marketplace/ChangeAppBranchDialog.vue b/dashboard/src/components/marketplace/ChangeAppBranchDialog.vue deleted file mode 100644 index 556a1ab..0000000 --- a/dashboard/src/components/marketplace/ChangeAppBranchDialog.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - diff --git a/dashboard/src/components/marketplace/CreateAppVersionDialog.vue b/dashboard/src/components/marketplace/CreateAppVersionDialog.vue deleted file mode 100644 index 23fa63f..0000000 --- a/dashboard/src/components/marketplace/CreateAppVersionDialog.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - diff --git a/dashboard/src/components/marketplace/MarketplaceAppReviewStages.vue b/dashboard/src/components/marketplace/MarketplaceAppReviewStages.vue deleted file mode 100644 index 59832ba..0000000 --- a/dashboard/src/components/marketplace/MarketplaceAppReviewStages.vue +++ /dev/null @@ -1,161 +0,0 @@ - - - diff --git a/dashboard/src/components/marketplace/PublisherPayoutInfoCard.vue b/dashboard/src/components/marketplace/PublisherPayoutInfoCard.vue deleted file mode 100644 index 20d3d78..0000000 --- a/dashboard/src/components/marketplace/PublisherPayoutInfoCard.vue +++ /dev/null @@ -1,154 +0,0 @@ - - - diff --git a/dashboard/src/components/marketplace/PublisherProfileCard.vue b/dashboard/src/components/marketplace/PublisherProfileCard.vue deleted file mode 100644 index 50e295b..0000000 --- a/dashboard/src/components/marketplace/PublisherProfileCard.vue +++ /dev/null @@ -1,114 +0,0 @@ - - - diff --git a/dashboard/src/data/notifications.js b/dashboard/src/data/notifications.js deleted file mode 100644 index beb0ff0..0000000 --- a/dashboard/src/data/notifications.js +++ /dev/null @@ -1,7 +0,0 @@ -import { createResource } from 'jingrow-ui'; - -export const unreadNotificationsCount = createResource({ - cache: 'Unread Notifications Count', - url: 'jcloud.api.notifications.get_unread_count', - initialData: 0 -}); diff --git a/dashboard/src/main.js b/dashboard/src/main.js deleted file mode 100644 index 0e98d9d..0000000 --- a/dashboard/src/main.js +++ /dev/null @@ -1,108 +0,0 @@ -import App from './App.vue'; -import { createApp } from 'vue'; -import registerPlugins from './plugins'; -import registerRouter from './router/register'; -import registerControllers from './controllers/register'; -import registerGlobalComponents from './components/global/register'; -import * as Sentry from '@sentry/vue'; -import posthog from 'posthog-js'; -import { BrowserTracing } from '@sentry/tracing'; -import router from './router/index'; -import dayjs from 'dayjs'; -import { notify } from '@/utils/toast'; -import { - setConfig, - jingrowRequest, - pageMetaPlugin, - resourcesPlugin -} from 'jingrow-ui'; - -const app = createApp(App); -let request = options => { - let _options = options || {}; - _options.headers = options.headers || {}; - let currentTeam = localStorage.getItem('current_team'); - if (currentTeam) { - _options.headers['X-Jcloud-Team'] = currentTeam; - } - return jingrowRequest(_options); -}; -setConfig('resourceFetcher', request); -app.use(resourcesPlugin); -app.use(pageMetaPlugin); - -registerPlugins(app); -registerGlobalComponents(app); -const { auth, account } = registerControllers(app); -registerRouter(app, auth, account); - -// sentry -if (window.jcloud_frontend_sentry_dsn?.includes('https://')) { - Sentry.init({ - app, - dsn: window.jcloud_frontend_sentry_dsn, - integrations: [ - new BrowserTracing({ - routingInstrumentation: Sentry.vueRouterInstrumentation(router), - tracingOrigins: ['localhost', /^\//] - }) - ], - beforeSend(event, hint) { - const ignoreErrors = [ - /dynamically imported module/, - /NetworkError when attempting to fetch resource/ - ]; - const error = hint.originalException; - - if (error?.message && ignoreErrors.some(re => re.test(error.message))) - return null; - - return event; - }, - logErrors: true - }); -} - -// posthog -if (window.jcloud_frontend_posthog_host?.includes('https://')) { - try { - posthog.init(window.jcloud_frontend_posthog_project_id, { - api_host: window.jcloud_frontend_posthog_host, - autocapture: false, - capture_pageview: false, - capture_pageleave: false, - advanced_disable_decide: true - }); - window.posthog = posthog; - } catch (e) { - console.trace('Failed to initialize telemetry', e); - } -} - -if (import.meta.env.DEV) { - request({ - url: '/api/action/jcloud.www.dashboard.get_context_for_dev' - }).then(values => { - for (let key in values) { - window[key] = values[key]; - } - app.mount('#app'); - }); -} else { - app.mount('#app'); -} - -app.config.globalProperties.$dayjs = dayjs; -app.config.errorHandler = (error, instance) => { - if (instance) { - let errorMessage = error.message; - if (error.messages) errorMessage = error.messages.join('\n'); - notify({ - icon: 'x', - title: 'An error occurred', - message: errorMessage, - color: 'red' - }); - } - console.error(error); -}; diff --git a/dashboard/src/utils/dayjs.js b/dashboard/src/utils/dayjs.js deleted file mode 100644 index 8b2ab04..0000000 --- a/dashboard/src/utils/dayjs.js +++ /dev/null @@ -1,62 +0,0 @@ -import dayjs from 'dayjs'; -import relativeTime from 'dayjs/esm/plugin/relativeTime'; -import localizedFormat from 'dayjs/plugin/localizedFormat'; -import updateLocale from 'dayjs/plugin/updateLocale'; -import isToday from 'dayjs/plugin/isToday'; -import utc from 'dayjs/plugin/utc'; -import timezone from 'dayjs/plugin/timezone'; - -dayjs.extend(updateLocale); -dayjs.extend(relativeTime); -dayjs.extend(localizedFormat); -dayjs.extend(isToday); -dayjs.extend(utc); -dayjs.extend(timezone); - -dayjs.shortFormating = (s, ago = false) => { - if (s === 'now' || s === 'now ago') { - return 'now'; - } - - const prefix = s.split(' ')[0]; - const posfix = s.split(' ')[1]; - const isPast = s.includes('ago'); - let newPostfix = ''; - switch (posfix) { - case 'minute': - newPostfix = 'm'; - break; - case 'minutes': - newPostfix = 'm'; - break; - case 'hour': - newPostfix = 'h'; - break; - case 'hours': - newPostfix = 'h'; - break; - case 'day': - newPostfix = 'd'; - break; - case 'days': - newPostfix = 'd'; - break; - case 'month': - newPostfix = 'M'; - break; - case 'months': - newPostfix = 'M'; - break; - case 'year': - newPostfix = 'Y'; - break; - case 'years': - newPostfix = 'Y'; - break; - } - return `${['a', 'an'].includes(prefix) ? '1' : prefix} ${newPostfix}${ - isPast ? (ago ? ' ago' : '') : '' - }`; -}; - -export default dayjs; diff --git a/dashboard/src/utils/toast.js b/dashboard/src/utils/toast.js deleted file mode 100644 index a2a4871..0000000 --- a/dashboard/src/utils/toast.js +++ /dev/null @@ -1,15 +0,0 @@ -import { ref } from 'vue'; - -export const notifications = ref([]); - -export const hideNotification = id => { - notifications.value = notifications.value.filter(props => props.id !== id); -}; - -export const notify = props => { - // TODO: remove the line below once the jingrow-ui bug (onError triggers twice) is fixed - if (notifications.value.some(n => n.message === props.message)) return; - props.id = Math.floor(Math.random() * 1000 + Date.now()); - notifications.value.push(props); - setTimeout(() => hideNotification(props.id), props.timeout || 5000); -}; diff --git a/dashboard/src2/App.vue b/dashboard/src2/App.vue index 9f9d76e..53a3478 100644 --- a/dashboard/src2/App.vue +++ b/dashboard/src2/App.vue @@ -272,7 +272,7 @@ provide('team', team); provide('session', session); - +