Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade v0.14 #232

Merged
merged 15 commits into from
Jul 16, 2024
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
WASP_TELEMETRY_DISABLE: 1
WASP_VERSION: 0.13.2
WASP_VERSION: 0.14.0-rc1

jobs:
test:
Expand Down
4 changes: 2 additions & 2 deletions opensaas-sh/app_diff/.env.vault.diff
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
+#/--------------------------------------------------/
+
+# development
+DOTENV_VAULT_DEVELOPMENT="Ct9rt25WCbbnLKtoBovU6UMg8h14tIi/ZZxEUiCnSE6ibVMql0vjl1nGbsY+wKaPwPnh/SHeGVDHzsST3lKMdIIOQH138ecpyB2xGlysaSDkJcHi/LwNx28pNdCCthtjdtVj5nOcZwixl2RHxoxReQB+xK+Bf2tG0UiDJD7r7CyQi+7V9NcukyDXgX87xWM/ULVvMVlEK7PSJKWx1FVjH1wj0U+/GCPHMJP+gbKTy6/NdNw92hecZvFI1cGD6ouR7pNtseSp6h8TYMQWP+Qs7fLM132tFOrWSCqkc2f3LsPeJJ6xhN0zGnbGyvU5w0L6k6mD0sWH0vhvORzoXFm9CS63raJBlAZ944FCFtJvZcSTyKsS8us0gqyNlhAE+jEnkSxH5xMOudst2YfQZthWl6u8TsELN55ZRRvEV/C9Rd9lDuqsBWX+gKKYdJzBg3dFEymQoIsUGoxVN5jFo04kxA0rtSV6YqqtOkH9yxOCyqFL8bydivfZbOuxOPvUkdwJbyr1HLDqdu5psyVK1RabNrEOKUwF7Al2+I12IesMS+/Fxtp8Uuhu2O5dI7lX8+6WYIuo02AREl8uIvgTktzxtMReXTR2WbN8Ht3MJYSuCjFLfugv//kun4sTgloiwCEk4a6f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fI1pLeCHpBC1FrLBaxhFNFlkqsXiopen4iJf4ihWICn1hMCBGGRosKQJdj+y65FJMwraBbEVHa29FHYruhAPGFqGfEIWvQ++LXlPguJM/RL2txMoVppDanOwFCM3dMO3sF55BEuSSNJWX2s72ZDgTW4/Il7YiIBwwxChPs5vOQweYKqOd21HCl4t+ocu95ja3ZGROnhff72j2pCk7cahaVl/PS8WU7nZ1JQtkv5vNRR3nHgAH1nS9tSBDJ8twKEQ4bJcu2qdhGeQwenKRsV4nrKooGnQ8UlsvoTyozYYCseds2/iXX5vlc/lhL1fgcPPxoss2p+lDaS3AIIEMq0/TUCeRF2ImYUIMnnvCEb0T32Pz8bIfPblSThETdQ5A7ZRjyU9T9Ff6lpxqQwGUWO/ElKZ/CDsoeuj1UqOVLGRBwThrOHlU7LZ6kJnBvcy6AmWccE5fLsmf1l189FwMH6CimHIg2OC4ndCbiRKiP3+3OYHL0JSkTt8Lrsu/b+Mu0Kmiks1A16Sx2Lu1lUfPSsbAgYRYni7OkpgCOJ5DdnP607LTFVIichq4+KzQsc="
Expand Down
29 changes: 13 additions & 16 deletions opensaas-sh/app_diff/main.wasp.diff
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- template/app/main.wasp
+++ opensaas-sh/app/main.wasp
@@ -3,24 +3,24 @@
version: "^0.13.2"
version: "^0.14.0"
},

