From 9e385d38529f79119158d658f4ba70e4a4e00b9c Mon Sep 17 00:00:00 2001
From: "marcel.kocisek"
Date: Fri, 22 Dec 2023 16:06:33 +0100
Subject: [PATCH 04/14] Added: - project permissions table template
---
.../project/views/ProjectSettingsView.vue | 5 +-
.../components/AccessRequestTableTemplate.vue | 3 +
.../components/ProjectPermissionsTemplate.vue | 127 ++++++++++++---
.../project/components/ProjectsTable.vue | 5 +-
.../packages/lib/src/modules/project/store.ts | 4 +-
.../packages/lib/src/modules/project/types.ts | 6 +-
.../views/ProjectSettingsViewTemplate.vue | 152 +++++++++---------
.../views/ProjectVersionsViewTemplate.vue | 36 ++---
8 files changed, 212 insertions(+), 126 deletions(-)
diff --git a/web-app/packages/app/src/modules/project/views/ProjectSettingsView.vue b/web-app/packages/app/src/modules/project/views/ProjectSettingsView.vue
index 70feaebb..5e64e70e 100644
--- a/web-app/packages/app/src/modules/project/views/ProjectSettingsView.vue
+++ b/web-app/packages/app/src/modules/project/views/ProjectSettingsView.vue
@@ -5,8 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
-->
- Hopaa
-
+
diff --git a/web-app/packages/lib/src/modules/project/components/ProjectsTable.vue b/web-app/packages/lib/src/modules/project/components/ProjectsTable.vue
index 06b18a1a..546de507 100644
--- a/web-app/packages/lib/src/modules/project/components/ProjectsTable.vue
+++ b/web-app/packages/lib/src/modules/project/components/ProjectsTable.vue
@@ -22,6 +22,9 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
:pt="{
loadingOverlay: {
class: 'bg-primary-reverse opacity-50'
+ },
+ bodyRow: {
+ class: 'text-xs hover:bg-gray-50 cursor-pointer'
}
}"
>
@@ -69,7 +72,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
value: $filters.datetime(slotProps.data.updated),
pt: { root: { 'data-cy': 'project-form-updated' } }
}"
- class="text-color-secondary text-xs mt-0"
+ class="text-color-secondary mt-0"
>
Updated {{ $filters.timediff(slotProps.data.updated) }}
diff --git a/web-app/packages/lib/src/modules/project/store.ts b/web-app/packages/lib/src/modules/project/store.ts
index 15fc0549..398af288 100644
--- a/web-app/packages/lib/src/modules/project/store.ts
+++ b/web-app/packages/lib/src/modules/project/store.ts
@@ -27,7 +27,7 @@ import {
FetchProjectVersionsPayload,
ProjectVersion,
ProjectVersionsPayload,
- ProjectAccessRequest,
+ AccessRequest,
GetUserAccessRequestsPayload,
GetAccessRequestsPayload,
DownloadPayload,
@@ -45,7 +45,7 @@ export interface UploadFilesPayload {
}
export interface ProjectState {
- accessRequests: ProjectAccessRequest[]
+ accessRequests: AccessRequest[]
accessRequestsCount: number
project: EnhancedProjectDetail
projects: ProjectListItem[]
diff --git a/web-app/packages/lib/src/modules/project/types.ts b/web-app/packages/lib/src/modules/project/types.ts
index e5e11892..6481e012 100644
--- a/web-app/packages/lib/src/modules/project/types.ts
+++ b/web-app/packages/lib/src/modules/project/types.ts
@@ -142,7 +142,7 @@ export interface ProjectParams {
namespace: string
}
-export interface ProjectAccessRequest {
+export interface AccessRequest {
expire: string
id: number
namespace: string
@@ -153,14 +153,14 @@ export interface ProjectAccessRequest {
}
export type ProjectAccessRequestResponse =
- PaginatedResponse
+ PaginatedResponse
export interface ProjectAccessRequestParams extends PaginatedRequestParamsApi {
project_name?: string
}
export interface AccessRequestsPayload extends PaginatedResponseDefaults {
- accessRequests: ProjectAccessRequest[]
+ accessRequests: AccessRequest[]
}
export interface GetUserAccessRequestsPayload {
diff --git a/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue b/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
index 85818e86..10fd3c65 100644
--- a/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
+++ b/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
@@ -5,69 +5,76 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
-->
-
+
-
-
-
-
-
-
- This is public project
- Hide this project from everyone.
-
-
- This is private project
- Make this project visible to anyone.
-
-
-
-
- Make private
- Make public
-
-
-
-
-
-
-
- Delete project
- All data will be lost
+ Requests
+ ({{ accessRequestsCount }})
+
+
+
+
+
+
+ This is public project
+ Hide this project from everyone.
-
-
-
+
+ This is private project
+ Make this project visible to anyone.
- Delete
-
-
-
-
-
-
+
+
+
+
+ Make private
+ Make public
+
+
+
+
+
+
+
+ Delete project
+ All data will be lost
+
+
+
+ Delete
+
+
+
+
+
-
+
diff --git a/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue b/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue
index 3e78e39d..671a5dd8 100644
--- a/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue
+++ b/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue
@@ -34,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
{{ col.text }}
@@ -49,7 +49,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
@@ -63,7 +63,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
v-if="col.value === 'name'"
:class="[
'flex flex-column justify-content-center col-12',
- `lg:col-${col.cols ?? 1}`
+ `lg:col-${col.cols ?? 2}`
]"
>
@@ -77,7 +77,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
v-else-if="col.value === 'created'"
:class="[
'flex flex-column justify-content-center col-12',
- `lg:col-${col.cols ?? 1}`
+ `lg:col-${col.cols ?? 2}`
]"
>
@@ -96,7 +96,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
v-else-if="col.value === 'changes.added'"
:class="[
'flex flex-column justify-content-center col-12',
- `lg:col-${col.cols ?? 1}`
+ `lg:col-${col.cols ?? 2}`
]"
>
@@ -110,7 +110,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
v-else-if="col.value === 'changes.updated'"
:class="[
'flex flex-column justify-content-center col-12',
- `lg:col-${col.cols ?? 1}`
+ `lg:col-${col.cols ?? 2}`
]"
>
@@ -124,7 +124,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
v-else-if="col.value === 'changes.removed'"
:class="[
'flex flex-column justify-content-center col-12',
- `lg:col-${col.cols ?? 1}`
+ `lg:col-${col.cols ?? 2}`
]"
>
@@ -138,7 +138,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
v-else-if="col.value === 'project_size'"
:class="[
'flex flex-column justify-content-center col-12',
- `lg:col-${col.cols ?? 1}`
+ `lg:col-${col.cols ?? 2}`
]"
>
@@ -152,7 +152,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
v-else
:class="[
'flex flex-column justify-content-center col-12',
- `lg:col-${col.cols ?? 1}`
+ `lg:col-${col.cols ?? 2}`
]"
>
@@ -252,26 +252,24 @@ export default defineComponent({
{
text: 'Version',
value: 'name',
- textClass: 'font-semibold white-space-normal'
+ textClass: 'font-semibold white-space-normal',
+ cols: 1
},
- { text: 'Created', value: 'created', cols: 2 },
- { text: 'Author', value: 'author', cols: 2 },
+ { text: 'Created', value: 'created' },
+ { text: 'Author', value: 'author' },
{
text: 'Files added',
- value: 'changes.added',
- cols: 2
+ value: 'changes.added'
},
{
text: 'Files edited',
- value: 'changes.updated',
- cols: 2
+ value: 'changes.updated'
},
{
text: 'Files removed',
- value: 'changes.removed',
- cols: 2
+ value: 'changes.removed'
},
- { text: 'Size', value: 'project_size' },
+ { text: 'Size', value: 'project_size', cols: 1 },
{ text: '', value: 'archived', fixed: true }
].map((item) => ({
...item,
From 72f57a5c109afcc5200edd08bec0dd4963215872 Mon Sep 17 00:00:00 2001
From: "marcel.kocisek"
Date: Wed, 3 Jan 2024 11:09:03 +0100
Subject: [PATCH 05/14] Upgrade deps: - vue plugin vite
---
web-app/package.json | 2 +-
web-app/yarn.lock | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/web-app/package.json b/web-app/package.json
index 476bf3a3..22a2385b 100755
--- a/web-app/package.json
+++ b/web-app/package.json
@@ -49,7 +49,7 @@
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
- "@vitejs/plugin-vue": "^4.2.3",
+ "@vitejs/plugin-vue": "^4.6.2",
"@vitejs/plugin-vue2": "^2.2.0",
"@vue/eslint-config-standard": "^8.0.1",
"@vue/eslint-config-typescript": "^11.0.2",
diff --git a/web-app/yarn.lock b/web-app/yarn.lock
index cd82f626..ed86b962 100644
--- a/web-app/yarn.lock
+++ b/web-app/yarn.lock
@@ -752,10 +752,10 @@
resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue2/-/plugin-vue2-2.2.0.tgz#7453207197d6ac2b7023cedc7133b142c604c356"
integrity sha512-1km7zEuZ/9QRPvzXSjikbTYGQPG86Mq1baktpC4sXqsXlb02HQKfi+fl8qVS703JM7cgm24Ga9j+RwKmvFn90A==
-"@vitejs/plugin-vue@^4.2.3":
- version "4.2.3"
- resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-4.2.3.tgz#ee0b6dfcc62fe65364e6395bf38fa2ba10bb44b6"
- integrity sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==
+"@vitejs/plugin-vue@^4.6.2":
+ version "4.6.2"
+ resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-4.6.2.tgz#057d2ded94c4e71b94e9814f92dcd9306317aa46"
+ integrity sha512-kqf7SGFoG+80aZG6Pf+gsZIVvGSCKE98JbiWqcCV9cThtg91Jav0yvYFC9Zb+jKetNGF6ZKeoaxgZfND21fWKw==
"@volar/language-core@1.4.1":
version "1.4.1"
From a4ea436fd2d2c3ad7d35d712c2136266135cf591 Mon Sep 17 00:00:00 2001
From: "marcel.kocisek"
Date: Wed, 3 Jan 2024 11:10:02 +0100
Subject: [PATCH 06/14] Update: - confirm dialog redesign
---
.../dialog/components/ConfirmDialog.vue | 128 ++++++++++--------
.../dialog/components/DialogWindows.vue | 5 +-
2 files changed, 76 insertions(+), 57 deletions(-)
diff --git a/web-app/packages/lib/src/modules/dialog/components/ConfirmDialog.vue b/web-app/packages/lib/src/modules/dialog/components/ConfirmDialog.vue
index 6a21b752..0280974b 100644
--- a/web-app/packages/lib/src/modules/dialog/components/ConfirmDialog.vue
+++ b/web-app/packages/lib/src/modules/dialog/components/ConfirmDialog.vue
@@ -5,71 +5,87 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
-->
-
- {{ headline }}
-
-
-
+
+
+ {{ text }}
+ {{ description }}
+
+
-
-
- {{ cancelText }}
-
-
+
+
+
+
+
+
+
+ {{ cancelText }}
+
+
{{ confirmText }}
-
-
-
+
+
+
-
diff --git a/web-app/packages/lib/src/modules/dialog/components/DialogWindows.vue b/web-app/packages/lib/src/modules/dialog/components/DialogWindows.vue
index bbcead49..f1be5a76 100644
--- a/web-app/packages/lib/src/modules/dialog/components/DialogWindows.vue
+++ b/web-app/packages/lib/src/modules/dialog/components/DialogWindows.vue
@@ -21,11 +21,14 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
class: 'w-10 lg:w-4 border-round-2xl'
},
header: {
- class: 'text-sm border-none border-round-top-2xl',
+ class: 'border-none border-round-top-2xl',
style: {
color: 'var(--forest-color)'
}
},
+ title: {
+ class: 'text-base font-semibold'
+ },
closeButton: {
style: {
backgroundColor: 'var(--light-green-color)'
From 551d041a7975f4e3f7f53ef7c0a97cf59f011ce6 Mon Sep 17 00:00:00 2001
From: "marcel.kocisek"
Date: Wed, 3 Jan 2024 11:11:08 +0100
Subject: [PATCH 07/14] Refactor: - project versions to template instead div
with same class
---
.../views/ProjectVersionsViewTemplate.vue | 78 +++++--------------
1 file changed, 20 insertions(+), 58 deletions(-)
diff --git a/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue b/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue
index 671a5dd8..1bc3bff0 100644
--- a/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue
+++ b/web-app/packages/lib/src/modules/project/views/ProjectVersionsViewTemplate.vue
@@ -55,31 +55,23 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
>
-
-
+
{{ col.text }}
{{ item.name }}
-
-
+
+
{{ col.text }}
@@ -91,76 +83,46 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
>
{{ $filters.timediff(item.created) }}
-
-
+
+
{{ col.text }}
{{
item.changes.added.length
}}
-
-
+
+
{{ col.text }}
{{ item.changes.updated.length }}
-
-
+
+
{{ col.text }}
{{ item.changes.removed.length }}
-
-
+
+
{{ col.text }}
{{
$filters.filesize(item.project_size)
}}
-
-
+
+
{{ col.text }}
{{ item[col.value] }}
-
-
+
+
From 06b657f8ba8b778ef9dbce9e18e3889135e80495 Mon Sep 17 00:00:00 2001
From: "marcel.kocisek"
Date: Wed, 3 Jan 2024 12:44:01 +0100
Subject: [PATCH 08/14] Added: - ProjectSettings redesign for CE version
(missing figma ee features) - ConfirmDialog redesign
Design:
- some margin / padding updates for header menu and sidebar
Fix:
- ProjectView fixes for non admin user and non project manager user
- app dropdown description tunning and stop bubling click event
---
.../project/views/ProjectSettingsView.vue | 2 +-
web-app/packages/lib/components.d.ts | 2 -
web-app/packages/lib/src/assets/trash.svg | 32 ++
.../lib/src/common/components/AppDropdown.vue | 20 +-
.../common/components/AppPanelToggleable.vue | 10 +-
.../dialog/components/ConfirmDialog.vue | 7 -
.../packages/lib/src/modules/dialog/types.ts | 11 +-
.../layout/components/AppHeaderTemplate.vue | 8 +-
.../modules/layout/components/SideBarItem.vue | 2 +-
.../components/AccessRequestTableTemplate.vue | 2 -
.../components/ProjectAccessRequests.vue | 4 +-
.../components/ProjectPermissionsTemplate.vue | 284 ++++++++----------
.../modules/project/views/FileBrowserView.vue | 24 +-
.../views/ProjectSettingsViewTemplate.vue | 128 ++++----
.../project/views/ProjectViewTemplate.vue | 49 +--
web-app/packages/lib/vite.config.ts | 1 +
16 files changed, 309 insertions(+), 277 deletions(-)
create mode 100644 web-app/packages/lib/src/assets/trash.svg
diff --git a/web-app/packages/app/src/modules/project/views/ProjectSettingsView.vue b/web-app/packages/app/src/modules/project/views/ProjectSettingsView.vue
index 5e64e70e..4b38ce6e 100644
--- a/web-app/packages/app/src/modules/project/views/ProjectSettingsView.vue
+++ b/web-app/packages/app/src/modules/project/views/ProjectSettingsView.vue
@@ -16,7 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
diff --git a/web-app/packages/lib/components.d.ts b/web-app/packages/lib/components.d.ts
index eea7b432..f96b3c37 100644
--- a/web-app/packages/lib/components.d.ts
+++ b/web-app/packages/lib/components.d.ts
@@ -44,7 +44,6 @@ declare module 'vue' {
VChipGroup: typeof import('vuetify/components')['VChipGroup']
VCol: typeof import('vuetify/components')['VCol']
VContainer: typeof import('vuetify/components')['VContainer']
- VDataTable: typeof import('vuetify/components')['VDataTable']
VDivider: typeof import('vuetify/components')['VDivider']
VForm: typeof import('vuetify/components')['VForm']
VIcon: typeof import('vuetify/components')['VIcon']
@@ -56,7 +55,6 @@ declare module 'vue' {
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
VResponsive: typeof import('vuetify/components')['VResponsive']
VRow: typeof import('vuetify/components')['VRow']
- VSelect: typeof import('vuetify/components')['VSelect']
VSnackbar: typeof import('vuetify/components')['VSnackbar']
VSpacer: typeof import('vuetify/components')['VSpacer']
VTextField: typeof import('vuetify/components')['VTextField']
diff --git a/web-app/packages/lib/src/assets/trash.svg b/web-app/packages/lib/src/assets/trash.svg
new file mode 100644
index 00000000..eadbcf99
--- /dev/null
+++ b/web-app/packages/lib/src/assets/trash.svg
@@ -0,0 +1,32 @@
+
diff --git a/web-app/packages/lib/src/common/components/AppDropdown.vue b/web-app/packages/lib/src/common/components/AppDropdown.vue
index f7e950ba..59c8e3cb 100644
--- a/web-app/packages/lib/src/common/components/AppDropdown.vue
+++ b/web-app/packages/lib/src/common/components/AppDropdown.vue
@@ -14,7 +14,11 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
@hide="toggle"
:pt="{
root: {
- class: 'border-transparent w-full bg-transparent'
+ class: 'border-transparent w-full bg-transparent',
+ onclick: (e) => {
+ // if in clickable area, there is problem with bubbling
+ e.stopPropagation()
+ }
},
input: {
class: 'text-xs'
@@ -23,7 +27,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
return {
class: [
'text-color p-2 hover:bg-gray-100',
- context.focused ? 'bg-gray-200' : 'bg-transparent'
+ context.focused ? 'bg-gray-50' : 'bg-transparent'
]
}
}
@@ -40,12 +44,14 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
>
-
-
- {{ option.label }}
- {{ option.description }}
+
+
+ {{ option.label }}
+ {{
+ option.description
+ }}
-
+
-
+
+
+
+
-
+
diff --git a/web-app/packages/lib/src/modules/dialog/components/ConfirmDialog.vue b/web-app/packages/lib/src/modules/dialog/components/ConfirmDialog.vue
index 0280974b..c272bd86 100644
--- a/web-app/packages/lib/src/modules/dialog/components/ConfirmDialog.vue
+++ b/web-app/packages/lib/src/modules/dialog/components/ConfirmDialog.vue
@@ -74,13 +74,6 @@ const isConfirmed = computed(() => {
? props.confirmField.expected === confirmValue.value
: true
})
-const src = computed(
- () =>
- ({
- primary: 'map-circle.svg',
- danger: 'trash.svg'
- }[props.severity])
-)
const { close } = useDialogStore()
diff --git a/web-app/packages/lib/src/modules/dialog/types.ts b/web-app/packages/lib/src/modules/dialog/types.ts
index 1d7b1a5d..955e7012 100644
--- a/web-app/packages/lib/src/modules/dialog/types.ts
+++ b/web-app/packages/lib/src/modules/dialog/types.ts
@@ -4,6 +4,15 @@
import { Component } from 'vue'
+export interface ConfirmDialogProps {
+ text: string
+ severity?: 'primary' | 'danger'
+ confirmText?: string
+ cancelText?: string
+ description?: string
+ confirmField?: { label: string; expected: string }
+}
+
export interface DialogParams {
dialog: {
maxWidth?: number
@@ -13,7 +22,7 @@ export interface DialogParams {
}
// TODO: clear unknown based on 'on-listener' in template
listeners?: unknown | Record void>
- props?: Record
+ props?: Record | ConfirmDialogProps
}
export interface DialogPayload {
diff --git a/web-app/packages/lib/src/modules/layout/components/AppHeaderTemplate.vue b/web-app/packages/lib/src/modules/layout/components/AppHeaderTemplate.vue
index 3659d06f..67ccdf90 100644
--- a/web-app/packages/lib/src/modules/layout/components/AppHeaderTemplate.vue
+++ b/web-app/packages/lib/src/modules/layout/components/AppHeaderTemplate.vue
@@ -57,7 +57,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
@@ -172,7 +172,7 @@ export default defineComponent({
location.href = '/'
}
} catch (e) {
- console.log(e)
+ console.error(e)
}
}
}
diff --git a/web-app/packages/lib/src/modules/layout/components/SideBarItem.vue b/web-app/packages/lib/src/modules/layout/components/SideBarItem.vue
index 94227c87..99b5abc5 100644
--- a/web-app/packages/lib/src/modules/layout/components/SideBarItem.vue
+++ b/web-app/packages/lib/src/modules/layout/components/SideBarItem.vue
@@ -20,7 +20,7 @@ export default defineComponent({
permissionsChange(e, item)"
:disabled="expired(item.expire)"
diff --git a/web-app/packages/lib/src/modules/project/components/ProjectAccessRequests.vue b/web-app/packages/lib/src/modules/project/components/ProjectAccessRequests.vue
index 27f63e90..0cb259d1 100644
--- a/web-app/packages/lib/src/modules/project/components/ProjectAccessRequests.vue
+++ b/web-app/packages/lib/src/modules/project/components/ProjectAccessRequests.vue
@@ -56,8 +56,6 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
{ value: 'write', label: 'Writer' },
{ value: 'owner', label: 'Owner' }
]"
- option-label="label"
- option-value="value"
v-model="permissions[item.id]"
class="w-6 lg:w-4 p-1"
/>
@@ -92,6 +90,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
diff --git a/web-app/packages/lib/src/modules/project/views/FileBrowserView.vue b/web-app/packages/lib/src/modules/project/views/FileBrowserView.vue
index 9afae92d..3d5e9fd8 100644
--- a/web-app/packages/lib/src/modules/project/views/FileBrowserView.vue
+++ b/web-app/packages/lib/src/modules/project/views/FileBrowserView.vue
@@ -23,9 +23,16 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
-
+
- Upload files
+ Upload files
-
+
@@ -103,7 +101,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
diff --git a/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue b/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
index 10fd3c65..b1872428 100644
--- a/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
+++ b/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
@@ -23,54 +23,56 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
/>
-
-
-
-
- This is public project
- Hide this project from everyone.
+
+ Advanced
+
+
+
+ This is public project
+ Hide this project from everyone.
+
+
+ This is private project
+ Make this project visible to anyone.
+
+
+
+
-
-
- This is private project
- Make this project visible to anyone.Make private
+ Make public
+
+
+
+
+
+
+
+
+ Delete project
+ All data will be lost
+
+
+
+ Delete project
-
-
-
-
- Make private
- Make public
-
-
-
-
-
-
-
- Delete project
- All data will be lost
-
-
-
- Delete
-
-
-
-
+
+
+
+
@@ -78,23 +80,25 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
import { mapActions, mapState } from 'pinia'
import { PropType, defineComponent } from 'vue'
+import AppContainer from '@/common/components/AppContainer.vue'
+import AppPanelToggleable from '@/common/components/AppPanelToggleable.vue'
+import AppSection from '@/common/components/AppSection.vue'
import { getErrorMessage } from '@/common/error_utils'
+import { ConfirmDialogProps, ProjectAccess } from '@/modules'
import ConfirmDialog from '@/modules/dialog/components/ConfirmDialog.vue'
import { useDialogStore } from '@/modules/dialog/store'
import { useNotificationStore } from '@/modules/notification/store'
import ProjectAccessRequests from '@/modules/project/components/ProjectAccessRequests.vue'
import { useProjectStore } from '@/modules/project/store'
import { useUserStore } from '@/modules/user/store'
-import AppContainer from '@/common/components/AppContainer.vue'
-import AppSection from '@/common/components/AppSection.vue'
-import { ProjectAccess } from '@/modules'
export default defineComponent({
name: 'ProjectSettingsViewTemplate',
components: {
ProjectAccessRequests,
AppContainer,
- AppSection
+ AppSection,
+ AppPanelToggleable
},
props: {
namespace: String,
@@ -173,10 +177,13 @@ export default defineComponent({
},
togglePublicPrivate() {
this.settings.access.public = !this.settings.access.public
+ this.saveSettings(this.settings)
},
confirmDelete() {
- const props = {
- text: `Are you sure to delete project: ${this.projectName}? All files will be lost.
Type in project name to confirm:`,
+ const props: ConfirmDialogProps = {
+ text: `Are you sure to delete project: ${this.projectName}?`,
+ description: 'All files will be lost. Type in project name to confirm:',
+ severity: 'danger',
confirmText: 'Delete',
confirmField: {
label: 'Project name',
@@ -196,18 +203,29 @@ export default defineComponent({
})
},
confirmPublicPrivate() {
- const props = {
+ const props: ConfirmDialogProps = {
text: `Do you really want to make this project ${
this.settings.access.public ? 'private' : 'public'
}?`,
- confirmText: 'Yes'
+ confirmText: 'Yes',
+ description: this.settings.access.public
+ ? 'Once you make your project private it can not be accessed by the community.'
+ : 'Once you make your project public it can be accessed by the community.'
}
const listeners = {
confirm: () => this.togglePublicPrivate()
}
this.showDialog({
component: ConfirmDialog,
- params: { props, listeners, dialog: { header: 'Public project' } }
+ params: {
+ props,
+ listeners,
+ dialog: {
+ header: this.settings.access.public
+ ? 'Private project'
+ : 'Public project'
+ }
+ }
})
},
onDeleteProject() {
diff --git a/web-app/packages/lib/src/modules/project/views/ProjectViewTemplate.vue b/web-app/packages/lib/src/modules/project/views/ProjectViewTemplate.vue
index f9af2a56..5704aad5 100644
--- a/web-app/packages/lib/src/modules/project/views/ProjectViewTemplate.vue
+++ b/web-app/packages/lib/src/modules/project/views/ProjectViewTemplate.vue
@@ -37,7 +37,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
-
+
-
-
+
+
@@ -123,7 +128,7 @@ import { defineComponent, PropType } from 'vue'
import { AppContainer, AppSection } from '@/common'
import { waitCursor } from '@/common/html_utils'
import { USER_ROLE_NAME_BY_ROLE, UserRole } from '@/common/permission_utils'
-import { ProjectRouteName } from '@/modules'
+import { ConfirmDialogProps, ProjectRouteName } from '@/modules'
import ConfirmDialog from '@/modules/dialog/components/ConfirmDialog.vue'
import { useDialogStore } from '@/modules/dialog/store'
import { useLayoutStore } from '@/modules/layout/store'
@@ -136,6 +141,7 @@ import { useUserStore } from '@/modules/user/store'
interface TabItem {
route: string
+ header?: string
}
export default defineComponent({
@@ -181,31 +187,34 @@ export default defineComponent({
...mapState(useUserStore, ['currentWorkspace', 'isLoggedIn']),
tabs(): TabItem[] {
- const defaultTabs: TabItem[] = [
+ const tabs: TabItem[] = [
{
- route: ProjectRouteName.ProjectTree
+ route: ProjectRouteName.ProjectTree,
+ header: 'Files'
}
]
if (this.loggedUser) {
// If map in slots, add route to map tab
if (this.$slots['map.tab']) {
- defaultTabs.push({
+ tabs.push({
route: this.mapRoute
})
}
if (this.showHistory) {
- defaultTabs.push({
- route: ProjectRouteName.ProjectHistory
+ tabs.push({
+ route: ProjectRouteName.ProjectHistory,
+ header: 'History'
})
}
if (this.showSettings) {
- defaultTabs.push({
- route: ProjectRouteName.ProjectSettings
+ tabs.push({
+ route: ProjectRouteName.ProjectSettings,
+ header: 'Settings'
})
}
}
- return defaultTabs
+ return tabs
},
activeTabIndex(): number {
@@ -335,12 +344,14 @@ export default defineComponent({
waitCursor(false)
})
},
- unsubscribeDialog() {
+ leaveDialog() {
const projPath = `${this.namespace}/${this.projectName}`
- const props = {
- text: `Are you sure to leave the project ${projPath}?
- You will not have access to it anymore.`,
- confirmText: 'OK'
+ const props: ConfirmDialogProps = {
+ text: `Are you sure to leave the project ${projPath}?`,
+ description: 'You will not have access to it anymore.',
+ severity: 'danger',
+ confirmText: 'Yes',
+ cancelText: 'No'
}
const listeners = {
confirm: async () => {
@@ -355,7 +366,7 @@ export default defineComponent({
params: {
props,
listeners,
- dialog: { maxWidth: 500, header: 'Leave project' }
+ dialog: { header: 'Leave project' }
}
})
},
diff --git a/web-app/packages/lib/vite.config.ts b/web-app/packages/lib/vite.config.ts
index 40fe71a0..79c2825e 100644
--- a/web-app/packages/lib/vite.config.ts
+++ b/web-app/packages/lib/vite.config.ts
@@ -59,6 +59,7 @@ export default defineConfig(({ mode }) => ({
transformMixedEsModules: true
},
// Fix for watching, if watch:lib, disable this
+ // sourcemap: mode !== 'production',
sourcemap: false,
lib: {
// Could also be a dictionary or array of multiple entry points
From 3576dbb398df5c71db020575e67b44b39656532f Mon Sep 17 00:00:00 2001
From: "marcel.kocisek"
Date: Wed, 3 Jan 2024 13:42:56 +0100
Subject: [PATCH 09/14] Linting: - fixe some errors in lintjng of lib and app -
allow extending of parent eslint config (not extended properly ... :( )
---
web-app/.eslintrc.cjs | 7 +++----
web-app/packages/app/.eslintrc.cjs | 6 ++----
web-app/packages/app/src/App.vue | 2 +-
web-app/packages/app/src/app.ts | 16 +++++++---------
web-app/packages/app/src/main.ts | 2 +-
.../src/modules/project/views/ProjectView.vue | 6 +++++-
.../app/src/modules/user/views/LoginView.vue | 2 +-
web-app/packages/app/src/router.ts | 10 ++++------
web-app/packages/lib/.eslintrc.cjs | 6 ++----
.../packages/lib/src/common/route_utils.ts | 19 ++++++++++---------
web-app/packages/lib/src/common/types.ts | 4 ++--
.../packages/lib/src/modules/project/types.ts | 3 +--
.../packages/lib/src/modules/user/store.ts | 2 +-
13 files changed, 40 insertions(+), 45 deletions(-)
diff --git a/web-app/.eslintrc.cjs b/web-app/.eslintrc.cjs
index 753811d3..c3e9d504 100644
--- a/web-app/.eslintrc.cjs
+++ b/web-app/.eslintrc.cjs
@@ -1,7 +1,8 @@
module.exports = {
root: true,
env: {
- es2021: true
+ es2021: true,
+ browser: true
},
extends: [
'plugin:vue/essential',
@@ -42,8 +43,6 @@ module.exports = {
{
allowModifiers: true
}
- ],
- 'vue/multi-word-component-names': 'off',
- 'vue/no-v-model-argument': 'off',
+ ]
}
}
diff --git a/web-app/packages/app/.eslintrc.cjs b/web-app/packages/app/.eslintrc.cjs
index c62b242c..9a294e26 100644
--- a/web-app/packages/app/.eslintrc.cjs
+++ b/web-app/packages/app/.eslintrc.cjs
@@ -1,11 +1,9 @@
module.exports = {
- env: {
- node: true
- },
extends: [
'plugin:vue/essential',
'eslint:recommended',
'@vue/typescript/recommended',
+ '../../.eslintrc.cjs'
],
parser: 'vue-eslint-parser',
parserOptions: {
@@ -16,7 +14,7 @@ module.exports = {
plugins: ['@typescript-eslint'],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
- 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
// Vue 3 opt https://v3-migration.vuejs.org/breaking-changes/key-attribute.html#with-template-v-for
'vue/no-v-for-template-key-on-child': 'error',
'vue/no-v-for-template-key': 'off',
diff --git a/web-app/packages/app/src/App.vue b/web-app/packages/app/src/App.vue
index 9c460c8d..3f34f990 100644
--- a/web-app/packages/app/src/App.vue
+++ b/web-app/packages/app/src/App.vue
@@ -47,7 +47,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
>
-
+
diff --git a/web-app/packages/app/src/app.ts b/web-app/packages/app/src/app.ts
index 56e2114b..40e42b7d 100644
--- a/web-app/packages/app/src/app.ts
+++ b/web-app/packages/app/src/app.ts
@@ -6,14 +6,6 @@
import 'material-icons/iconfont/material-icons.scss'
import '@fortawesome/fontawesome-free/css/all.css'
import '@mdi/font/css/materialdesignicons.css'
-import PrimeVue from 'primevue/config';
-import "primevue/resources/primevue.min.css";
-import "primeflex/primeflex.min.css"
-import "@mergin/lib/dist/sass/themes/mm-theme-light/theme.scss"
-import "@tabler/icons-webfont/tabler-icons.min.css"
-
-import '@mergin/lib/dist/style.css'
-
import {
dateUtils,
textUtils,
@@ -22,6 +14,13 @@ import {
MerginComponentUuidMixin
} from '@mergin/lib'
import PortalVue from 'portal-vue'
+import 'primevue/resources/primevue.min.css'
+import 'primeflex/primeflex.min.css'
+import '@mergin/lib/dist/sass/themes/mm-theme-light/theme.scss'
+import '@tabler/icons-webfont/tabler-icons.min.css'
+import '@mergin/lib/dist/style.css'
+import PrimeVue from 'primevue/config'
+import Tooltip from 'primevue/tooltip'
import { createApp } from 'vue'
import { createMetaManager } from 'vue-meta'
@@ -31,7 +30,6 @@ import { addRouterToPinia, getPiniaInstance } from './store'
import i18n from '@/plugins/i18n/i18n'
import vuetify from '@/plugins/vuetify/vuetify'
-import Tooltip from 'primevue/tooltip';
const createMerginApp = () => {
const pinia = getPiniaInstance()
diff --git a/web-app/packages/app/src/main.ts b/web-app/packages/app/src/main.ts
index 1349fafa..f140ca1d 100644
--- a/web-app/packages/app/src/main.ts
+++ b/web-app/packages/app/src/main.ts
@@ -13,7 +13,7 @@ import {
LayoutModule,
InstanceModule,
useInstanceStore,
- initCsrfToken,
+ initCsrfToken
} from '@mergin/lib'
import { createMerginApp } from './app'
diff --git a/web-app/packages/app/src/modules/project/views/ProjectView.vue b/web-app/packages/app/src/modules/project/views/ProjectView.vue
index b495a588..a57ff595 100644
--- a/web-app/packages/app/src/modules/project/views/ProjectView.vue
+++ b/web-app/packages/app/src/modules/project/views/ProjectView.vue
@@ -59,7 +59,11 @@ export default defineComponent({
namespace: props.namespace,
project: props.projectName
}
- const dialog = { maxWidth: 580, persistent: true, header: 'Clone project' }
+ const dialog = {
+ maxWidth: 580,
+ persistent: true,
+ header: 'Clone project'
+ }
const listeners = {
error: (error, data) => {
formStore.handleError({
diff --git a/web-app/packages/app/src/modules/user/views/LoginView.vue b/web-app/packages/app/src/modules/user/views/LoginView.vue
index 6eb1705b..44081ee5 100644
--- a/web-app/packages/app/src/modules/user/views/LoginView.vue
+++ b/web-app/packages/app/src/modules/user/views/LoginView.vue
@@ -36,7 +36,7 @@ export default defineComponent({
currentRoute: payload.currentRoute
})
}
- } catch(err) {
+ } catch (err) {
console.error(err)
}
}
diff --git a/web-app/packages/app/src/router.ts b/web-app/packages/app/src/router.ts
index aadd4e7b..ed640888 100644
--- a/web-app/packages/app/src/router.ts
+++ b/web-app/packages/app/src/router.ts
@@ -14,6 +14,10 @@ import {
SideBarTemplate as SideBar
} from '@mergin/lib'
import { Pinia } from 'pinia'
+import {
+ createWebHistory,
+ createRouter as createRouterInstance
+} from 'vue-router'
import DashboardView from '@/modules/dashboard/views/DashboardView.vue'
import AppHeader from '@/modules/layout/components/AppHeader.vue'
@@ -22,10 +26,6 @@ import ProjectsListView from '@/modules/project/views/ProjectsListView.vue'
import ProjectView from '@/modules/project/views/ProjectView.vue'
import LoginView from '@/modules/user/views/LoginView.vue'
import ProfileView from '@/modules/user/views/ProfileView.vue'
-import {
- createWebHistory,
- createRouter as createRouterInstance
-} from 'vue-router'
export const createRouter = (pinia: Pinia) => {
const router = createRouterInstance({
@@ -146,7 +146,6 @@ export const createRouter = (pinia: Pinia) => {
}/tree${from.params.location ? `/${from.params.location}` : ''}`,
query: { file_path: to.params.location }
})
- return
}
},
/** Redirect of unused /history/:version_id path to /history?version_id */
@@ -161,7 +160,6 @@ export const createRouter = (pinia: Pinia) => {
path: `/projects/${to.params.namespace}/${to.params.projectName}/history`,
query: { version_id: to.params.version_id }
})
- return
}
},
{
diff --git a/web-app/packages/lib/.eslintrc.cjs b/web-app/packages/lib/.eslintrc.cjs
index 85505c99..785ba939 100644
--- a/web-app/packages/lib/.eslintrc.cjs
+++ b/web-app/packages/lib/.eslintrc.cjs
@@ -1,11 +1,9 @@
module.exports = {
- env: {
- node: true
- },
extends: [
'plugin:vue/essential',
'eslint:recommended',
- '@vue/typescript/recommended'
+ '@vue/typescript/recommended',
+ '../../.eslintrc.cjs'
],
parser: 'vue-eslint-parser',
parserOptions: {
diff --git a/web-app/packages/lib/src/common/route_utils.ts b/web-app/packages/lib/src/common/route_utils.ts
index 4889853a..74503788 100644
--- a/web-app/packages/lib/src/common/route_utils.ts
+++ b/web-app/packages/lib/src/common/route_utils.ts
@@ -4,28 +4,29 @@
import isEqual from 'lodash/isEqual'
import pick from 'lodash/pick'
-import { Route, NavigationGuardNext } from 'vue-router'
-
-import { useUserStore } from '@/modules/user/store'
+import { NavigationGuardNext, RouteLocationNormalized } from 'vue-router'
export type IsAuthenticatedGuardOptions = {
notAuthenticatedRedirectPath?: string
}
-export function isTheSameRoute(from: Route, to: Route) {
+export function isTheSameRoute(
+ from: RouteLocationNormalized,
+ to: RouteLocationNormalized
+) {
const properties = ['name', 'path', 'hash', 'params', 'query']
return isEqual(pick(from, properties), pick(to, properties))
}
-export function getTagsFromQuery(route: Route) {
+export function getTagsFromQuery(route: RouteLocationNormalized) {
const tags = route.query.tags
return tags ? (typeof tags === 'string' ? tags.split(',') : tags) : []
}
/** Handles redirect to /login when user is not authenticated. */
export function isAuthenticatedGuard(
- to: Route,
- from: Route,
+ to: RouteLocationNormalized,
+ from: RouteLocationNormalized,
next: NavigationGuardNext,
userStore,
options?: IsAuthenticatedGuardOptions
@@ -47,8 +48,8 @@ export function isAuthenticatedGuard(
/** Handles redirect to /login when user is not superUser. */
export function isSuperUser(
- to: Route,
- from: Route,
+ to: RouteLocationNormalized,
+ from: RouteLocationNormalized,
next: NavigationGuardNext,
userStore
) {
diff --git a/web-app/packages/lib/src/common/types.ts b/web-app/packages/lib/src/common/types.ts
index 992e06f2..ee5c592a 100644
--- a/web-app/packages/lib/src/common/types.ts
+++ b/web-app/packages/lib/src/common/types.ts
@@ -16,7 +16,7 @@ export type RouteOverrides = Record<
export interface ModuleService {
httpService?: HttpService
routerService?: Router
- [key: string]: any
+ [key: string]: unknown
}
export interface BaseModule {
@@ -62,7 +62,7 @@ export interface PaginatedResponse extends PaginatedResponseDefaults {
items: readonly T[]
}
-export interface ApiRequestSuccessInfo {
+export interface ApiRequestSuccessInfo {
success: boolean
message?: string
data?: T
diff --git a/web-app/packages/lib/src/modules/project/types.ts b/web-app/packages/lib/src/modules/project/types.ts
index 6481e012..1a60ceb7 100644
--- a/web-app/packages/lib/src/modules/project/types.ts
+++ b/web-app/packages/lib/src/modules/project/types.ts
@@ -152,8 +152,7 @@ export interface AccessRequest {
user: UserSearch
}
-export type ProjectAccessRequestResponse =
- PaginatedResponse
+export type ProjectAccessRequestResponse = PaginatedResponse
export interface ProjectAccessRequestParams extends PaginatedRequestParamsApi {
project_name?: string
diff --git a/web-app/packages/lib/src/modules/user/store.ts b/web-app/packages/lib/src/modules/user/store.ts
index 6d835764..048fb025 100644
--- a/web-app/packages/lib/src/modules/user/store.ts
+++ b/web-app/packages/lib/src/modules/user/store.ts
@@ -5,7 +5,7 @@
import isObject from 'lodash/isObject'
import { defineStore, getActivePinia } from 'pinia'
import Cookies from 'universal-cookie'
-import { isNavigationFailure, NavigationFailureType } from 'vue-router'
+import { isNavigationFailure } from 'vue-router'
import { getErrorMessage } from '@/common/error_utils'
import { waitCursor } from '@/common/html_utils'
From a80f706846d8d0900093a1d0294d0a1b75e0012a Mon Sep 17 00:00:00 2001
From: "marcel.kocisek"
Date: Thu, 4 Jan 2024 14:57:06 +0100
Subject: [PATCH 10/14] Center for Advanced settings label and button
---
.../project/views/ProjectSettingsViewTemplate.vue | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue b/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
index b1872428..711f6424 100644
--- a/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
+++ b/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
@@ -28,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
Advanced
-
+
This is public project
@@ -54,11 +54,14 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
-
+
From b23dc116003daabcdbfd83ac60823ab2942f7e57 Mon Sep 17 00:00:00 2001
From: "marcel.kocisek"
Date: Thu, 4 Jan 2024 15:06:21 +0100
Subject: [PATCH 11/14] Moving access requests to top
---
.../project/views/ProjectSettingsViewTemplate.vue | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue b/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
index 711f6424..cb967b4b 100644
--- a/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
+++ b/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
@@ -6,13 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
-
-
+
Requests
@@ -22,6 +16,12 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
>
+
From 0ef11423a27ccd29e54d2dbb68a37f56729242f0 Mon Sep 17 00:00:00 2001
From: "marcel.kocisek"
Date: Mon, 8 Jan 2024 11:41:38 +0100
Subject: [PATCH 12/14] Fix text in Acces requests tables (no transfer)
---
.../project/components/AccessRequestTableTemplate.vue | 5 ++---
.../src/modules/project/components/ProjectAccessRequests.vue | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/web-app/packages/lib/src/modules/project/components/AccessRequestTableTemplate.vue b/web-app/packages/lib/src/modules/project/components/AccessRequestTableTemplate.vue
index 8adc83ce..5a118c1b 100644
--- a/web-app/packages/lib/src/modules/project/components/AccessRequestTableTemplate.vue
+++ b/web-app/packages/lib/src/modules/project/components/AccessRequestTableTemplate.vue
@@ -37,9 +37,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
User
{{ item.requested_by }}
- wants to transfer project
- {{ item.project_name }}
- to your workspace.
+ requested an access to your project
+ {{ item.project_name }}.
User
{{ item.requested_by }}
- wants to transfer project
- {{ item.project_name }}
- to your workspace.
+ requested an access to your project
+ {{ item.project_name }}.
Date: Mon, 8 Jan 2024 16:54:50 +0100
Subject: [PATCH 13/14] Small changes based on comments: - unify access
requests dropdowns with project permissions - disabled opacity .8 -> .4 -
show nampesapce in leave project dialog if props.showNamespace === true
---
.../mm-theme-light/variables/_general.scss | 2 +-
.../lib/src/common/components/AppDropdown.vue | 7 +-
.../components/AccessRequestTableTemplate.vue | 18 ++++-
.../components/ProjectAccessRequests.vue | 18 ++++-
.../components/ProjectPermissionsTemplate.vue | 78 ++++---------------
.../views/ProjectSettingsViewTemplate.vue | 5 +-
.../project/views/ProjectViewTemplate.vue | 4 +-
7 files changed, 56 insertions(+), 76 deletions(-)
diff --git a/web-app/packages/lib/src/assets/sass/themes/mm-theme-light/variables/_general.scss b/web-app/packages/lib/src/assets/sass/themes/mm-theme-light/variables/_general.scss
index 4e68cf12..f8dccc05 100644
--- a/web-app/packages/lib/src/assets/sass/themes/mm-theme-light/variables/_general.scss
+++ b/web-app/packages/lib/src/assets/sass/themes/mm-theme-light/variables/_general.scss
@@ -64,7 +64,7 @@ $inlineSpacing: .5rem;
/// Opacity of the disabled elements
/// @group general
-$disabledOpacity: .8;
+$disabledOpacity: .4;
/// Background of the modal layer
/// @group general
diff --git a/web-app/packages/lib/src/common/components/AppDropdown.vue b/web-app/packages/lib/src/common/components/AppDropdown.vue
index 59c8e3cb..b7f2d6b9 100644
--- a/web-app/packages/lib/src/common/components/AppDropdown.vue
+++ b/web-app/packages/lib/src/common/components/AppDropdown.vue
@@ -30,6 +30,11 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
context.focused ? 'bg-gray-50' : 'bg-transparent'
]
}
+ },
+ trigger(options) {
+ return {
+ class: options.props?.disabled ? 'text-color' : 'text-color-forest'
+ }
}
}"
>
@@ -39,7 +44,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
scope.class,
'ti',
isOpen ? 'ti-chevron-up' : 'ti-chevron-down',
- 'text-color-forest font-semibold text-xl'
+ 'font-semibold text-base'
]"
>
diff --git a/web-app/packages/lib/src/modules/project/components/AccessRequestTableTemplate.vue b/web-app/packages/lib/src/modules/project/components/AccessRequestTableTemplate.vue
index 5a118c1b..92f48483 100644
--- a/web-app/packages/lib/src/modules/project/components/AccessRequestTableTemplate.vue
+++ b/web-app/packages/lib/src/modules/project/components/AccessRequestTableTemplate.vue
@@ -52,9 +52,21 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
permissionsChange(e, item)"
diff --git a/web-app/packages/lib/src/modules/project/components/ProjectAccessRequests.vue b/web-app/packages/lib/src/modules/project/components/ProjectAccessRequests.vue
index fdb28f80..f208ce9a 100644
--- a/web-app/packages/lib/src/modules/project/components/ProjectAccessRequests.vue
+++ b/web-app/packages/lib/src/modules/project/components/ProjectAccessRequests.vue
@@ -51,9 +51,21 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
valueChanged(item, e)"
- :disabled="!isProjectOwner"
+ :disabled="item.user.id === loggedUser.id"
class="w-6 lg:w-full"
/>
- {{ item[col.value] }}
+ {{ item[col.value] }}
+ (me)
@@ -106,7 +115,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
- Hej
+
@@ -374,65 +383,4 @@ export default defineComponent({
})
-
+
diff --git a/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue b/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
index cb967b4b..4c3cb349 100644
--- a/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
+++ b/web-app/packages/lib/src/modules/project/views/ProjectSettingsViewTemplate.vue
@@ -80,6 +80,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
- Hide this project from everyone. - - - This is private project
- Make this project visible to anyone. - -
- All data will be lost +
+ Hide this project from everyone. -
+ Make this project visible to anyone. - Delete -
+ All data will be lost +
@@ -77,7 +77,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial v-else-if="col.value === 'created'" :class="[ 'flex flex-column justify-content-center col-12', - `lg:col-${col.cols ?? 1}` + `lg:col-${col.cols ?? 2}` ]" >
@@ -96,7 +96,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial v-else-if="col.value === 'changes.added'" :class="[ 'flex flex-column justify-content-center col-12', - `lg:col-${col.cols ?? 1}` + `lg:col-${col.cols ?? 2}` ]" >
@@ -110,7 +110,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial v-else-if="col.value === 'changes.updated'" :class="[ 'flex flex-column justify-content-center col-12', - `lg:col-${col.cols ?? 1}` + `lg:col-${col.cols ?? 2}` ]" >
@@ -124,7 +124,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial v-else-if="col.value === 'changes.removed'" :class="[ 'flex flex-column justify-content-center col-12', - `lg:col-${col.cols ?? 1}` + `lg:col-${col.cols ?? 2}` ]" >
@@ -138,7 +138,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial v-else-if="col.value === 'project_size'" :class="[ 'flex flex-column justify-content-center col-12', - `lg:col-${col.cols ?? 1}` + `lg:col-${col.cols ?? 2}` ]" >
@@ -152,7 +152,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial v-else :class="[ 'flex flex-column justify-content-center col-12', - `lg:col-${col.cols ?? 1}` + `lg:col-${col.cols ?? 2}` ]" >
@@ -252,26 +252,24 @@ export default defineComponent({
{
text: 'Version',
value: 'name',
- textClass: 'font-semibold white-space-normal'
+ textClass: 'font-semibold white-space-normal',
+ cols: 1
},
- { text: 'Created', value: 'created', cols: 2 },
- { text: 'Author', value: 'author', cols: 2 },
+ { text: 'Created', value: 'created' },
+ { text: 'Author', value: 'author' },
{
text: 'Files added',
- value: 'changes.added',
- cols: 2
+ value: 'changes.added'
},
{
text: 'Files edited',
- value: 'changes.updated',
- cols: 2
+ value: 'changes.updated'
},
{
text: 'Files removed',
- value: 'changes.removed',
- cols: 2
+ value: 'changes.removed'
},
- { text: 'Size', value: 'project_size' },
+ { text: 'Size', value: 'project_size', cols: 1 },
{ text: '', value: 'archived', fixed: true }
].map((item) => ({
...item,
From 72f57a5c109afcc5200edd08bec0dd4963215872 Mon Sep 17 00:00:00 2001
From: "marcel.kocisek"
{{ col.text }}
{{ item.name }} -{{ col.text }}
@@ -91,76 +83,46 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial > {{ $filters.timediff(item.created) }} -{{ col.text }}
{{ item.changes.added.length }} -{{ col.text }}
{{ item.changes.updated.length }} -{{ col.text }}
{{ item.changes.removed.length }} -{{ col.text }}
{{ $filters.filesize(item.project_size) }} -{{ col.text }}
{{ item[col.value] }} -{{ option.label }}
- {{ option.description }} +{{ option.label }}
+ {{ + option.description + }}
-
+
diff --git a/web-app/packages/lib/src/modules/dialog/components/ConfirmDialog.vue b/web-app/packages/lib/src/modules/dialog/components/ConfirmDialog.vue
index 0280974b..c272bd86 100644
--- a/web-app/packages/lib/src/modules/dialog/components/ConfirmDialog.vue
+++ b/web-app/packages/lib/src/modules/dialog/components/ConfirmDialog.vue
@@ -74,13 +74,6 @@ const isConfirmed = computed(() => {
? props.confirmField.expected === confirmValue.value
: true
})
-const src = computed(
- () =>
- ({
- primary: 'map-circle.svg',
- danger: 'trash.svg'
- }[props.severity])
-)
const { close } = useDialogStore()
diff --git a/web-app/packages/lib/src/modules/dialog/types.ts b/web-app/packages/lib/src/modules/dialog/types.ts
index 1d7b1a5d..955e7012 100644
--- a/web-app/packages/lib/src/modules/dialog/types.ts
+++ b/web-app/packages/lib/src/modules/dialog/types.ts
@@ -4,6 +4,15 @@
import { Component } from 'vue'
+export interface ConfirmDialogProps {
+ text: string
+ severity?: 'primary' | 'danger'
+ confirmText?: string
+ cancelText?: string
+ description?: string
+ confirmField?: { label: string; expected: string }
+}
+
export interface DialogParams {
dialog: {
maxWidth?: number
@@ -13,7 +22,7 @@ export interface DialogParams {
}
// TODO: clear unknown based on 'on-listener' in template
listeners?: unknown | Record- Hide this project from everyone. +
Advanced
+This is public project
+ Hide this project from everyone. + + +This is private project
+ Make this project visible to anyone. + +- Make this project visible to anyone.Make private + Make public +
Delete project
+ All data will be lost +- All data will be lost -
Type in project name to confirm:`, + const props: ConfirmDialogProps = { + text: `Are you sure to delete project: ${this.projectName}?`, + description: 'All files will be lost. Type in project name to confirm:', + severity: 'danger', confirmText: 'Delete', confirmField: { label: 'Project name', @@ -196,18 +203,29 @@ export default defineComponent({ }) }, confirmPublicPrivate() { - const props = { + const props: ConfirmDialogProps = { text: `Do you really want to make this project ${ this.settings.access.public ? 'private' : 'public' }?`, - confirmText: 'Yes' + confirmText: 'Yes', + description: this.settings.access.public + ? 'Once you make your project private it can not be accessed by the community.' + : 'Once you make your project public it can be accessed by the community.' } const listeners = { confirm: () => this.togglePublicPrivate() } this.showDialog({ component: ConfirmDialog, - params: { props, listeners, dialog: { header: 'Public project' } } + params: { + props, + listeners, + dialog: { + header: this.settings.access.public + ? 'Private project' + : 'Public project' + } + } }) }, onDeleteProject() { diff --git a/web-app/packages/lib/src/modules/project/views/ProjectViewTemplate.vue b/web-app/packages/lib/src/modules/project/views/ProjectViewTemplate.vue index f9af2a56..5704aad5 100644 --- a/web-app/packages/lib/src/modules/project/views/ProjectViewTemplate.vue +++ b/web-app/packages/lib/src/modules/project/views/ProjectViewTemplate.vue @@ -37,7 +37,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial
Advanced
-This is public project
@@ -54,11 +54,14 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-CommercialUser {{ item.requested_by }} - wants to transfer project - {{ item.project_name }} - to your workspace. + requested an access to your project + {{ item.project_name }}.