Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions web-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ Monorepo for mergin frontend stuff:
* monorepo consists of root directory with own package.json and individual workspaces in `packages` directory
* root package.json defines common devDependencies and it cannot hold any non-development dependency
* individual workspace package.json defines dependencies used in that particular workspace package
* frontend applications (e.g. app) is also a workspace package (@mergin/app) held in directory [./packages/app](./packages/app).
* frontend application (e.g. app) is also a workspace package (@mergin/app) held in directory [./packages/app](./packages/app).

Application constist of several packages in `packages` directory:

- @mergin/lib - Shared library for common features
- @mergin/lib-vue2 - Shared library for common features with vuetify and vue 2.7
- @mergin/admin-lib - Shared library for admin
- @mergin/app - Web appliacation"
- @mergin/admin-app - Web application for administration

Library packages with *-lib* name are containing shared code for *-app* applications.

Web application *@mergin/app* is using shared library *@mergin/lib*. Web application for administration *admin-app* is using shared libraries with vue 2.7 *@mergin/admin-lib* and *@mergin/lib-vue2*.
Web application *@mergin/app* is using shared library *@mergin/lib*. Web application for administration *admin-app* is using shared library *@mergin/admin-lib*.

For details about development follow instructions in [development guide](../development.md).
13 changes: 3 additions & 10 deletions web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"packages/admin-lib",
"packages/app",
"packages/admin-app",
"packages/lib-vue2",
"packages/*"
],
"scripts": {
Expand All @@ -25,20 +24,16 @@
"build:dev": "yarn workspace @mergin/app build:dev",
"build:admin": "yarn workspace @mergin/admin-app build",
"build:admin:dev": "yarn workspace @mergin/admin-app build:dev",
"clean:libs": "yarn workspace @mergin/lib clean && yarn workspace @mergin/admin-lib clean && yarn workspace @mergin/lib-vue2 clean",
"clean:libs": "yarn workspace @mergin/lib clean && yarn workspace @mergin/admin-lib clean",
"clean:libs:noadmin": "yarn workspace @mergin/lib clean",
"i18n:report": "yarn workspace @mergin/app 18n:report",
"link:dependencies": "yarn link:register && yarn link @mergin/lib && yarn link @mergin/admin-lib && yarn link @mergin/lib-vue2",
"link:dependencies": "yarn link:register && yarn link @mergin/lib && yarn link @mergin/admin-lib",
"link:register": "yarn workspaces run link:register",
"link:unregister": "yarn workspaces run link:unregister",
"types:libs": "yarn workspaces run build:types",
"types:lib": "yarn workspace @mergin/lib build:types",
"types:lib-vue2": "yarn workspace @mergin/lib-vue2 build:types",
"types:admin-lib": "yarn workspace @mergin/admin-lib build:types",
"watch:lib": "yarn workspace @mergin/lib build:lib:watch",
"watch:lib-vue2": "yarn workspace @mergin/lib-vue2 build:lib:watch",
"watch:lib:types": "yarn workspace @mergin/lib build:types:watch",
"watch:lib-vue2:types": "yarn workspace @mergin/lib-vue2 build:types:watch",
"watch:admin-lib": "yarn workspace @mergin/admin-lib build:lib:watch",
"watch:admin-lib:types": "yarn workspace @mergin/admin-lib build:types:watch",
"lint:all": "yarn workspaces run lint",
Expand Down Expand Up @@ -80,7 +75,5 @@
"node": ">=18"
},
"version": "0.0.0",
"dependencies": {
"@vitejs/plugin-vue2": "^2.3.1"
}
"dependencies": {}
}
5 changes: 1 addition & 4 deletions web-app/packages/admin-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@
"clean": "echo 'Nothing to clean.'",
"link:register": "echo '[@mergin/admin-app] Nothing to register.'",
"link:unregister": "echo '[@mergin/admin-app] Nothing to unregister.'",
"lint": "eslint . --ext .js,.vue,.ts",
"i18n:report": "vue-cli-service i18n:report --src './src/admin/**/*.?(js|vue)' --locales './src/admin/locales/**/*.json'"
"lint": "eslint . --ext .js,.vue,.ts"
},
"dependencies": {
"@tabler/icons-webfont": "^2.42.0",
"axios": "^0.28.1",
"lodash": "^4.17.21",
"material-icons": "^0.2.3",
"pinia": "^2.1.7",
"primeflex": "^3.3.1",
"primevue": "3.43.0",
"vue": "3.3.8",
"vue-i18n": "^9.7.1",
"vue-meta": "^3.0.0-alpha.10",
"vue-router": "4.2.5"
}
Expand Down
3 changes: 0 additions & 3 deletions web-app/packages/admin-app/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import App from './App.vue'
import { createRouter } from './router'
import { addRouterToPinia, getPiniaInstance } from './store'

import i18n from '@/plugins/i18n/i18n'

