Skip to content

Commit

Permalink
Merge branch 'master' into fix-make-RemoteFrappeSite-more-robust
Browse files Browse the repository at this point in the history
  • Loading branch information
cogk authored Nov 29, 2024
2 parents 5ef2381 + 58bd325 commit 8473747
Show file tree
Hide file tree
Showing 127 changed files with 4,411 additions and 3,689 deletions.
1 change: 1 addition & 0 deletions dashboard/src/components/global/Badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default {
Running: 'blue',
Pending: 'orange',
Failure: 'red',
Failed: 'red',
'Update Available': 'blue',
Enabled: 'blue',
'Awaiting Approval': 'orange',
Expand Down
39 changes: 14 additions & 25 deletions dashboard/src2/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,17 @@
<div class="h-full flex-1">
<div class="flex h-full">
<div
v-if="!$isMobile && !isHideSidebar"
v-if="!isSaaSFlow && !$isMobile && !isHideSidebar"
class="relative block min-h-0 flex-shrink-0 overflow-hidden hover:overflow-auto"
>
<AppSidebar
v-if="
$session.user &&
!$route.name?.startsWith('SaaSSignup') &&
$route.name != 'SaaSLogin' &&
!$route.name?.startsWith('IntegratedBilling')
"
/>
<AppSidebar v-if="$session.user" />
</div>
<div class="w-full overflow-auto" id="scrollContainer">
<MobileNav
v-if="
$isMobile &&
!isHideSidebar &&
$session.user &&
!$route.name?.startsWith('SaaSSignup') &&
$route.name != 'SaaSLogin' &&
!$route.name?.startsWith('IntegratedBilling')
"
v-if="!isSaaSFlow && $isMobile && !isHideSidebar && $session.user"
/>
<div
v-if="
!$session.user &&
!$route.meta.isLoginPage &&
!$route.name?.startsWith('IntegratedBilling') &&
$route.name != 'SaaSLogin' &&
!$route.name?.startsWith('SaaSSignup')
"
v-if="!isSaaSFlow && !$session.user && !$route.meta.isLoginPage"
class="border bg-red-200 px-5 py-3 text-base text-red-900"
>
You are not logged in.
Expand All @@ -50,7 +30,7 @@
</template>

<script setup>
import { defineAsyncComponent, computed, watch } from 'vue';
import { defineAsyncComponent, computed, watch, ref } from 'vue';
import { Toaster } from 'vue-sonner';
import { dialogs } from './utils/components';
import { useRoute } from 'vue-router';
Expand All @@ -73,6 +53,15 @@ const isHideSidebar = computed(() => {
route.name == 'Welcome' && session.user && team?.doc?.hide_sidebar === true
);
});
const isSaaSFlow = ref(window.location.pathname.startsWith('/dashboard/saas'));
watch(
() => route.name,
() => {
isSaaSFlow.value = window.location.pathname.startsWith('/dashboard/saas');
}
);
</script>
<style src="../src/assets/style.css"></style>
3 changes: 2 additions & 1 deletion dashboard/src2/components/AppSidebarItemGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
</div>
<div class="ml-5 py-1" v-if="isOpened">
<AppSidebarItem
v-for="subItem in item.children"
v-for="(subItem, i) in item.children"
:class="{ 'mt-0.5': i !== 0 }"
:key="subItem.name"
:item="subItem"
/>
Expand Down
10 changes: 8 additions & 2 deletions dashboard/src2/components/LinkControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default {
query: this.query
},
auto: true,
initialData: this.options.initialData || [],
transform: data => {
return data.map(option => ({
label: option.label || option.value,
Expand All @@ -65,17 +66,22 @@ export default {
computed: {
autocompleteOptions() {
let options = this.$resources.options.data || [];
let currentValueInOptions = options.find(
const currentValueInOptions = options.find(
o => o.value === this.modelValue
);
if (currentValueInOptions) {
this.currentValidValueInOptions = currentValueInOptions;
}
if (this.modelValue && !currentValueInOptions) {
if (
this.modelValue &&
!currentValueInOptions &&
this.currentValidValueInOptions
) {
options = [this.currentValidValueInOptions, ...options];
}
return options;
}
}
Expand Down
9 changes: 8 additions & 1 deletion dashboard/src2/components/NavigationItems.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import WalletCards from '~icons/lucide/wallet-cards';
import Settings from '~icons/lucide/settings';
import App from '~icons/lucide/layout-grid';
import DatabaseZap from '~icons/lucide/database-zap';
import Logs from '~icons/lucide/scroll-text';
import Globe from '~icons/lucide/globe';
import Notification from '~icons/lucide/inbox';
import Code from '~icons/lucide/code';
Expand Down Expand Up @@ -122,9 +123,15 @@ export default {
icon: () => h(DatabaseZap),
route: '/sql-playground',
isActive: routeName === 'SQL Playground'
},
{
name: 'Log Browser',
icon: () => h(Logs),
route: '/log-browser',
isActive: routeName === 'Log Browser'
}
],
isActive: ['SQL Playground'].includes(routeName),
isActive: ['SQL Playground', 'Log Browser'].includes(routeName),
disabled: enforce2FA
},
{
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src2/components/SiteActionCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function getSiteActionHandler(action) {
'Restore from an existing site': defineAsyncComponent(() =>
import('./site/SiteDatabaseRestoreFromURLDialog.vue')
),
'Access site database': defineAsyncComponent(() =>
'Manage database users': defineAsyncComponent(() =>
import('./SiteDatabaseAccessDialog.vue')
),
'Version upgrade': defineAsyncComponent(() =>
Expand Down
Loading

0 comments on commit 8473747

Please sign in to comment.