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

💡 [Feat: Idée] Ajout d'un support pour le "multi-service" #564

Open
wants to merge 116 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
ece2835
feat: added new route to types
camarm-dev Jan 1, 2025
c5ee85d
feat: created new settings screen
camarm-dev Jan 1, 2025
653f00e
feat: created new route
camarm-dev Jan 1, 2025
bdb836f
feat: added new settings tab
camarm-dev Jan 1, 2025
cabacd9
fix: renamed to "MultiService"
camarm-dev Jan 1, 2025
7a7a593
fix: renamed to "MultiService"
camarm-dev Jan 1, 2025
257440b
feat: added decorative card
camarm-dev Jan 1, 2025
e52979d
feat: added store types
camarm-dev Jan 1, 2025
46da158
feat: added store definition
camarm-dev Jan 1, 2025
4d579d1
feat: added new account type for multiservice virtual space
camarm-dev Jan 1, 2025
d64299c
fix: types for `SettingsExternalServices.tsx`
camarm-dev Jan 1, 2025
e02f04a
fix: account types for new PapillonMultiService account type
camarm-dev Jan 1, 2025
0302644
fix: missing `toggleEnabledState` type definition
camarm-dev Jan 1, 2025
25aa140
fix: implemented simple enable functionnality
camarm-dev Jan 1, 2025
bb753b8
fix: added image property
camarm-dev Jan 1, 2025
91c5560
fix: modified types and resolved hook breaking code
camarm-dev Jan 1, 2025
2744655
feat: PoC settings page to create spaces
camarm-dev Jan 1, 2025
24fa06d
fix: setting image
camarm-dev Jan 1, 2025
6000123
fix: added identity provider name to MultiServiceSpace (to show space…
camarm-dev Jan 1, 2025
641679b
fix: enhanced PoC with customization...
camarm-dev Jan 1, 2025
50ecbf7
fix: removed breaking hooks code
camarm-dev Jan 1, 2025
3f5970f
feat: deleting spaces
camarm-dev Jan 1, 2025
8475021
feat: added asset for multiservice
camarm-dev Jan 2, 2025
4f79320
feat: default pfp for multiservice
camarm-dev Jan 2, 2025
1821684
feat: added new route for space setting
camarm-dev Jan 2, 2025
6c15bc5
fix: store property cannot be set to undefined
camarm-dev Jan 2, 2025
1f87d2c
feat: added multi service space personalization
camarm-dev Jan 2, 2025
3328b24
feat: added config section (WIP)
camarm-dev Jan 2, 2025
f159ada
fix: showing space name in account switcher context menu
camarm-dev Jan 2, 2025
2ce6e56
fix: possibility to mutate image key
camarm-dev Jan 2, 2025
6d35bdc
fix: better typing and setFeatureAccount function added to store
camarm-dev Jan 2, 2025
2d0ece1
fix: image settings
camarm-dev Jan 2, 2025
41ceade
feat: configuration interface idea
camarm-dev Jan 2, 2025
759dde8
fix: styles
camarm-dev Jan 2, 2025
f9c70ea
feat: added AccountItem component
camarm-dev Jan 2, 2025
3026da6
feat: functionnals settings for multiservices
camarm-dev Jan 2, 2025
670d4fb
feat: redirecting to service for each functionality
camarm-dev Jan 2, 2025
444833f
fix: using new function to retreive account object in services
camarm-dev Jan 2, 2025
2732a0a
fix: new types and structure: using accounts ids instead of copying a…
camarm-dev Jan 2, 2025
be64ca2
fix: adapted settings to new types and structure
camarm-dev Jan 2, 2025
e3a4f0a
fix: removed breaking hooks code
camarm-dev Jan 2, 2025
d743e73
fix: removed breaking hooks code
camarm-dev Jan 2, 2025
163b77a
fix: changed space account type
camarm-dev Jan 2, 2025
442b50b
fix: set accounts ids as external accounts to reload
camarm-dev Jan 2, 2025
4e30d1e
fix: set accounts ids as external accounts to reload
camarm-dev Jan 2, 2025
93d7b00
fix: updated account type to support new property `associatedAccounts…
camarm-dev Jan 2, 2025
a011ba8
fix: updated getAccountFeature to dynamiclly add instance & authentic…
camarm-dev Jan 2, 2025
ddd29d2
fix: changes to support new types
camarm-dev Jan 2, 2025
a2f740b
fix: wrong property
camarm-dev Jan 2, 2025
680bae3
fix: removed TODO
camarm-dev Jan 3, 2025
9b51668
feat: added more features
camarm-dev Jan 3, 2025
7446453
feat: features in settings
camarm-dev Jan 3, 2025
c4c8af3
feat: space support for evaluations
camarm-dev Jan 3, 2025
3254b96
fix: changed feature name
camarm-dev Jan 3, 2025
445901d
fix: too many parameters for `updateEvaluationPeriodsInCache`
camarm-dev Jan 3, 2025
772e3ce
fix: modified account types to resolve type errors
camarm-dev Jan 3, 2025
da40057
feat: multi-service support for chats
camarm-dev Jan 3, 2025
75b44a2
fix: linter
camarm-dev Jan 3, 2025
e89f62a
fix: better implementation in grades
camarm-dev Jan 3, 2025
3519dde
fix: prevent infinite loading and account interpreted as "disconnected"
camarm-dev Jan 3, 2025
cf986f0
fix: added warn to `reload-account.ts`
camarm-dev Jan 3, 2025
0568013
fix: modified store to enable featuresServices value erasing
camarm-dev Jan 3, 2025
b3eff70
fix: added some logic to account deletion for PapillonMultiServiceSpace
camarm-dev Jan 3, 2025
8f4253b
fix: typo
camarm-dev Jan 3, 2025
e27ad2a
fix: using Papillon logger
camarm-dev Jan 4, 2025
59c93de
fix: translated comments to english
camarm-dev Jan 4, 2025
04ac970
fix: simplified ternary condition
camarm-dev Jan 4, 2025
d3c36fc
fix: repaired my enter key & indentation
camarm-dev Jan 4, 2025
999375b
fix: more code property
camarm-dev Jan 4, 2025
5fed746
fix: simplified ternary condition
camarm-dev Jan 4, 2025
3bd062e
fix: simplified function
camarm-dev Jan 4, 2025
fad82e6
fix: bug & enhancements in account store logic
camarm-dev Jan 4, 2025
9057282
Merge branch 'PapillonApp:main' into feat/multiservice
camarm-dev Jan 4, 2025
4d8837b
fix: reloading instances only if it is undefined (should fix pronote …
camarm-dev Jan 4, 2025
97ab160
Merge remote-tracking branch 'origin/feat/multiservice' into feat/mul…
camarm-dev Jan 4, 2025
1defd2c
fix(ts): wrong route name & missing arguments in `DevMenu.tsx`
camarm-dev Jan 4, 2025
d589162
fix: lint
camarm-dev Jan 4, 2025
b18fab9
fix: better joke in dev menu
camarm-dev Jan 4, 2025
01a4631
fix: better joke in dev menu
camarm-dev Jan 4, 2025
bd96261
Merge remote-tracking branch 'origin/feat/multiservice' into feat/mul…
camarm-dev Jan 4, 2025
3b3160f
fix: PapillonSpace profile picture was changing randomly
camarm-dev Jan 4, 2025
2739c40
fix: forcing pfp change in `SettingsProfile.tsx`
camarm-dev Jan 4, 2025
afb3a2d
Merge branch 'PapillonApp:main' into feat/multiservice
camarm-dev Jan 4, 2025
9441864
Merge remote-tracking branch 'origin/feat/multiservice' into feat/mul…
camarm-dev Jan 4, 2025
3880934
fix: lint & types
camarm-dev Jan 4, 2025
23681f9
fix: better UI: using native buttons
camarm-dev Jan 5, 2025
fa03604
fix: UX improvement
camarm-dev Jan 5, 2025
18f0e13
Merge branch 'PapillonApp:main' into feat/multiservice
camarm-dev Jan 5, 2025
ddbcaad
Merge remote-tracking branch 'origin/feat/multiservice' into feat/mul…
camarm-dev Jan 5, 2025
a18034d
Merge branch 'PapillonApp:main' into feat/multiservice
camarm-dev Jan 11, 2025
eecb656
Merge remote-tracking branch 'origin/feat/multiservice' into feat/mul…
camarm-dev Jan 11, 2025
193b434
fix: make authentication value persistant for associated accounts
camarm-dev Jan 12, 2025
97126a4
Merge branch 'main' into feat/multiservice
camarm-dev Jan 13, 2025
8d8c24b
Merge branch 'main' into feat/multiservice
camarm-dev Jan 18, 2025
5c721bb
Merge branch 'main' into feat/multiservice
camarm-dev Jan 29, 2025
6eb589c
fix: imports
camarm-dev Jan 29, 2025
118d6ac
fix: imports
camarm-dev Jan 29, 2025
e9681c5
Merge remote-tracking branch 'origin/feat/multiservice' into feat/mul…
camarm-dev Jan 31, 2025
f1e48a3
fix(ts): added ts ignore comments for weird options in `views/index.ts`
camarm-dev Feb 1, 2025
28beadf
fix(ts): any type cast in `iutlan/grades.ts`
camarm-dev Feb 1, 2025
7e535d2
fix(ts): missing members for account in `skolengo-account.ts`
camarm-dev Feb 1, 2025
b813b99
fix(ts): missing members for PapillonMultiServiceSpace account type
camarm-dev Feb 1, 2025
a25df46
fix(ts): any type cast
camarm-dev Feb 1, 2025
e0a1322
fix(ts): missing react import
camarm-dev Feb 1, 2025
a827544
fix(ts): `SubjectList.tsx`
camarm-dev Feb 1, 2025
79bfec7
fix(ts): types in `BackgroundIUTLannion.tsx`
camarm-dev Feb 1, 2025
087ddff
fix(ts): account types in `Multi.tsx`, `UnivLimoges.tsx`, `UnivRennes…
camarm-dev Feb 1, 2025
cda9225
fix(ts): account types in all files
camarm-dev Feb 1, 2025
204a1c6
fix(ts): account types in `SettingsMultiService.tsx`
camarm-dev Feb 1, 2025
7ccb495
fix(lint): linter fixes
camarm-dev Feb 1, 2025
1805a24
fix(ts): fixed types in account store
camarm-dev Feb 2, 2025
2444534
fix: updates package-lock.json
camarm-dev Feb 2, 2025
c5412d2
fix: switching the typecheck workflow to npm
camarm-dev Feb 2, 2025
da3823c
fix(deps): updated `react-native-gesture-handler`
camarm-dev Feb 2, 2025
604dc0d
Merge branch 'main' into feat/multiservice
camarm-dev Feb 2, 2025
d4c7e08
fix(deps): updated `react-native-gesture-handler`
camarm-dev Feb 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Pnpm setup
uses: pnpm/action-setup@v2
- name: NPM setup
uses: actions/setup-node@v2
with:
version: latest
version: 20

- name: Environnement setup
run: pnpm install
run: npm install

- name: Typescript and Eslint scanning
run: pnpm lint
run: npm run lint
Binary file added assets/images/multiservice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 7 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "papillonvex",
"version": "7.8.2",
"version": "7.9.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
Expand Down Expand Up @@ -80,7 +80,7 @@
"react-native-barcode-svg": "^0.0.15",
"react-native-draggable-flatlist": "^4.0.1",
"react-native-draglist": "^3.6.1",
"react-native-gesture-handler": "~2.16.1",
"react-native-gesture-handler": "^2.22.1",
"react-native-htmlview": "^0.17.0",
"react-native-infinite-pager": "^0.3.16",
"react-native-pager-view": "6.3.0",
Expand Down
120 changes: 120 additions & 0 deletions src/components/Global/AccountItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import {Image, StyleProp, Text, View, ViewStyle} from "react-native";
import { animPapillon } from "@/utils/ui/animations";

import Reanimated, {
FadeOut,
ZoomIn
} from "react-native-reanimated";
import {PrimaryAccount, AccountService} from "@/stores/account/types";
import {defaultProfilePicture} from "@/utils/ui/default-profile-picture";
import {Check} from "lucide-react-native";
import React from "react";
import {useTheme} from "@react-navigation/native";

const AccountItem: React.FC<{
account: PrimaryAccount,
additionalStyles?: StyleProp<ViewStyle>,
endCheckMark: boolean
}> = ({
account,
additionalStyles,
endCheckMark
}) => {
const theme = useTheme();
return (
<View
style={{
...(additionalStyles || {} as any),
flexDirection: "row",
padding: 9,
borderStyle: "solid",
alignItems: "center",
}}
>
<View
style={{
width: 30,
height: 30,
borderRadius: 80,
backgroundColor: "#000000",
marginRight: 10,
}}
>
<Image
source={
account.personalization.profilePictureB64 ?
{ uri: account.personalization.profilePictureB64 } :
defaultProfilePicture(account.service, account.identityProvider?.name || "")}
style={{
width: "100%",
height: "100%",
borderRadius: 80,
}}
resizeMode="cover"
/>
</View>
<View
style={{
flexDirection: "column",
gap: 2,
}}
>
<View style={{
flexDirection: "row",
flexWrap: "nowrap",
minWidth: "90%",
maxWidth: "75%"
}}>
<Text
style={{
fontSize: 16,
fontFamily: "semibold",
color: theme.colors.text,
flexShrink: 1
}}
numberOfLines={1}
ellipsizeMode="tail"
>
{account.studentName?.first || "Utilisateur"}{" "}
{account.studentName?.last || ""}
</Text>
</View>

<Text
style={{
fontSize: 15,
fontWeight: 500,
color: theme.colors.text + "50",
fontFamily: "medium",
maxWidth: "70%",
}}
numberOfLines={1}
ellipsizeMode="tail"
>
{AccountService[account.service] !== "Local" ?
AccountService[account.service] :
account.identityProvider?.name ?? "Compte local"
}
</Text>
</View>
{endCheckMark &&
<Reanimated.View
style={{
position: "absolute",
right: 15,
}}
entering={animPapillon(ZoomIn)}
exiting={FadeOut.duration(200)}
>
<Check
size={22}
strokeWidth={3.0}
color={theme.colors.primary}
/>
</Reanimated.View>
}
</View>
);
};

export default AccountItem;
4 changes: 2 additions & 2 deletions src/components/Global/AnimatedNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const AnimatedNumber: React.FC<AnimatedNumberProps> = ({
}, contentContainerStyle]}
layout={shouldAnimate ? animPapillon(LinearTransition) : undefined}
>
{value.toString().split("").map((n: number, i: number) => (
{value.toString().split("").map((n: string, i: number) => (
<Reanimated.View
key={`${value}_${i}`}
entering={shouldAnimate ? animPapillon(FadeInDown).delay(i * 20 + 20).mass(1).damping(30).stiffness(700) : undefined}
Expand All @@ -59,4 +59,4 @@ const AnimatedNumber: React.FC<AnimatedNumberProps> = ({
);
};

export default AnimatedNumber;
export default AnimatedNumber;
2 changes: 1 addition & 1 deletion src/components/Home/AccountSwitcherContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ const ContextMenu: React.FC<{
numberOfLines={1}
ellipsizeMode="tail"
>
{AccountService[account.service] !== "Local" ?
{AccountService[account.service] !== "Local" && account.service !== AccountService.PapillonMultiService ?
AccountService[account.service] :
account.identityProvider ?
account.identityProvider.name :
Expand Down
6 changes: 3 additions & 3 deletions src/components/News/Beta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { Text } from "react-native";
import { LinearGradient } from "expo-linear-gradient";


const BetaIndicator = () => {
const BetaIndicator: React.FC<{ colors?: string[] }> = (props) => {
return (
<LinearGradient
colors={["#00AADC", "#A6FFC4"]}
colors={props.colors || ["#00AADC", "#A6FFC4"]}
start={[0, 0]}
end={[0, 2]}
style={{ borderRadius: 8, paddingHorizontal: 6, paddingVertical: 4 }}
Expand All @@ -16,4 +16,4 @@ const BetaIndicator = () => {
);
};

export default BetaIndicator;
export default BetaIndicator;
61 changes: 61 additions & 0 deletions src/components/Settings/MultiServiceContainerCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import React, { useEffect } from "react";

import { View } from "react-native";
import LottieView from "lottie-react-native";
import { NativeItem, NativeList, NativeText } from "../Global/NativeComponents";
import { LinearGradient } from "expo-linear-gradient";
import BetaIndicator from "../News/Beta";

const MultiServiceContainerCard = ({ theme }: { theme: any }) => {
const { colors } = theme;
const animationref = React.useRef<LottieView>(null);

useEffect(() => {
animationref.current?.play();
}, []);

return (
<NativeList>
<LinearGradient
colors={["#cb7712", "#dec46d"]}
>
<View style={{
height: 200,
justifyContent: "center",
alignItems: "center",
overflow: "hidden",
}}>
<NativeText>Maybe une image ici, là j'attend l'avis des #designers</NativeText>
{/*<Image*/}
{/* source={require("@/../assets/images/settings/magic_header.png")}*/}
{/* style={{*/}
{/* width: "90%",*/}
{/* height: 230,*/}
{/* resizeMode: "contain",*/}
{/* marginTop: 75,*/}
{/* }}*/}
{/*/>*/}
camarm-dev marked this conversation as resolved.
Show resolved Hide resolved
</View>
</LinearGradient>
<NativeItem>
<View
style={{
flexDirection: "row",
gap: 10,
alignItems: "center",
}}
>
<NativeText variant="title">
Activer le multi service
</NativeText>
<BetaIndicator colors={["#cb7712", "#dec46d"]} />
</View>
<NativeText variant="subtitle">
Rassemble tes services scolaires en un espace virtuel unique, géré par Papillon.
</NativeText>
</NativeItem>
</NativeList>
);
};

export default MultiServiceContainerCard;
3 changes: 3 additions & 0 deletions src/router/helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {Client} from "pawrd";
import { Host } from "turboself-api";
import {Evaluation} from "@/services/shared/Evaluation";
import { ThemesMeta } from "@/utils/chat/themes/Themes.types";
import {MultiServiceSpace} from "@/stores/multiService/types";

export type RouteParameters = {
// welcome.index
Expand Down Expand Up @@ -127,6 +128,8 @@ export type RouteParameters = {
SettingsSubjects: undefined;
SettingsExternalServices: undefined;
SettingsMagic: undefined;
SettingsMultiService: undefined;
SettingsMultiServiceSpace: { space: MultiServiceSpace };
SettingsFlags: undefined;
SettingsFlagsInfos: { title: string; value: any };
SettingsAddons: undefined;
Expand Down
8 changes: 8 additions & 0 deletions src/router/screens/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import SettingsReactions from "@/views/settings/SettingsReactions";
import TurboselfAccountSelector from "@/views/settings/ExternalAccount/TurboselfAccountSelector";
import SettingsApparence from "@/views/settings/SettingsApparence";
import ExternalAliseLogin from "@/views/settings/ExternalAccount/Alise";
import SettingsMultiService from "@/views/settings/SettingsMultiService";
import SettingsMultiServiceSpace from "@/views/settings/SettingsMultiServiceSpace";

const settingsScreens = [
createScreen("Settings", Settings, {
Expand Down Expand Up @@ -67,6 +69,12 @@ const settingsScreens = [
createScreen("SettingsMagic", SettingsMagic, {
headerTitle: "Papillon Magic",
}),
createScreen("SettingsMultiService", SettingsMultiService, {
headerTitle: "Multiservice",
}),
createScreen("SettingsMultiServiceSpace", SettingsMultiServiceSpace, {
headerTitle: "Gérer l'environnement multi-service",
}),
createScreen("SettingsAddons", SettingsAddons, {
headerTitle: "Extensions",
}),
Expand Down
4 changes: 4 additions & 0 deletions src/router/screens/views/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export default [
animation: "slide_from_bottom",
sheetGrabberVisible: false,
sheetInitialDetentIndex: 0,
// @ts-expect-error IDK why it is a list of number, it should be SheetDetentTypes
sheetAllowedDetents: [0.5, 1.0],
headerShown: false,
}),
Expand All @@ -75,6 +76,7 @@ export default [
animation: "slide_from_bottom",
sheetGrabberVisible: false,
sheetInitialDetentIndex: 0,
// @ts-expect-error IDK why it is a list of number, it should be SheetDetentTypes
sheetAllowedDetents: [0.5, 1.0],
headerShown: false,
}),
Expand All @@ -85,6 +87,7 @@ export default [
animation: "slide_from_bottom",
sheetGrabberVisible: true,
sheetInitialDetentIndex: 0,
// @ts-expect-error IDK why it is a list of number, it should be SheetDetentTypes
sheetAllowedDetents: [0.5, 1.0],
}),
createScreen("GradeDocument", GradeDocument, {
Expand All @@ -94,6 +97,7 @@ export default [
animation: "slide_from_bottom",
sheetGrabberVisible: false,
sheetInitialDetentIndex: 0,
// @ts-expect-error IDK why it is a list of number, it should be SheetDetentTypes
sheetAllowedDetents: [0.5, 1.0],
headerShown: Platform.OS !== "ios",
}),
Expand Down
Loading
Loading