Skip to content

Commit

Permalink
Merge branch 'main' into COM-878-scope-redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
jomunker committed Aug 8, 2024
2 parents ea1724c + d05d038 commit 35a92d9
Show file tree
Hide file tree
Showing 60 changed files with 1,167 additions and 526 deletions.
3 changes: 1 addition & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ USE_AUTHPROXY=false
POSTGRESQL_HOST=localhost
POSTGRESQL_PORT=5432
POSTGRESQL_USER=postgres
POSTGRESQL_PWD=dml2aWQK
POSTGRESQL_PWD_DECODED=vivid
POSTGRESQL_PASSWORD=vivid
POSTGRESQL_DB=main

# fileStorage
Expand Down
186 changes: 112 additions & 74 deletions admin/package-lock.json

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

20 changes: 10 additions & 10 deletions admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
},
"dependencies": {
"@apollo/client": "^3.2.5",
"@comet/admin": "7.0.0-beta.6",
"@comet/admin-date-time": "7.0.0-beta.6",
"@comet/admin-icons": "7.0.0-beta.6",
"@comet/admin-rte": "7.0.0-beta.6",
"@comet/admin-theme": "7.0.0-beta.6",
"@comet/blocks-admin": "7.0.0-beta.6",
"@comet/cms-admin": "7.0.0-beta.6",
"@comet/admin": "^7.0.0",
"@comet/admin-date-time": "^7.0.0",
"@comet/admin-icons": "^7.0.0",
"@comet/admin-rte": "^7.0.0",
"@comet/admin-theme": "^7.0.0",
"@comet/blocks-admin": "^7.0.0",
"@comet/cms-admin": "^7.0.0",
"@emotion/react": "^11.9.3",
"@emotion/styled": "^11.9.3",
"@fontsource/roboto": "^4.5.8",
Expand Down Expand Up @@ -61,9 +61,9 @@
"react-router-dom": "^5.1.2"
},
"devDependencies": {
"@comet/cli": "7.0.0-beta.6",
"@comet/eslint-config": "7.0.0-beta.6",
"@comet/eslint-plugin": "7.0.0-beta.6",
"@comet/cli": "^7.0.0",
"@comet/eslint-config": "^7.0.0",
"@comet/eslint-plugin": "^7.0.0",
"@formatjs/cli": "^6.0.0",
"@graphql-codegen/add": "^3.0.0",
"@graphql-codegen/cli": "^2.0.0",
Expand Down
17 changes: 14 additions & 3 deletions admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from "@comet/cms-admin";
import { css, Global } from "@emotion/react";
import { getMessages } from "@src/lang";
import { ContentScope } from "@src/site-configs";
import { theme } from "@src/theme";
import { HTML5toTouch } from "rdndmb-html5-to-touch";
import { DndProvider } from "react-dnd-multi-backend";
Expand All @@ -31,7 +32,7 @@ import { createApolloClient } from "./common/apollo/createApolloClient";
import { ContentScopeProvider } from "./common/ContentScopeProvider";
import { MasterHeader } from "./common/MasterHeader";
import { masterMenuData, pageTreeCategories, pageTreeDocumentTypes } from "./common/masterMenuData";
import { ConfigProvider, ContentScope, createConfig } from "./config";
import { ConfigProvider, createConfig } from "./config";
import { Link } from "./documents/links/Link";
import { Page } from "./documents/pages/Page";

Expand All @@ -57,7 +58,10 @@ export function App() {
value={{
configs: config.sitesConfig,
resolveSiteConfigForScope: (configs, scope: ContentScope) => {
const siteConfig = configs.find((config) => config.contentScope.domain === scope.domain);
const siteConfig = configs.find((config) => {
return config.scope.domain === scope.domain;
});

if (!siteConfig) throw new Error(`siteConfig not found for domain ${scope.domain}`);
return {
url: siteConfig.url,
Expand Down Expand Up @@ -100,7 +104,14 @@ export function App() {
<Switch>
<Route
path={`${match.path}/preview`}
render={(props) => <SitePreview {...props} />}
render={(props) => (
<SitePreview
resolvePath={(path: string, scope: ContentScope) => {
return `/${scope.language}${path}`;
}}
{...props}
/>
)}
/>
<Route
render={() => (
Expand Down
2 changes: 1 addition & 1 deletion admin/src/common/ContentScopeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
useContentScopeConfig as useContentScopeConfigLibrary,
useCurrentUser,
} from "@comet/cms-admin";
import { ContentScope } from "@src/config";
import { ContentScope } from "@src/site-configs";

// convenince wrapper for app (Bind Generic)
export function useContentScope(): UseContentScopeApi<ContentScope> {
Expand Down
Loading

0 comments on commit 35a92d9

Please sign in to comment.