diff --git a/api.planx.uk/package.json b/api.planx.uk/package.json index 024e9d2578..dabe24956e 100644 --- a/api.planx.uk/package.json +++ b/api.planx.uk/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@airbrake/node": "^2.1.8", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#8162d4f", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#2dccab9", "@types/isomorphic-fetch": "^0.0.36", "adm-zip": "^0.5.10", "aws-sdk": "^2.1467.0", diff --git a/api.planx.uk/pnpm-lock.yaml b/api.planx.uk/pnpm-lock.yaml index 4209b25d22..6307688010 100644 --- a/api.planx.uk/pnpm-lock.yaml +++ b/api.planx.uk/pnpm-lock.yaml @@ -14,8 +14,8 @@ dependencies: specifier: ^2.1.8 version: 2.1.8 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#8162d4f - version: github.com/theopensystemslab/planx-core/8162d4f + specifier: git+https://github.com/theopensystemslab/planx-core#2dccab9 + version: github.com/theopensystemslab/planx-core/2dccab9 '@types/isomorphic-fetch': specifier: ^0.0.36 version: 0.0.36 @@ -6233,8 +6233,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/8162d4f: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/8162d4f} + github.com/theopensystemslab/planx-core/2dccab9: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/2dccab9} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/e2e/tests/api-driven/package.json b/e2e/tests/api-driven/package.json index 25312512f9..46faa94364 100644 --- a/e2e/tests/api-driven/package.json +++ b/e2e/tests/api-driven/package.json @@ -7,7 +7,7 @@ "packageManager": "pnpm@8.6.6", "dependencies": { "@cucumber/cucumber": "^9.3.0", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#8162d4f", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#2dccab9", "axios": "^1.7.4", "dotenv": "^16.3.1", "dotenv-expand": "^10.0.0", diff --git a/e2e/tests/api-driven/pnpm-lock.yaml b/e2e/tests/api-driven/pnpm-lock.yaml index b5fc5c2187..c42a318f09 100644 --- a/e2e/tests/api-driven/pnpm-lock.yaml +++ b/e2e/tests/api-driven/pnpm-lock.yaml @@ -9,8 +9,8 @@ dependencies: specifier: ^9.3.0 version: 9.3.0 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#8162d4f - version: github.com/theopensystemslab/planx-core/8162d4f + specifier: git+https://github.com/theopensystemslab/planx-core#2dccab9 + version: github.com/theopensystemslab/planx-core/2dccab9 axios: specifier: ^1.7.4 version: 1.7.4 @@ -2932,8 +2932,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/8162d4f: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/8162d4f} + github.com/theopensystemslab/planx-core/2dccab9: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/2dccab9} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/e2e/tests/ui-driven/package.json b/e2e/tests/ui-driven/package.json index 58640c9a17..b2ea1a5873 100644 --- a/e2e/tests/ui-driven/package.json +++ b/e2e/tests/ui-driven/package.json @@ -8,7 +8,7 @@ "postinstall": "./install-dependencies.sh" }, "dependencies": { - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#8162d4f", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#2dccab9", "axios": "^1.7.4", "dotenv": "^16.3.1", "eslint": "^8.56.0", diff --git a/e2e/tests/ui-driven/pnpm-lock.yaml b/e2e/tests/ui-driven/pnpm-lock.yaml index a1e14ea419..95f14be8bd 100644 --- a/e2e/tests/ui-driven/pnpm-lock.yaml +++ b/e2e/tests/ui-driven/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#8162d4f - version: github.com/theopensystemslab/planx-core/8162d4f + specifier: git+https://github.com/theopensystemslab/planx-core#2dccab9 + version: github.com/theopensystemslab/planx-core/2dccab9 axios: specifier: ^1.7.4 version: 1.7.4 @@ -2674,8 +2674,8 @@ packages: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} dev: false - github.com/theopensystemslab/planx-core/8162d4f: - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/8162d4f} + github.com/theopensystemslab/planx-core/2dccab9: + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/2dccab9} name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/editor.planx.uk/package.json b/editor.planx.uk/package.json index e96dd6cf3a..4d678b10ca 100644 --- a/editor.planx.uk/package.json +++ b/editor.planx.uk/package.json @@ -15,7 +15,7 @@ "@mui/material": "^5.15.10", "@mui/utils": "^5.15.11", "@opensystemslab/map": "1.0.0-alpha.3", - "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#8162d4f", + "@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#2dccab9", "@tiptap/core": "^2.4.0", "@tiptap/extension-bold": "^2.0.3", "@tiptap/extension-bubble-menu": "^2.1.13", diff --git a/editor.planx.uk/pnpm-lock.yaml b/editor.planx.uk/pnpm-lock.yaml index f2f10e2e33..72398bb1f1 100644 --- a/editor.planx.uk/pnpm-lock.yaml +++ b/editor.planx.uk/pnpm-lock.yaml @@ -47,8 +47,8 @@ dependencies: specifier: 1.0.0-alpha.3 version: 1.0.0-alpha.3 '@opensystemslab/planx-core': - specifier: git+https://github.com/theopensystemslab/planx-core#8162d4f - version: github.com/theopensystemslab/planx-core/8162d4f(@types/react@18.2.45) + specifier: git+https://github.com/theopensystemslab/planx-core#2dccab9 + version: github.com/theopensystemslab/planx-core/2dccab9(@types/react@18.2.45) '@tiptap/core': specifier: ^2.4.0 version: 2.4.0(@tiptap/pm@2.0.3) @@ -21361,9 +21361,9 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - github.com/theopensystemslab/planx-core/8162d4f(@types/react@18.2.45): - resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/8162d4f} - id: github.com/theopensystemslab/planx-core/8162d4f + github.com/theopensystemslab/planx-core/2dccab9(@types/react@18.2.45): + resolution: {tarball: https://codeload.github.com/theopensystemslab/planx-core/tar.gz/2dccab9} + id: github.com/theopensystemslab/planx-core/2dccab9 name: '@opensystemslab/planx-core' version: 1.0.0 prepare: true diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/index.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/index.tsx index 66db287dea..0750ea8f4f 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/index.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/index.tsx @@ -26,11 +26,14 @@ const GeneralSettings: React.FC = () => { useEffect(() => { const fetchTeam = async () => { try { - const fetchedTeam = await useStore.getState().fetchCurrentTeam(); - if (!fetchedTeam) throw Error("Unable to find team"); + const fetchedTeamSettings = await useStore + .getState() + .fetchCurrentTeamSettings(); + + if (!fetchedTeamSettings) throw Error("Unable to find team"); setFormikConfig({ - initialValues: fetchedTeam.settings, + initialValues: fetchedTeamSettings, onSubmit: () => {}, validateOnBlur: false, validateOnChange: false, diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/store/team.ts b/editor.planx.uk/src/pages/FlowEditor/lib/store/team.ts index 24ab3aeb3d..afc0768b98 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/store/team.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/store/team.ts @@ -26,6 +26,7 @@ export interface TeamStore { initTeamStore: (slug: string) => Promise; clearTeamStore: () => void; fetchCurrentTeam: () => Promise; + fetchCurrentTeamSettings: () => Promise; updateTeamTheme: (theme: Partial) => Promise; updateTeamSettings: (teamSettings: Partial) => Promise; createTeam: (newTeam: { name: string; slug: string }) => Promise; @@ -138,6 +139,11 @@ export const teamStore: StateCreator< return await $client.team.getBySlug(teamSlug); }, + fetchCurrentTeamSettings: async () => { + const { teamSlug, $client } = get(); + return await $client.team.getTeamSettings(teamSlug); + }, + updateTeamTheme: async (theme: Partial) => { const { teamId, $client } = get(); return await $client.team.updateTheme(teamId, theme);