From fbc31510ebd0928b904197836d2262badcb5cbc4 Mon Sep 17 00:00:00 2001 From: Peter Kompasz Date: Fri, 18 Aug 2023 19:57:57 +0300 Subject: [PATCH 01/96] fix: typo --- supabase/migrations/20230815171919_base.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supabase/migrations/20230815171919_base.sql b/supabase/migrations/20230815171919_base.sql index e4e2a87a94..caedcd9c4c 100644 --- a/supabase/migrations/20230815171919_base.sql +++ b/supabase/migrations/20230815171919_base.sql @@ -1053,8 +1053,8 @@ CREATE TABLE "public"."apps" ( "name" character varying, "last_version" character varying, "updated_at" timestamp with time zone, - "id" "uuid" DEFAULT "extensions"."uuid_generate_v4"() - "retention" bigint NOT NULL DEFAULT '0'::bigint, + "id" "uuid" DEFAULT "extensions"."uuid_generate_v4"(), + "retention" bigint NOT NULL DEFAULT '0'::bigint ); From 784e44fc5a7959dd90af25c7fc56490d3baf2157 Mon Sep 17 00:00:00 2001 From: Peter Kompasz Date: Sun, 20 Aug 2023 20:35:15 +0300 Subject: [PATCH 02/96] locales --- locales/en.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/locales/en.yml b/locales/en.yml index 4e51400ef7..d4b546f4b7 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -334,3 +334,9 @@ your-api-key: 'Your API key:' your-are-a: Your are a your-current-plan-is: Your current plan is your-current-suggested-plan-is: Your current suggested plan is +general-information: General Informations +members: Members +save-changes: Save Changes +cancel: Cancel +add-member: Add Member + From 6fb197424993b96bb700d5fea5a50c1b1d2e169f Mon Sep 17 00:00:00 2001 From: Peter Kompasz Date: Sun, 20 Aug 2023 20:35:20 +0300 Subject: [PATCH 03/96] feat: dark mode --- src/composables/dark.ts | 10 ++++++++-- tailwind.config.js | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/composables/dark.ts b/src/composables/dark.ts index 5976a5a639..0f8d4a6739 100644 --- a/src/composables/dark.ts +++ b/src/composables/dark.ts @@ -1,3 +1,9 @@ -import { useDark } from '@vueuse/core' +import { useDark, useToggle } from '@vueuse/core' -export const isDark = useDark() +const isDark = useDark() +const toggleDark = useToggle(isDark) + +export { + isDark, + toggleDark, +} diff --git a/tailwind.config.js b/tailwind.config.js index 3af5e46a6b..326024b62c 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -16,6 +16,7 @@ const base100 = '#2A303C' const info = '#3ABFF8' module.exports = konstaConfig({ + darkMode: 'class', konsta: { colors: { primary, From 58fa7b05914fc9d6871fd74b6f15cb72c3ed089d Mon Sep 17 00:00:00 2001 From: Peter Kompasz Date: Sun, 20 Aug 2023 20:35:38 +0300 Subject: [PATCH 04/96] feat: Organization dropdown --- .../dashboard/DropdownOrganization.vue | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/components/dashboard/DropdownOrganization.vue diff --git a/src/components/dashboard/DropdownOrganization.vue b/src/components/dashboard/DropdownOrganization.vue new file mode 100644 index 0000000000..5c0ffb6381 --- /dev/null +++ b/src/components/dashboard/DropdownOrganization.vue @@ -0,0 +1,28 @@ + + + From a901e562af9c1fee46d2059ad86a89b25a11ac55 Mon Sep 17 00:00:00 2001 From: Peter Kompasz Date: Sun, 20 Aug 2023 20:35:58 +0300 Subject: [PATCH 05/96] feat: organization store --- src/stores/organization.ts | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/stores/organization.ts diff --git a/src/stores/organization.ts b/src/stores/organization.ts new file mode 100644 index 0000000000..1a97d81fea --- /dev/null +++ b/src/stores/organization.ts @@ -0,0 +1,79 @@ +import { defineStore } from 'pinia' +import { computed, ref } from 'vue' +import type { ComputedRef, Ref } from 'vue' +import type { Database } from '~/types/supabase.types' + +type User = Database['public']['Tables']['users']['Row'] +type Organization = Database['public']['Tables']['orgs']['Row'] +// TODO Create user rights in database +// type Right = Database['public']['Tables']['user_rights']['Row'] +type Right = 'create' | 'read' | 'update' | 'delete' + +export const useOrganizationStore = defineStore('organization', () => { + const _organizations: Ref> = ref(new Map()) + + const organizations: ComputedRef = computed( + () => { + return Array.from( + _organizations.value, ([key, value]) => value, + ) + }, + ) + + const currentOrganization = ref() + + const setCurrentOrganization = (id: string) => { + currentOrganization.value = organizations.value.find(org => org.id === id) + } + + const fetchOrganizations = () => { + // ... + if (!currentOrganization.value) + currentOrganization.value = organizations.value[0] + } + + const createOrganization = (name: string, logo?: string) => { + throw new Error('Not implemented') + } + + const updateOrganization = (name: string, logo?: string) => { + throw new Error('Not implemented') + } + + const deleteOrganization = (name: string, logo?: string) => { + throw new Error('Not implemented') + } + + const getUsers = (orgId: string): User[] => { + throw new Error('Not implemented') + } + + const addUser = (newUserId: string) => { + throw new Error('Not implemented') + } + + const deleteUser = (newUserId: string) => { + throw new Error('Not implemented') + } + + const updateRightForUser = (userId: string, right: Right) => { + throw new Error('Not implemented') + } + + /** + * + * @brief Create Stripe hosted solution + * @param orgId + * @returns + */ + const getBillingInformation = (orgId: string) => { + return '' + } + + return { + organizations, + currentOrganization, + setCurrentOrganization, + fetchOrganizations, + } +}) From 9b4cac8e4193e20abbf6f8fd69fc1749eed20b06 Mon Sep 17 00:00:00 2001 From: Peter Kompasz Date: Sun, 20 Aug 2023 20:37:07 +0300 Subject: [PATCH 06/96] feat: Organization settings --- src/layouts/settings.vue | 65 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/src/layouts/settings.vue b/src/layouts/settings.vue index ad6fe15cb8..a90a54ae77 100644 --- a/src/layouts/settings.vue +++ b/src/layouts/settings.vue @@ -1,7 +1,8 @@ From 4f387df74d9465be95c4c27adbc800e1c7c23575 Mon Sep 17 00:00:00 2001 From: Peter Kompasz Date: Sun, 20 Aug 2023 20:40:25 +0300 Subject: [PATCH 09/96] feat: Organization settings tabs --- .../settings/organization/Api-Keys.vue | 233 ++++++++++++++++++ .../settings/organization/General.vue | 104 ++++++++ .../settings/organization/Members.vue | 61 +++++ 3 files changed, 398 insertions(+) create mode 100644 src/pages/dashboard/settings/organization/Api-Keys.vue create mode 100644 src/pages/dashboard/settings/organization/General.vue create mode 100644 src/pages/dashboard/settings/organization/Members.vue diff --git a/src/pages/dashboard/settings/organization/Api-Keys.vue b/src/pages/dashboard/settings/organization/Api-Keys.vue new file mode 100644 index 0000000000..eaab977b0a --- /dev/null +++ b/src/pages/dashboard/settings/organization/Api-Keys.vue @@ -0,0 +1,233 @@ + + + + + +meta: + layout: settings + diff --git a/src/pages/dashboard/settings/organization/General.vue b/src/pages/dashboard/settings/organization/General.vue new file mode 100644 index 0000000000..7ecf50f805 --- /dev/null +++ b/src/pages/dashboard/settings/organization/General.vue @@ -0,0 +1,104 @@ + + + + + +meta: + layout: settings + diff --git a/src/pages/dashboard/settings/organization/Members.vue b/src/pages/dashboard/settings/organization/Members.vue new file mode 100644 index 0000000000..e652be0879 --- /dev/null +++ b/src/pages/dashboard/settings/organization/Members.vue @@ -0,0 +1,61 @@ + + + + + +meta: + layout: settings + From 513c56d98d69227c1addb66ac06c50c3509fb710 Mon Sep 17 00:00:00 2001 From: Peter Kompasz Date: Sun, 20 Aug 2023 20:41:09 +0300 Subject: [PATCH 10/96] feat: toggle dark mode --- src/components/dashboard/DropdownProfile.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/dashboard/DropdownProfile.vue b/src/components/dashboard/DropdownProfile.vue index f5d9c61ea0..02c2c030ca 100644 --- a/src/components/dashboard/DropdownProfile.vue +++ b/src/components/dashboard/DropdownProfile.vue @@ -3,6 +3,7 @@ import { computed, onMounted, onUnmounted, ref } from 'vue' import { useRouter } from 'vue-router' import { useI18n } from 'vue-i18n' import { Capacitor } from '@capacitor/core' +import { isDark, toggleDark } from '../../composables/dark' import { useMainStore } from '~/stores/main' import { getCurrentPlanName } from '~/services/supabase' import { openMessenger } from '~/services/chatwoot' @@ -91,6 +92,13 @@ onUnmounted(() => { @focusin="dropdownOpen = true" @focusout="dropdownOpen = false" > +
  • + +
  • {{ t('settings') }} From c27828a3756d975d7dac67c6d61d6c4f14207ab1 Mon Sep 17 00:00:00 2001 From: Peter Kompasz Date: Sun, 20 Aug 2023 20:42:17 +0300 Subject: [PATCH 11/96] feat: icons --- src/components/package/InfoRow.vue | 19 ++++--------------- src/pages/dashboard/ApiKeys.vue | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/components/package/InfoRow.vue b/src/components/package/InfoRow.vue index 2bb0c52051..d5a8916d1b 100644 --- a/src/components/package/InfoRow.vue +++ b/src/components/package/InfoRow.vue @@ -1,10 +1,6 @@