const createMerginApp = () => {
const pinia = getPiniaInstance()
const router = createRouter(pinia)
Expand All @@ -37,7 +35,6 @@ const createMerginApp = () => {
.mixin(MerginComponentUuidMixin)
.use(pinia)
.use(router)
.use(i18n)
.use(createMetaManager())
.use(PrimeVue, { pt: MMTheme })
.use(ToastService)
Expand Down
7 changes: 1 addition & 6 deletions web-app/packages/admin-app/src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@

/// <reference types="vite/client" />

interface ImportMetaEnv {
VITE_VUE_APP_I18N_LOCALE: string
VITE_VUE_APP_I18N_FALLBACK_LOCALE: string
}

interface ImportMeta {
readonly env: ImportMetaEnv
readonly env: unknown
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ const sidebarItems = computed<SideBarItemModel[]>(() => [
to: '/projects',
icon: 'ti ti-article',
active: route.matched.some((item) => item.name === AdminRoutes.PROJECTS)
},
{
title: 'Settings',
to: '/settings',
icon: 'ti ti-settings',
active: route.matched.some((item) => item.name === AdminRoutes.SETTINGS)
}
])
</script>
Expand Down
12 changes: 0 additions & 12 deletions web-app/packages/admin-app/src/plugins/i18n/i18n.ts

This file was deleted.

45 changes: 0 additions & 45 deletions web-app/packages/admin-app/src/plugins/i18n/locale/en.json

This file was deleted.

This file was deleted.

22 changes: 12 additions & 10 deletions web-app/packages/admin-app/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import {
AccountsView,
AccountDetailView,
// SettingsView,
// ProjectSettingsView,
SettingsView,
ProjectsView,
ProjectView,
// LoginView,
// useAdminStore
AdminRoutes
} from '@mergin/admin-lib'
Expand Down Expand Up @@ -95,7 +93,7 @@ export const createRouter = (pinia: Pinia) => {
header: AppHeader
},
props: true
}
},

// redirect: { name: 'project-tree' },
// children: [
Expand Down Expand Up @@ -178,12 +176,16 @@ export const createRouter = (pinia: Pinia) => {
// }
// ]
// },
// {
// path: '/settings',
// name: 'settings',
// component: SettingsView,
// props: true
// }
{
path: '/settings',
name: AdminRoutes.SETTINGS,
components: {
default: SettingsView,
sidebar: Sidebar,
header: AppHeader
},
props: true
}
]
})

Expand Down
2 changes: 0 additions & 2 deletions web-app/packages/admin-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ export default defineConfig(({ mode }) => ({
resolve: {
alias: {
'@': resolve(__dirname, './src'),
// 'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js',
url: 'rollup-plugin-node-polyfills/polyfills/url'
},
dedupe: [
'vue',
'pinia',
'vue-router',
'vuetify',
'primevue',
'@mergin/lib',
'@mergin/admin-lib'
Expand Down
1 change: 1 addition & 0 deletions web-app/packages/admin-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"axios": "^0.28.1",
"axios-retry": "^3.2.4",
"lodash": "^4.17.21",
"pinia": "^2.1.7",
"primeflex": "^3.3.1",
"primevue": "3.43.0",
"universal-cookie": "^4.0.4",
Expand Down
7 changes: 1 addition & 6 deletions web-app/packages/admin-lib/src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@

/// <reference types="vite/client" />

interface ImportMetaEnv {
VITE_VUE_APP_I18N_LOCALE: string
VITE_VUE_APP_I18N_FALLBACK_LOCALE: string
}

interface ImportMeta {
readonly env: ImportMetaEnv
readonly env: unknown
}
2 changes: 1 addition & 1 deletion web-app/packages/admin-lib/src/modules/admin/adminApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const AdminApi = {
)
},

async getServerVersion(): Promise<
async getLatestServerVersion(): Promise<
AxiosResponse<LatestServerVersionResponse>
> {
return AdminModule.httpService.get('/v1/latest-version')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
@sort="onSort"
@row-click="rowClick"
data-cy="projects-table"
:row-class="(data) => (data.removed_at ? 'opacity-80' : '')"
>
<template v-for="header in headers" :key="header.field">
<PColumn
Expand Down Expand Up @@ -273,6 +274,8 @@ export default defineComponent({
},

rowClick(event: DataTableRowClickEvent) {
if (event.data.removed_at) return

this.$router.push({
name: AdminRoutes.PROJECT,
params: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
-->

<template>
<app-container
v-if="adminStore.displayUpdateAvailable && adminStore.info_url"
>
<app-container v-if="adminStore.displayUpdateAvailable">
<app-section-banner>
<template #title>Update available 🎉!</template>
<template #description
Expand All @@ -26,22 +24,19 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
</template>

<script lang="ts" setup>
import { useInstanceStore, AppSectionBanner, AppContainer } from '@mergin/lib'
import { AppSectionBanner, AppContainer } from '@mergin/lib'
import { onMounted } from 'vue'

import { useAdminStore } from '@/modules/admin/store'

const instanceStore = useInstanceStore()
const adminStore = useAdminStore()

adminStore.getCheckUpdateFromCookies()
adminStore.checkVersions({
major: instanceStore.configData?.major,
minor: instanceStore.configData?.minor,
fix: instanceStore.configData?.fix ?? null
onMounted(async () => {
await adminStore.checkVersions()
})

function openUpdateUrl() {
window.open(adminStore.info_url, '_blank')
window.open(adminStore.latestServerVersion?.info_url, '_blank')
}
</script>

Expand Down

This file was deleted.

Loading