Skip to content

Commit

Permalink
Merge pull request #1770 from vivid-planet/merge-main-into-next
Browse files Browse the repository at this point in the history
[Conflicts] Merge main into next
  • Loading branch information
nsams authored Mar 7, 2024
2 parents ae01420 + 48745ad commit b0bed29
Show file tree
Hide file tree
Showing 44 changed files with 288 additions and 146 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-onions-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@comet/cms-api": patch
---

Don't fail in ChangesCheckerInterceptor because of stricter content scope check
14 changes: 12 additions & 2 deletions demo/admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import * as React from "react";
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
import * as ReactDOM from "react-dom";
import { IntlProvider } from "react-intl";
import { FormattedMessage, IntlProvider } from "react-intl";
import { Route, Switch } from "react-router-dom";

import MasterHeader from "./common/MasterHeader";
Expand Down Expand Up @@ -67,7 +67,17 @@ class App extends React.Component {
sitePreviewApiUrl: `${config.sitePreviewUrl}/api/site-preview`,
}}
>
<DamConfigProvider value={{ scopeParts: ["domain"], additionalToolbarItems: <ImportFromUnsplash /> }}>
<DamConfigProvider
value={{
scopeParts: ["domain"],
additionalToolbarItems: <ImportFromUnsplash />,
importSources: {
unsplash: {
label: <FormattedMessage id="dam.importSource.unsplash.label" defaultMessage="Unsplash" />,
},
},
}}
>
<IntlProvider locale="en" messages={getMessages()}>
<LocaleProvider resolveLocaleForScope={(scope: ContentScope) => scope.domain}>
<MuiThemeProvider theme={theme}>
Expand Down
6 changes: 0 additions & 6 deletions demo/api/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,6 @@ input DependentFilter {
rootColumnName: String
}

type PaginatedPages {
nodes: [Page!]!
totalCount: Int!
}

