From 3da58bd4113085326e60072b36b4aa2e3e9d1154 Mon Sep 17 00:00:00 2001 From: Alder Whiteford Date: Tue, 18 Jun 2024 19:37:09 -0400 Subject: [PATCH] Basic Changes (#1054) Co-authored-by: Alder Whiteford --- .../integrations/oauth/soth/sothic/sothic.go | 2 -- backend/server/server.go | 2 +- frontend/lib/package.json | 2 +- frontend/lib/src/api/base.ts | 5 +++-- frontend/mobile/app.json | 2 +- frontend/mobile/package.json | 2 +- frontend/mobile/src/app/auth/index.tsx | 19 ------------------- .../components/Calendar/DayTimeSection.tsx | 8 +++----- .../EventCard/Variants/EventCardBig.tsx | 2 +- frontend/mobile/yarn.lock | 8 ++++---- 10 files changed, 15 insertions(+), 37 deletions(-) diff --git a/backend/integrations/oauth/soth/sothic/sothic.go b/backend/integrations/oauth/soth/sothic/sothic.go index 17d896ac..7b16f2e4 100644 --- a/backend/integrations/oauth/soth/sothic/sothic.go +++ b/backend/integrations/oauth/soth/sothic/sothic.go @@ -361,12 +361,10 @@ func updateSessionValue(session *session.Session, key, value string) error { if err := gz.Close(); err != nil { return err } - encrypted, err := encrypter(b.String()) if err != nil { return err } - session.Set(key, encrypted) return nil } diff --git a/backend/server/server.go b/backend/server/server.go index 76bdf3a9..9cb952cb 100644 --- a/backend/server/server.go +++ b/backend/server/server.go @@ -58,7 +58,7 @@ func Init(db *gorm.DB, stores *store.Stores, integrations integrations.Integrati applicationURL := settings.Application.ApplicationURL() - msftProvider := msft.New(settings.Microsft.Key, fmt.Sprintf("%s/api/v1/auth/microsoftonline/callback", applicationURL), settings.Microsft.Tenant) + msftProvider := msft.New(settings.Microsft.Key, "myapp://auth/callback", settings.Microsft.Tenant) googProvider := goog.New(settings.Google.Key, settings.Google.Secret, fmt.Sprintf("%s/api/v1/auth/google/callback", applicationURL)) authMiddleware := authMiddleware.New( diff --git a/frontend/lib/package.json b/frontend/lib/package.json index d6006b1a..9b9af8d8 100644 --- a/frontend/lib/package.json +++ b/frontend/lib/package.json @@ -1,6 +1,6 @@ { "name": "@generatesac/lib", - "version": "0.0.179", + "version": "0.0.180", "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/frontend/lib/src/api/base.ts b/frontend/lib/src/api/base.ts index a4dfb23a..1920a23f 100644 --- a/frontend/lib/src/api/base.ts +++ b/frontend/lib/src/api/base.ts @@ -1,11 +1,12 @@ import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react"; -export const API_BASE_URL = "http://127.0.0.1:8080/api/v1"; +export const LOCAL_API_BASE_URL = "http://localhost:3000/api/v1"; +export const PROD_API_BASE_URL = "https://studentactivitycalendar.xyz/api/v1"; // BaseAPI for the entire application: export const baseApi = createApi({ baseQuery: fetchBaseQuery({ - baseUrl: API_BASE_URL, + baseUrl: PROD_API_BASE_URL, credentials: "include", prepareHeaders: async (headers, { getState }) => { // User slice existing must exist in all dependent apps: diff --git a/frontend/mobile/app.json b/frontend/mobile/app.json index 4bb2fce5..fc506655 100644 --- a/frontend/mobile/app.json +++ b/frontend/mobile/app.json @@ -2,7 +2,7 @@ "expo": { "name": "sac-mobile", "slug": "student-activity-calendar", - "version": "1.0.3", + "version": "1.0.4", "orientation": "portrait", "icon": "./src/assets/images/icon.png", "scheme": "myapp", diff --git a/frontend/mobile/package.json b/frontend/mobile/package.json index 7829812e..6453b596 100644 --- a/frontend/mobile/package.json +++ b/frontend/mobile/package.json @@ -25,7 +25,7 @@ "@fortawesome/free-solid-svg-icons": "^6.5.2", "@fortawesome/react-fontawesome": "^0.2.2", "@fortawesome/react-native-fontawesome": "^0.3.2", - "@generatesac/lib": "0.0.179", + "@generatesac/lib": "0.0.180", "@gorhom/bottom-sheet": "^4.6.3", "@hookform/resolvers": "^3.4.2", "@react-native-async-storage/async-storage": "^1.23.1", diff --git a/frontend/mobile/src/app/auth/index.tsx b/frontend/mobile/src/app/auth/index.tsx index 6daacdef..b1c6d789 100644 --- a/frontend/mobile/src/app/auth/index.tsx +++ b/frontend/mobile/src/app/auth/index.tsx @@ -1,8 +1,6 @@ import React from 'react'; import { Image, Linking, SafeAreaView } from 'react-native'; -import { router } from 'expo-router'; - import { authApi } from '@generatesac/lib'; import Loading from '@/src/assets/gif/loading.gif'; @@ -57,23 +55,6 @@ const WelcomePage = () => { 'Continue with Outlook' )} - diff --git a/frontend/mobile/src/app/design-system/components/Calendar/DayTimeSection.tsx b/frontend/mobile/src/app/design-system/components/Calendar/DayTimeSection.tsx index cfbaa203..e824fb9b 100644 --- a/frontend/mobile/src/app/design-system/components/Calendar/DayTimeSection.tsx +++ b/frontend/mobile/src/app/design-system/components/Calendar/DayTimeSection.tsx @@ -40,17 +40,15 @@ function convertNumToTime(num: number) { let meridiem = num === 23 ? 'AM' : 'PM'; let minutes = num % 100; - if (num !== 0 && (num < 1000 || num > 2359)) { + if (num !== 0 && (num < 0 || num > 2359)) { throw new Error('Invalid time'); } time = time / 100; - - if (num < 12) { - time += 12; + if (time < 12) { meridiem = 'AM'; } - if (num > 12) { + if (time > 12) { time -= 12; } diff --git a/frontend/mobile/src/app/design-system/components/EventCard/Variants/EventCardBig.tsx b/frontend/mobile/src/app/design-system/components/EventCard/Variants/EventCardBig.tsx index 32c9eea0..31bd582a 100644 --- a/frontend/mobile/src/app/design-system/components/EventCard/Variants/EventCardBig.tsx +++ b/frontend/mobile/src/app/design-system/components/EventCard/Variants/EventCardBig.tsx @@ -29,7 +29,7 @@ export const EventCardBig: React.FC = ({ return ( router.navigate(`/event/${eventId}`)} + onPress={() => router.navigate(`/app/event/${eventId}`)} >