- title: "My Open SaaS App",
Expand Down Expand Up @@ -45,7 +45,7 @@
},
emailVerification: {
clientRoute: EmailVerificationRoute,
@@ -44,16 +44,14 @@
@@ -44,21 +44,18 @@
},
userSignupFields: import { getEmailUserFields } from "@src/auth/userSignupFields",
},
Expand All @@ -59,6 +59,11 @@
- // userSignupFields: import { getGitHubUserFields } from "@src/auth/userSignupFields",
- // configFn: import { getGitHubAuthConfig } from "@src/auth/userSignupFields",
- // },
- // Uncomment to enable Discord Auth (check https://wasp-lang.dev/docs/auth/social-auth/discord for setup instructions):
- // discord: {
- // userSignupFields: import { getDiscordUserFields } from "@src/auth/userSignupFields",
- // configFn: import { getDiscordAuthConfig } from "@src/auth/userSignupFields"
- // }
+ google: {
+ userSignupFields: import { getGoogleUserFields } from "@src/auth/userSignupFields",
+ configFn: import { getGoogleAuthConfig } from "@src/auth/userSignupFields",
Expand All @@ -67,10 +72,14 @@
+ userSignupFields: import { getGitHubUserFields } from "@src/auth/userSignupFields",
+ configFn: import { getGitHubAuthConfig } from "@src/auth/userSignupFields",
+ },
+ discord: {
+ userSignupFields: import { getDiscordUserFields } from "@src/auth/userSignupFields",
+ configFn: import { getDiscordAuthConfig } from "@src/auth/userSignupFields"
+ }
},
onAfterSignup: import { onAfterSignup } from "@src/auth/hooks",
onAuthFailedRedirectTo: "/login",
onAuthSucceededRedirectTo: "/demo-app",
@@ -76,11 +74,11 @@
@@ -81,11 +78,11 @@
// NOTE: "Dummy" provider is just for local development purposes.
// Make sure to check the server logs for the email confirmation url (it will not be sent to an address)!
// Once you are ready for production, switch to e.g. "SendGrid" or "Mailgun" providers. Check out https://docs.opensaas.sh/guides/email-sending/ .
Expand All @@ -84,15 +93,3 @@
},
},
}
@@ -125,7 +123,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?
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");
14 changes: 14 additions & 0 deletions opensaas-sh/app_diff/schema.prisma.diff
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?
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
--- template/app/src/admin/dashboards/analytics/AnalyticsDashboardPage.tsx
+++ opensaas-sh/app/src/admin/dashboards/analytics/AnalyticsDashboardPage.tsx
@@ -1,4 +1,5 @@
import { type User } from 'wasp/entities';
@@ -1,4 +1,6 @@
+import { Link } from "wasp/client/router";
import { type AuthUser } from 'wasp/auth';
+import { useState, useEffect } from 'react';
import { useQuery, getDailyStats } from 'wasp/client/operations';
import TotalSignupsCard from './TotalSignupsCard';
import TotalPageViewsCard from './TotalPageViewsCard';
@@ -10,6 +11,7 @@
import { useHistory } from 'react-router-dom';
@@ -10,12 +12,45 @@
import { useRedirectHomeUnlessUserIsAdmin } from '../../useRedirectHomeUnlessUserIsAdmin'