type PredefinedPage implements DocumentInterface {
id: ID!
updatedAt: DateTime!
Expand Down Expand Up @@ -705,7 +700,6 @@ type Query {
builds(limit: Float): [Build!]!
autoBuildStatus: AutoBuildStatus!
link(linkId: ID!): Link
pages(offset: Int! = 0, limit: Int! = 25, sortColumnName: String, sortDirection: SortDirection! = ASC): PaginatedPages!
pageTreeNode(id: ID!): PageTreeNode
pageTreeNodeByPath(path: String!, scope: PageTreeNodeScopeInput!): PageTreeNode
pageTreeNodeList(scope: PageTreeNodeScopeInput!, category: String): [PageTreeNode!]!
Expand Down
7 changes: 0 additions & 7 deletions demo/api/src/pages/dto/paginated-pages.ts

This file was deleted.

22 changes: 1 addition & 21 deletions demo/api/src/pages/pages.resolver.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,25 @@
import {
AffectedEntity,
OffsetBasedPaginationArgs,
PageTreeNodeInterface,
PageTreeNodeVisibility,
PageTreeService,
RequiredPermission,
SortArgs,
validateNotModified,
} from "@comet/cms-api";
import { FindOptions } from "@mikro-orm/core";
import { InjectRepository } from "@mikro-orm/nestjs";
import { EntityRepository } from "@mikro-orm/postgresql";
import { UnauthorizedException } from "@nestjs/common";
import { Args, ArgsType, ID, IntersectionType, Mutation, Parent, Query, ResolveField, Resolver } from "@nestjs/graphql";
import { Args, ID, Mutation, Parent, ResolveField, Resolver } from "@nestjs/graphql";
import { PageTreeNode } from "@src/page-tree/entities/page-tree-node.entity";

import { PageInput } from "./dto/page.input";
import { PaginatedPages } from "./dto/paginated-pages";
import { Page } from "./entities/page.entity";

@ArgsType()
export class PagesArgs extends IntersectionType(OffsetBasedPaginationArgs, SortArgs) {}

@Resolver(() => Page)
@RequiredPermission(["pageTree"])
export class PagesResolver {
constructor(@InjectRepository(Page) private readonly repository: EntityRepository<Page>, private readonly pageTreeService: PageTreeService) {}

// TODO add scope argument (who uses this anyway? probably dashboard)
@Query(() => PaginatedPages)
@RequiredPermission(["pageTree"], { skipScopeCheck: true })
async pages(@Args() { offset, limit, sortColumnName, sortDirection }: PagesArgs): Promise<PaginatedPages> {
const options: FindOptions<Page> = { offset, limit };
if (sortColumnName) {
options.orderBy = { [sortColumnName]: sortDirection };
}
const [pages, totalCount] = await this.repository.findAndCount({}, options);

return new PaginatedPages(pages, totalCount);
}

@ResolveField(() => PageTreeNode, { nullable: true })
async pageTreeNode(@Parent() page: Page): Promise<PageTreeNodeInterface | null> {
return this.pageTreeService.createReadApi().getFirstNodeByAttachedPageId(page.id);
Expand Down
2 changes: 2 additions & 0 deletions packages/admin/admin-babel-preset/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @comet/admin-babel-preset

## 6.3.0

## 6.2.1

## 6.2.0
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/admin-babel-preset/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@comet/admin-babel-preset",
"version": "6.2.1",
"version": "6.3.0",
"repository": {
"type": "git",
"url": "https://github.com/vivid-planet/comet",
Expand Down
7 changes: 7 additions & 0 deletions packages/admin/admin-color-picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @comet/admin-color-picker

## 6.3.0

### Patch Changes

- @comet/admin@6.3.0
- @comet/admin-icons@6.3.0

## 6.2.1

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/admin/admin-color-picker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@comet/admin-color-picker",
"version": "6.2.1",
"version": "6.3.0",
"repository": {
"type": "git",
"url": "https://github.com/vivid-planet/comet",
Expand All @@ -25,8 +25,8 @@
"start:types": "tsc --project ./tsconfig.json --emitDeclarationOnly --watch --preserveWatchOutput"
},
"dependencies": {
"@comet/admin": "workspace:^6.2.1",
"@comet/admin-icons": "workspace:^6.2.1",
"@comet/admin": "workspace:^6.3.0",
"@comet/admin-icons": "workspace:^6.3.0",
"clsx": "^1.1.1",
"react-colorful": "^5.5.1",
"tinycolor2": "^1.4.1",
Expand All @@ -35,8 +35,8 @@
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.20.12",
"@comet/admin-babel-preset": "workspace:^6.2.1",
"@comet/eslint-config": "workspace:^6.2.1",
"@comet/admin-babel-preset": "workspace:^6.3.0",
"@comet/eslint-config": "workspace:^6.3.0",
"@mui/icons-material": "^5.0.0",
"@mui/material": "^5.0.0",
"@mui/styles": "^5.0.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/admin/admin-date-time/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @comet/admin-date-time

## 6.3.0

### Patch Changes

- @comet/admin@6.3.0
- @comet/admin-icons@6.3.0

## 6.2.1

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/admin/admin-date-time/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@comet/admin-date-time",
"version": "6.2.1",
"version": "6.3.0",
"repository": {
"type": "git",
"url": "https://github.com/vivid-planet/comet",
Expand All @@ -25,8 +25,8 @@
"start:types": "tsc --project ./tsconfig.json --emitDeclarationOnly --watch --preserveWatchOutput"
},
"dependencies": {
"@comet/admin": "workspace:^6.2.1",
"@comet/admin-icons": "workspace:^6.2.1",
"@comet/admin": "workspace:^6.3.0",
"@comet/admin-icons": "workspace:^6.3.0",
"@mui/utils": "^5.4.1",
"clsx": "^1.1.1",
"date-fns": "^2.28.0",
Expand All @@ -35,8 +35,8 @@
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.20.12",
"@comet/admin-babel-preset": "workspace:^6.2.1",
"@comet/eslint-config": "workspace:^6.2.1",
"@comet/admin-babel-preset": "workspace:^6.3.0",
"@comet/eslint-config": "workspace:^6.3.0",
"@mui/material": "^5.0.0",
"@mui/styles": "^5.0.0",
"@types/react": "^17.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/admin/admin-icons/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @comet/admin-icons

## 6.3.0

## 6.2.1

## 6.2.0
Expand Down
6 changes: 3 additions & 3 deletions packages/admin/admin-icons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@comet/admin-icons",
"version": "6.2.1",
"version": "6.3.0",
"repository": {
"type": "git",
"url": "https://github.com/vivid-planet/comet",
Expand All @@ -24,8 +24,8 @@
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.20.12",
"@comet/admin-babel-preset": "workspace:^6.2.1",
"@comet/eslint-config": "workspace:^6.2.1",
"@comet/admin-babel-preset": "workspace:^6.3.0",
"@comet/eslint-config": "workspace:^6.3.0",
"@mui/material": "^5.0.0",
"@types/cli-progress": "^3.8.0",
"@types/node": "^18.0.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/admin/admin-react-select/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @comet/admin-react-select

## 6.3.0

### Patch Changes

- @comet/admin@6.3.0

## 6.2.1

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions packages/admin/admin-react-select/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@comet/admin-react-select",
"version": "6.2.1",
"version": "6.3.0",
"repository": {
"type": "git",
"url": "https://github.com/vivid-planet/comet",
Expand All @@ -25,14 +25,14 @@
"start:types": "tsc --project ./tsconfig.json --emitDeclarationOnly --watch --preserveWatchOutput"
},
"dependencies": {
"@comet/admin": "workspace:^6.2.1",
"@comet/admin": "workspace:^6.3.0",
"classnames": "^2.2.6"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.20.12",
"@comet/admin-babel-preset": "workspace:^6.2.1",
"@comet/eslint-config": "workspace:^6.2.1",
"@comet/admin-babel-preset": "workspace:^6.3.0",
"@comet/eslint-config": "workspace:^6.3.0",
"@mui/icons-material": "^5.0.0",
"@mui/material": "^5.0.0",
"@mui/styles": "^5.0.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/admin/admin-rte/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @comet/admin-rte

## 6.3.0

### Patch Changes

- @comet/admin@6.3.0
- @comet/admin-icons@6.3.0

## 6.2.1

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/admin/admin-rte/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@comet/admin-rte",
"version": "6.2.1",
"version": "6.3.0",
"repository": {
"type": "git",
"url": "https://github.com/vivid-planet/comet",
Expand All @@ -27,8 +27,8 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@comet/admin": "workspace:^6.2.1",
"@comet/admin-icons": "workspace:^6.2.1",
"@comet/admin": "workspace:^6.3.0",
"@comet/admin-icons": "workspace:^6.3.0",
"detect-browser": "^5.2.1",
"draft-js-export-html": "^1.4.1",
"draft-js-import-html": "^1.4.1",
Expand All @@ -38,8 +38,8 @@
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.20.12",
"@comet/admin-babel-preset": "workspace:^6.2.1",
"@comet/eslint-config": "workspace:^6.2.1",
"@comet/admin-babel-preset": "workspace:^6.3.0",
"@comet/eslint-config": "workspace:^6.3.0",
"@mui/icons-material": "^5.0.0",
"@mui/material": "^5.0.0",
"@mui/styles": "^5.0.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/admin/admin-theme/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @comet/admin-theme

## 6.3.0

### Patch Changes

- @comet/admin-icons@6.3.0

## 6.2.1

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions packages/admin/admin-theme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@comet/admin-theme",
"version": "6.2.1",
"version": "6.3.0",
"repository": {
"type": "git",
"url": "https://github.com/vivid-planet/comet",
Expand All @@ -25,14 +25,14 @@
"start:types": "tsc --project ./tsconfig.json --emitDeclarationOnly --watch --preserveWatchOutput"
},
"dependencies": {
"@comet/admin-icons": "workspace:^6.2.1",
"@comet/admin-icons": "workspace:^6.3.0",
"@mui/utils": "^5.4.1"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.20.12",
"@comet/admin-babel-preset": "workspace:^6.2.1",
"@comet/eslint-config": "workspace:^6.2.1",
"@comet/admin-babel-preset": "workspace:^6.3.0",
"@comet/eslint-config": "workspace:^6.3.0",
"@mui/material": "^5.0.0",
"@mui/styles": "^5.0.0",
"@mui/system": "^5.0.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/admin/admin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @comet/admin

## 6.3.0

### Patch Changes

- @comet/admin-icons@6.3.0

## 6.2.1

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions packages/admin/admin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@comet/admin",
"version": "6.2.1",
"version": "6.3.0",
"repository": {
"type": "git",
"url": "https://github.com/vivid-planet/comet",
Expand All @@ -27,7 +27,7 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@comet/admin-icons": "workspace:^6.2.1",
"@comet/admin-icons": "workspace:^6.3.0",
"@mui/private-theming": "^5.0.0",
"clsx": "^1.1.1",
"exceljs": "^3.4.0",
Expand All @@ -45,8 +45,8 @@
"@apollo/client": "^3.7.0",
"@babel/cli": "^7.17.6",
"@babel/core": "^7.20.12",
"@comet/admin-babel-preset": "workspace:^6.2.1",
"@comet/eslint-config": "workspace:^6.2.1",
"@comet/admin-babel-preset": "workspace:^6.3.0",
"@comet/eslint-config": "workspace:^6.3.0",
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
"@mui/icons-material": "^5.0.0",
Expand Down
Loading

0 comments on commit b0bed29

Please sign in to comment.