From 3d2e7d5c10e784b0a4a8988b6ce3b49c48de64ba Mon Sep 17 00:00:00 2001 From: Jan Ackermann Date: Wed, 11 Sep 2024 08:49:54 +0200 Subject: [PATCH] Add skeleton --- dev/docker/ocis.web.config.json | 9 +- packages/web-app-activities/l10n/.tx/config | 9 ++ .../web-app-activities/l10n/translations.json | 1 + packages/web-app-activities/package.json | 22 ++++ .../src/LayoutContainer.vue | 20 +++ packages/web-app-activities/src/appid.ts | 1 + .../src/components/ActivityItem.vue | 85 +++++++++++++ packages/web-app-activities/src/index.ts | 67 ++++++++++ .../src/views/ActivityList.vue | 86 +++++++++++++ packages/web-app-activities/src/views/App.vue | 117 ++++++++++++++++++ pnpm-lock.yaml | 43 ++++++- 11 files changed, 455 insertions(+), 5 deletions(-) create mode 100644 packages/web-app-activities/l10n/.tx/config create mode 100644 packages/web-app-activities/l10n/translations.json create mode 100644 packages/web-app-activities/package.json create mode 100644 packages/web-app-activities/src/LayoutContainer.vue create mode 100644 packages/web-app-activities/src/appid.ts create mode 100644 packages/web-app-activities/src/components/ActivityItem.vue create mode 100644 packages/web-app-activities/src/index.ts create mode 100644 packages/web-app-activities/src/views/ActivityList.vue create mode 100644 packages/web-app-activities/src/views/App.vue diff --git a/dev/docker/ocis.web.config.json b/dev/docker/ocis.web.config.json index abcb088fe8d..b6e680d769b 100644 --- a/dev/docker/ocis.web.config.json +++ b/dev/docker/ocis.web.config.json @@ -20,14 +20,19 @@ "ocm", "webfinger", "epub-reader", - "app-store" + "app-store", + "activities" ], "external_apps": [ { "id": "preview", "path": "web-app-preview", "config": { - "mimeTypes": ["image/tiff", "image/bmp", "image/x-ms-bmp"] + "mimeTypes": [ + "image/tiff", + "image/bmp", + "image/x-ms-bmp" + ] } }, { diff --git a/packages/web-app-activities/l10n/.tx/config b/packages/web-app-activities/l10n/.tx/config new file mode 100644 index 00000000000..e786cede485 --- /dev/null +++ b/packages/web-app-activities/l10n/.tx/config @@ -0,0 +1,9 @@ +[main] +host = https://www.transifex.com + +[o:owncloud-org:p:owncloud-web:r:app-activities] +file_filter = locale//app.po +minimum_perc = 0 +source_file = template.pot +source_lang = en +type = PO diff --git a/packages/web-app-activities/l10n/translations.json b/packages/web-app-activities/l10n/translations.json new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/packages/web-app-activities/l10n/translations.json @@ -0,0 +1 @@ +{} diff --git a/packages/web-app-activities/package.json b/packages/web-app-activities/package.json new file mode 100644 index 00000000000..62825345c41 --- /dev/null +++ b/packages/web-app-activities/package.json @@ -0,0 +1,22 @@ +{ + "name": "web-app-activities", + "version": "0.0.0", + "private": true, + "description": "ownCloud activities app", + "license": "AGPL-3.0", + "devDependencies": { + "web-test-helpers": "workspace:*" + }, + "peerDependencies": { + "@ownclouders/web-client": "workspace:*", + "@ownclouders/web-pkg": "workspace:*", + "design-system": "workspace:@ownclouders/design-system@*", + "fuse.js": "7.0.0", + "lodash-es": "4.17.21", + "mark.js": "^8.11.1", + "pinia": "2.2.2", + "vue-concurrency": "5.0.1", + "vue-router": "4.2.5", + "zod": "3.23.8" + } +} diff --git a/packages/web-app-activities/src/LayoutContainer.vue b/packages/web-app-activities/src/LayoutContainer.vue new file mode 100644 index 00000000000..be0d6a77012 --- /dev/null +++ b/packages/web-app-activities/src/LayoutContainer.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/packages/web-app-activities/src/appid.ts b/packages/web-app-activities/src/appid.ts new file mode 100644 index 00000000000..f6dd373072f --- /dev/null +++ b/packages/web-app-activities/src/appid.ts @@ -0,0 +1 @@ +export const APPID = 'activities' diff --git a/packages/web-app-activities/src/components/ActivityItem.vue b/packages/web-app-activities/src/components/ActivityItem.vue new file mode 100644 index 00000000000..3c25c6871ce --- /dev/null +++ b/packages/web-app-activities/src/components/ActivityItem.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/packages/web-app-activities/src/index.ts b/packages/web-app-activities/src/index.ts new file mode 100644 index 00000000000..98b9cd7df8b --- /dev/null +++ b/packages/web-app-activities/src/index.ts @@ -0,0 +1,67 @@ +import translations from '../l10n/translations.json' +import { useGettext } from 'vue3-gettext' +import { computed } from 'vue' +import { AppMenuItemExtension, defineWebApplication, Extension } from '@ownclouders/web-pkg' +import { urlJoin } from '@ownclouders/web-client' +import { RouteRecordRaw } from 'vue-router' +import { APPID } from './appid' + +export default defineWebApplication({ + setup() { + const { $gettext } = useGettext() + + const appInfo = { + name: $gettext('Activities'), + id: APPID, + icon: 'pulse', + color: '#ff6961' + } + + const routes: RouteRecordRaw[] = [ + { + path: '/', + name: 'root', + component: () => import('./LayoutContainer.vue'), + redirect: urlJoin(appInfo.id, 'list'), + meta: { + authContext: 'user' + }, + children: [ + { + path: 'list', + name: 'list', + component: () => import('./views/App.vue'), + meta: { + authContext: 'user', + title: $gettext('Activities') + } + } + ] + } + ] + + const menuItemExtension: AppMenuItemExtension = { + id: `app.${appInfo.id}.menuItem`, + type: 'appMenuItem', + label: () => appInfo.name, + color: appInfo.color, + icon: appInfo.icon, + priority: 30, + path: urlJoin(appInfo.id) + } + const extensions = computed(() => { + const result: Extension[] = [] + + result.push(menuItemExtension) + + return result + }) + + return { + appInfo, + routes, + translations, + extensions + } + } +}) diff --git a/packages/web-app-activities/src/views/ActivityList.vue b/packages/web-app-activities/src/views/ActivityList.vue new file mode 100644 index 00000000000..e7c04ee887a --- /dev/null +++ b/packages/web-app-activities/src/views/ActivityList.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/packages/web-app-activities/src/views/App.vue b/packages/web-app-activities/src/views/App.vue new file mode 100644 index 00000000000..b58377a4b9d --- /dev/null +++ b/packages/web-app-activities/src/views/App.vue @@ -0,0 +1,117 @@ + + + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 86157f5ca1f..a498c9b5ef7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -510,6 +510,43 @@ importers: packages/tsconfig: {} + packages/web-app-activities: + dependencies: + '@ownclouders/web-client': + specifier: workspace:* + version: link:../web-client + '@ownclouders/web-pkg': + specifier: workspace:* + version: link:../web-pkg + design-system: + specifier: workspace:@ownclouders/design-system@* + version: link:../design-system + fuse.js: + specifier: 7.0.0 + version: 7.0.0 + lodash-es: + specifier: 4.17.21 + version: 4.17.21 + mark.js: + specifier: ^8.11.1 + version: 8.11.1 + pinia: + specifier: 2.2.2 + version: 2.2.2(typescript@5.6.2)(vue@3.5.6(typescript@5.6.2)) + vue-concurrency: + specifier: 5.0.1 + version: 5.0.1(vue@3.5.6(typescript@5.6.2)) + vue-router: + specifier: 4.2.5 + version: 4.2.5(vue@3.5.6(typescript@5.6.2)) + zod: + specifier: 3.23.8 + version: 3.23.8 + devDependencies: + web-test-helpers: + specifier: workspace:* + version: link:../web-test-helpers + packages/web-app-admin-settings: dependencies: '@ownclouders/web-client': @@ -4872,7 +4909,7 @@ packages: resolution: {integrity: sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==} engines: {node: '>= 4.0'} os: [darwin] - deprecated: Upgrade to fsevents v2 to mitigate potential security issues + deprecated: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2 fsevents@2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} @@ -10253,7 +10290,7 @@ snapshots: '@cucumber/ci-environment': 9.1.0 '@cucumber/cucumber-expressions': 16.1.1 '@cucumber/gherkin': 26.0.3 - '@cucumber/gherkin-streams': 5.0.1(@cucumber/gherkin@26.0.3)(@cucumber/message-streams@4.0.1(@cucumber/messages@21.0.1))(@cucumber/messages@21.0.1) + '@cucumber/gherkin-streams': 5.0.1(@cucumber/gherkin@26.0.3)(@cucumber/message-streams@4.0.1(@cucumber/messages@26.0.0))(@cucumber/messages@21.0.1) '@cucumber/gherkin-utils': 8.0.2 '@cucumber/html-formatter': 20.2.1(@cucumber/messages@21.0.1) '@cucumber/message-streams': 4.0.1(@cucumber/messages@21.0.1) @@ -10291,7 +10328,7 @@ snapshots: yaml: 2.5.1 yup: 0.32.11 - '@cucumber/gherkin-streams@5.0.1(@cucumber/gherkin@26.0.3)(@cucumber/message-streams@4.0.1(@cucumber/messages@21.0.1))(@cucumber/messages@21.0.1)': + '@cucumber/gherkin-streams@5.0.1(@cucumber/gherkin@26.0.3)(@cucumber/message-streams@4.0.1(@cucumber/messages@26.0.0))(@cucumber/messages@21.0.1)': dependencies: '@cucumber/gherkin': 26.0.3 '@cucumber/message-streams': 4.0.1(@cucumber/messages@21.0.1)