const Dashboard = ({ user }: { user: User }) => {
const Dashboard = ({ user }: { user: AuthUser }) => {
+ const [isDemoInfoVisible, setIsDemoInfoVisible] = useState(false);
const history = useHistory();
if (!user.isAdmin) {
history.push('/');
@@ -17,8 +19,40 @@
useRedirectHomeUnlessUserIsAdmin({ user })

const { data: stats, isLoading, error } = useQuery(getDailyStats);

Expand All @@ -40,7 +38,7 @@
+ };
+
return (
<DefaultLayout>
<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'>
Expand Down
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 />
Original file line number Diff line number Diff line change
@@ -1,56 +1,10 @@
--- template/app/src/admin/dashboards/users/UsersTable.tsx
+++ opensaas-sh/app/src/admin/dashboards/users/UsersTable.tsx
@@ -9,8 +9,10 @@
@@ -9,6 +9,7 @@
const [skip, setskip] = useState(0);
const [page, setPage] = useState(1);
const [email, setEmail] = useState<string | undefined>(undefined);
+
const [isAdminFilter, setIsAdminFilter] = useState<boolean | undefined>(undefined);
const [statusOptions, setStatusOptions] = useState<SubscriptionStatus[]>([]);
+ const [isDemoInfoVisible, setIsDemoInfoVisible] = useState(false);
const { data, isLoading, error } = useQuery(getPaginatedUsers, {
skip,
emailContains: email,
@@ -26,8 +28,42 @@
setskip((page - 1) * 10);
}, [page]);

+ 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 (
<div className='flex flex-col gap-4'>
+ {/* 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>
+ )}
<div className='rounded-sm border border-stroke bg-white shadow-default dark:border-strokedark dark:bg-boxdark'>
<div className='flex-col flex items-start justify-between p-6 gap-3 w-full bg-gray-100/40 dark:bg-gray-700/50'>
<span className='text-sm font-medium'>Filters:</span>
36 changes: 36 additions & 0 deletions opensaas-sh/app_diff/src/auth/userSignupFields.ts.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
--- template/app/src/auth/userSignupFields.ts
+++ opensaas-sh/app/src/auth/userSignupFields.ts
@@ -1,11 +1,8 @@
import { z } from 'zod';
import { defineUserSignupFields } from 'wasp/auth/providers/types';

-const adminEmails = process.env.ADMIN_EMAILS?.split(',') || [];
-
export const getEmailUserFields = defineUserSignupFields({
username: (data: any) => data.email,
- isAdmin: (data: any) => adminEmails.includes(data.email),
email: (data: any) => data.email,
});

@@ -29,10 +26,6 @@
const githubData = githubDataSchema.parse(data);
return githubData.profile.login;
},
- isAdmin: (data) => {
- const githubData = githubDataSchema.parse(data);
- return adminEmails.includes(githubData.profile.emails[0].email);
- },
});

// NOTE: if we don't want to access users' emails, we can use scope ["user:read"]
@@ -58,10 +51,6 @@
const googleData = googleDataSchema.parse(data);
return googleData.profile.email;
},
- isAdmin: (data) => {
- const googleData = googleDataSchema.parse(data);
- return adminEmails.includes(googleData.profile.email);
- },
});

export function getGoogleAuthConfig() {
3 changes: 1 addition & 2 deletions opensaas-sh/blog/src/content/docs/general/admin-dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
title: Admin Dashboard
banner:
content: |
⚠️ Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.13</a>! If you're running an older version of Open SaaS, please follow the
<a href="https://wasp-lang.dev/docs/migrate-from-0-12-to-0-13">migration instructions here</a> ⚠️
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a>
---
This is a reference on how the Admin dashboard is set up and works.

Expand Down
3 changes: 1 addition & 2 deletions opensaas-sh/blog/src/content/docs/general/user-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
title: User Overview
banner:
content: |
⚠️ Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.13</a>! If you're running an older version of Open SaaS, please follow the
<a href="https://wasp-lang.dev/docs/migrate-from-0-12-to-0-13">migration instructions here</a> ⚠️
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a>
---

This reference will help you understand how the User entity works in this template.
Expand Down
3 changes: 1 addition & 2 deletions opensaas-sh/blog/src/content/docs/guides/analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
title: Analytics
banner:
content: |
⚠️ Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.13</a>! If you're running an older version of Open SaaS, please follow the
<a href="https://wasp-lang.dev/docs/migrate-from-0-12-to-0-13">migration instructions here</a> ⚠️
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a>
---
This guide will show you how to integrate analytics for your app. You can choose between [Google Analytics](#google-analytics) and [Plausible](#plausible).

Expand Down
Loading