forked from wasp-lang/open-saas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create schema.prisma * update admin pages * update app_diff * Update e2e-tests.yml * update docs & rename hook * Update schema.prisma * update app_diff * add discord auth and app_diff * update docs * Update template/app/src/auth/userSignupFields.ts Co-authored-by: Martin Šošić <[email protected]> * move landing page * update .env.vault * Update e2e-tests.yml --------- Co-authored-by: Martin Šošić <[email protected]>
- Loading branch information
Showing
46 changed files
with
956 additions
and
953 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ on: | |
|
||
env: | ||
WASP_TELEMETRY_DISABLE: 1 | ||
WASP_VERSION: 0.13.2 | ||
WASP_VERSION: 0.14.0-rc2 | ||
|
||
jobs: | ||
test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
opensaas-sh/app_diff/migrations/20240715142249_version_14/migration.sql.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- template/app/migrations/20240715142249_version_14/migration.sql | ||
+++ opensaas-sh/app/migrations/20240715142249_version_14/migration.sql | ||
@@ -0,0 +1,16 @@ | ||
+/* | ||
+ Warnings: | ||
+ | ||
+ - You are about to drop the column `sendEmail` on the `User` table. All the data in the column will be lost. | ||
+ - You are about to drop the column `subscriptionTier` on the `User` table. All the data in the column will be lost. | ||
+ - A unique constraint covering the columns `[stripeId]` on the table `User` will be added. If there are existing duplicate values, this will fail. | ||
+ | ||
+*/ | ||
+-- AlterTable | ||
+ALTER TABLE "User" DROP COLUMN "sendEmail", | ||
+DROP COLUMN "subscriptionTier", | ||
+ADD COLUMN "sendNewsletter" BOOLEAN NOT NULL DEFAULT false, | ||
+ADD COLUMN "subscriptionPlan" TEXT; | ||
+ | ||
+-- CreateIndex | ||
+CREATE UNIQUE INDEX "User_stripeId_key" ON "User"("stripeId"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- template/app/schema.prisma | ||
+++ opensaas-sh/app/schema.prisma | ||
@@ -14,7 +14,10 @@ | ||
email String? @unique | ||
username String? @unique | ||
lastActiveTimestamp DateTime @default(now()) | ||
- isAdmin Boolean @default(false) | ||
+ isAdmin Boolean @default(true) | ||
+ // isMockUser is an extra property for the demo app ensuring that all users can access | ||
+ // the admin dashboard but won't be able to see the other users' data, only mock user data. | ||
+ isMockUser Boolean @default(false) | ||
|
||
stripeId String? @unique | ||
checkoutSessionId String? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
opensaas-sh/app_diff/src/admin/dashboards/users/UsersDashboardPage.tsx.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- template/app/src/admin/dashboards/users/UsersDashboardPage.tsx | ||
+++ opensaas-sh/app/src/admin/dashboards/users/UsersDashboardPage.tsx | ||
@@ -1,14 +1,50 @@ | ||
import { type AuthUser } from 'wasp/auth'; | ||
+import { useState, useEffect } from 'react'; | ||
import UsersTable from './UsersTable'; | ||
import Breadcrumb from '../../layout/Breadcrumb'; | ||
import DefaultLayout from '../../layout/DefaultLayout'; | ||
import { useRedirectHomeUnlessUserIsAdmin } from '../../useRedirectHomeUnlessUserIsAdmin'; | ||
|
||
const Users = ({ user }: { user: AuthUser }) => { | ||
- useRedirectHomeUnlessUserIsAdmin({user}) | ||
+ const [isDemoInfoVisible, setIsDemoInfoVisible] = useState(false); | ||
+ useRedirectHomeUnlessUserIsAdmin({user}); | ||
+ | ||
+ useEffect(() => { | ||
+ try { | ||
+ if (localStorage.getItem('isDemoInfoVisible') === 'false') { | ||
+ // do nothing | ||
+ } else { | ||
+ setIsDemoInfoVisible(true); | ||
+ } | ||
+ } catch (error) { | ||
+ console.error(error); | ||
+ } | ||
+ }, []); | ||
+ | ||
+ const handleDemoInfoClose = () => { | ||
+ try { | ||
+ localStorage.setItem('isDemoInfoVisible', 'false'); | ||
+ setIsDemoInfoVisible(false); | ||
+ } catch (error) { | ||
+ console.error(error); | ||
+ } | ||
+ }; | ||
|
||
return ( | ||
<DefaultLayout user={user}> | ||
+ {/* Floating Demo Announcement */} | ||
+ {isDemoInfoVisible && ( | ||
+ <div className='fixed z-999 bottom-0 mb-2 left-1/2 -translate-x-1/2 lg:mb-4 bg-gray-700 rounded-full px-3.5 py-2 text-sm text-white duration-300 ease-in-out hover:bg-gray-800 focus-visible:outline focus-visible:outline-2 focus-visible:outline-indigo-600'> | ||
+ <div className='px-4 flex flex-row gap-2 items-center my-1'> | ||
+ <span className='text-gray-100'> | ||
+ You are viewing mock user data only ;) | ||
+ </span> | ||
+ <button className=' pl-2.5 text-gray-400 text-xl font-bold' onClick={() => handleDemoInfoClose()}> | ||
+ X | ||
+ </button> | ||
+ </div> | ||
+ </div> | ||
+ )} | ||
<Breadcrumb pageName='Users' /> | ||
<div className='flex flex-col gap-10'> | ||
<UsersTable /> |
Oops, something went wrong.