diff --git a/README.md b/README.md index 28d5ec6..6133c4a 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Please don't hitch your wagon to this star just yet... I'm coding this in the op - [x] Gen/Regen an invite link to allow users to join a team - [x] Team administrators and owners can accept pending invites - [x] Team administrators and owners can administer the permissions (roles) of other team members on the Accounts page -- [ ] Team owners can remove users from team +- [x] Team owners can remove users from team ### Plans and Pricing - [x] Manage multiple Plans each with specific Feature flags and Plan limits @@ -63,7 +63,6 @@ Please don't hitch your wagon to this star just yet... I'm coding this in the op ### Look and Feel, Design System and Customisation - [x] Default UI isn't too crap - [x] Integrated Design system including theming (Tailwind + daisyUI) -- [ ] Branding options (logo, color scheme, etc.) ### Demo Software (Notes) - [x] Simple Text based Notes functionality @@ -73,10 +72,6 @@ Please don't hitch your wagon to this star just yet... I'm coding this in the op - [x] Max Notes enforced - [x] Add, Delete notes on Dashboard -### Mobile App -- [ ] Flutter App Demo integrating with API endpoints, Auth etc -- [ ] Mobile-friendly web interface. - ### Testing - [ ] Unit tests for server functions - [ ] Integration tests around subscription scenarios diff --git a/components/AppHeader.vue b/components/AppHeader.vue index d798c0d..a180868 100644 --- a/components/AppHeader.vue +++ b/components/AppHeader.vue @@ -52,11 +52,12 @@ diff --git a/lib/services/account.service.ts b/lib/services/account.service.ts index c7df7ce..261af58 100644 --- a/lib/services/account.service.ts +++ b/lib/services/account.service.ts @@ -92,6 +92,25 @@ export default class AccountService { }) } + async deleteMembership(account_id: number, membership_id: number): Promise { + const membership = prisma_client.membership.findFirstOrThrow({ + where: { + id: membership_id + } + }); + + if((await membership).account_id != account_id){ + throw new Error(`Membership does not belong to current account`); + } + + return await prisma_client.membership.delete({ + where: { + id: membership_id, + }, + ...membershipWithAccount + }) + } + async joinUserToAccount(user_id: number, account_id: number, pending: boolean ): Promise { const account = await prisma_client.account.findUnique({ where: { diff --git a/pages/account.vue b/pages/account.vue index 9fcbaf5..5d6f619 100644 --- a/pages/account.vue +++ b/pages/account.vue @@ -13,79 +13,107 @@ await accountStore.getActiveAccountMembers(); }); - function formatDate(date: Date | undefined){ - if(!date){ return ""; } - return new Intl.DateTimeFormat('default', {dateStyle: 'long'}).format(date); + function formatDate(date: Date | undefined) { + if (!date) { return ""; } + return new Intl.DateTimeFormat('default', { dateStyle: 'long' }).format(date); } - function joinURL(){ + function joinURL() { return `${config.public.siteRootUrl}/join/${activeMembership.value?.account.join_password}`; } - +
+ Maximum Notes: + {{ activeMembership?.account.max_notes }} +
+ +
+ Access Level: + {{ activeMembership?.access }} +
+ +
+ Plan: + {{ activeMembership?.account.plan_name }} +
+ +
+ Join Link: +
+ + +
+
+ +
+

Members

+
+
+ {{ accountMember.user.display_name }} + {{ accountMember.access }} + ({{ accountMember.user.email }}) + + + + + +
+
+
+ + diff --git a/pages/join/[join_password].vue b/pages/join/[join_password].vue index fa39f91..09988a7 100644 --- a/pages/join/[join_password].vue +++ b/pages/join/[join_password].vue @@ -19,6 +19,7 @@ async function doJoin() { if (account) { await accountStore.joinUserToAccountPending(account.id); + navigateTo('/dashboard', {replace: true}) } else { console.log(`Unable to Join`) } @@ -27,7 +28,7 @@