Skip to content

Commit

Permalink
feat: remove dev feature of build
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-Guillemin committed Jan 12, 2024
1 parent d0ac815 commit c9369ce
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 26 deletions.
3 changes: 1 addition & 2 deletions src/main/webapp/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import { useTheme } from 'vuetify';
const { t } = useI18n();
const configurationStore = useConfigurationStore();
const { refresh, resetState } = configurationStore;
const { lastNavigation, currentFile, isConfirmation, confirmationTitle } = storeToRefs(configurationStore);
const { t } = useI18n();
const router = useRouter();
router.beforeEach((to) => {
Expand Down
8 changes: 5 additions & 3 deletions src/main/webapp/src/components/BottomNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { useDisplay } from 'vuetify';
const configurationStore = useConfigurationStore();
const { refresh } = configurationStore;
const isDev = import.meta.env.DEV;
const { mobile } = useDisplay();
const { t } = useI18n();
</script>
Expand All @@ -16,15 +18,15 @@ const { t } = useI18n();
<v-icon icon="fas fa-folder" />
{{ t('navigation.item.projects') }}
</v-btn>
<v-btn :to="{ name: 'favorites' }" rounded="xl" @click="refresh">
<v-btn v-if="isDev" :to="{ name: 'favorites' }" rounded="xl" @click="refresh">
<v-icon icon="fas fa-star" />
{{ t('navigation.item.favorites') }}
</v-btn>
<v-btn :to="{ name: 'shared' }" rounded="xl" @click="refresh">
<v-btn v-if="isDev" :to="{ name: 'shared' }" rounded="xl" @click="refresh">
<v-icon icon="fas fa-share-nodes" />
{{ t('navigation.item.shared') }}
</v-btn>
<v-btn :to="{ name: 'public' }" rounded="xl" @click="refresh">
<v-btn v-if="isDev" :to="{ name: 'public' }" rounded="xl" @click="refresh">
<v-icon icon="fas fa-globe" />
{{ t('navigation.item.public') }}
</v-btn>
Expand Down
20 changes: 18 additions & 2 deletions src/main/webapp/src/components/FileMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { useI18n } from 'vue-i18n';
const configurationStore = useConfigurationStore();
const { isInfo, currentTab, isConfirmation } = storeToRefs(configurationStore);
const isDev = import.meta.env.DEV;
const { t } = useI18n();
defineProps<{
Expand Down Expand Up @@ -53,20 +55,34 @@ const download = (): void => {};
rounded="xl"
@click="information"
/>
<v-list-item prepend-icon="fas fa-share-nodes" :title="t('menu.item.share')" rounded="xl" @click="share" />
<v-list-item
v-if="isDev"
prepend-icon="fas fa-share-nodes"
:title="t('menu.item.share')"
rounded="xl"
@click="share"
/>
<v-list-item
v-if="isDev"
prepend-icon="fas fa-clock-rotate-left"
:title="t('menu.item.histories')"
rounded="xl"
@click="histories"
/>
<v-list-item
v-if="isDev"
prepend-icon="fas fa-cloud"
:title="t('menu.item.exportOnNextcloud')"
rounded="xl"
@click="exportOnNextloud"
/>
<v-list-item prepend-icon="fas fa-download" :title="t('menu.item.download')" rounded="xl" @click="download" />
<v-list-item
v-if="isDev"
prepend-icon="fas fa-download"
:title="t('menu.item.download')"
rounded="xl"
@click="download"
/>
<v-divider class="my-2" />
<v-list-item
prepend-icon="fas fa-trash"
Expand Down
34 changes: 20 additions & 14 deletions src/main/webapp/src/components/dialogs/FileDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const configurationStore = useConfigurationStore();
const { refresh } = configurationStore;
const { isNew } = storeToRefs(configurationStore);
const isDev = import.meta.env.DEV;
const { t } = useI18n();
const modelValue = computed<boolean>({
Expand All @@ -18,7 +20,7 @@ const modelValue = computed<boolean>({
set() {},
});
const fileType = ref<number>();
const fileType = ref<number | undefined>(isDev ? undefined : 1);
const title = ref<string>();
const description = ref<string>();
const pub = ref<boolean>(false);
Expand Down Expand Up @@ -55,11 +57,13 @@ const addElement = async (): Promise<void> => {
</template>
</v-toolbar>
<v-card-text>
<div class="ml-2 mb-2">{{ t('dialog.file.description') }}</div>
<v-btn-toggle v-model="fileType" mandatory class="mb-3">
<v-btn text="tldraw" :value="1" rounded="xl" />
<v-btn text="WiseMapping" :value="2" rounded="xl" />
</v-btn-toggle>
<div v-if="isDev">
<div class="ml-2 mb-2">{{ t('dialog.file.description') }}</div>
<v-btn-toggle v-model="fileType" mandatory class="mb-3">
<v-btn text="tldraw" :value="1" rounded="xl" />
<v-btn text="WiseMapping" :value="2" rounded="xl" />
</v-btn-toggle>
</div>
<v-text-field
v-model="title"
:label="t('information.title')"
Expand All @@ -80,14 +84,16 @@ const addElement = async (): Promise<void> => {
hide-details
class="mb-3"
/>
<div class="ml-2 mb-1">{{ t('information.visibility') }}</div>
<v-switch
v-model="pub"
:label="t(`visibility.${pub ? 'public' : 'private'}`)"
density="compact"
inset
hide-details
/>
<div v-if="isDev">
<div class="ml-2 mb-1">{{ t('information.visibility') }}</div>
<v-switch
v-model="pub"
:label="t(`visibility.${pub ? 'public' : 'private'}`)"
density="compact"
inset
hide-details
/>
</div>
</v-card-text>
<v-card-actions>
<v-spacer />
Expand Down
10 changes: 6 additions & 4 deletions src/main/webapp/src/components/drawers/InformationDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const configurationStore = useConfigurationStore();
const { refreshCurrentFile } = configurationStore;
const { currentFile, isInfo, currentTab } = storeToRefs(configurationStore);
const isDev = import.meta.env.DEV;
const { t } = useI18n();
const modelValue = computed<boolean>({
Expand Down Expand Up @@ -67,10 +69,10 @@ const addUser = (): void => {
<v-tab :value="Tabs.Information" :title="t('navigation.title.information')">
<v-icon icon="fas fa-circle-info" />
</v-tab>
<v-tab :value="Tabs.Share" :title="t('navigation.title.share')">
<v-tab v-if="isDev" :value="Tabs.Share" :title="t('navigation.title.share')">
<v-icon icon="fas fa-share-nodes" />
</v-tab>
<v-tab :value="Tabs.Histories" :title="t('navigation.title.histories')">
<v-tab v-if="isDev" :value="Tabs.Histories" :title="t('navigation.title.histories')">
<v-icon icon="fas fa-clock-rotate-left" />
</v-tab>
</v-tabs>
Expand Down Expand Up @@ -106,7 +108,7 @@ const addUser = (): void => {
</div>
</v-window-item>

<v-window-item :value="Tabs.Share">
<v-window-item v-if="isDev" :value="Tabs.Share">
<div class="d-flex align-center mb-2 bg-grey-lighten-3 rounded-xl">
<v-text-field
v-model="newUser"
Expand Down Expand Up @@ -197,7 +199,7 @@ const addUser = (): void => {
/>
</v-window-item>

<v-window-item :value="Tabs.Histories">
<v-window-item v-if="isDev" :value="Tabs.Histories">
<v-list v-if="currentFile.histories" class="py-0">
<v-list-item
v-for="(history, index) in currentFile.histories"
Expand Down
5 changes: 5 additions & 0 deletions src/main/webapp/src/components/drawers/NavigationDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const configurationStore = useConfigurationStore();
const { refresh } = configurationStore;
const { isSettings } = storeToRefs(configurationStore);
const isDev = import.meta.env.DEV;
const { t } = useI18n();
</script>

Expand All @@ -24,6 +26,7 @@ const { t } = useI18n();
@click="refresh()"
/>
<v-list-item
v-if="isDev"
prepend-icon="fas fa-star"
:title="t('navigation.item.favorites')"
:to="{ name: 'favorites' }"
Expand All @@ -32,6 +35,7 @@ const { t } = useI18n();
@click="refresh()"
/>
<v-list-item
v-if="isDev"
prepend-icon="fas fa-share-nodes"
:title="t('navigation.item.shared')"
:to="{ name: 'shared' }"
Expand All @@ -40,6 +44,7 @@ const { t } = useI18n();
@click="refresh()"
/>
<v-list-item
v-if="isDev"
prepend-icon="fas fa-globe"
:title="t('navigation.item.public')"
:to="{ name: 'public' }"
Expand Down
5 changes: 4 additions & 1 deletion src/main/webapp/src/views/AppView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const configurationStore = useConfigurationStore();
const { loadFile } = configurationStore;
const { currentFile, isInfo, currentTab } = storeToRefs(configurationStore);
const isDev = import.meta.env.DEV;
const route = useRoute();
const router = useRouter();
Expand Down Expand Up @@ -48,12 +50,13 @@ const goBack = () => (window.history.length > 2 ? router.back() : router.push({
</template>
<template #append>
<v-btn
v-if="isDev"
:icon="`${isStarred ? 'fas' : 'far'} fa-star`"
:color="isStarred ? 'yellow' : 'default'"
size="small"
@click="star"
/>
<v-btn icon="fas fa-share-nodes" size="small" @click="share" />
<v-btn v-if="isDev" icon="fas fa-share-nodes" size="small" @click="share" />
<file-menu size="small" @click="loadFile(currentFile.id)" />
</template>
</v-toolbar>
Expand Down

0 comments on commit c9369ce

Please sign in to comment.