Skip to content

Commit

Permalink
Merge pull request #782 from mirumee/add/pages-metadata-1413
Browse files Browse the repository at this point in the history
Add metadata editor to page views
  • Loading branch information
dominik-zeglen authored Oct 28, 2020
2 parents e4fc448 + f65ef4d commit a0939a5
Show file tree
Hide file tree
Showing 16 changed files with 1,004 additions and 215 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Fix order draft back button redirect - #753 by @orzechdev
- Add manage product types and attributes permission - #768 by @orzechdev
- Fix isPublished and isAvailable behaviour for products, collections and pages - #780 by @mmarkusik
- Add metadata editor to page views - #782 by @dominik-zeglen

## 2.10.1

Expand Down
19 changes: 15 additions & 4 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,7 @@ enum CollectionSortField {
NAME
AVAILABILITY
PRODUCT_COUNT
PUBLICATION_DATE
}

input CollectionSortingInput {
Expand Down Expand Up @@ -2306,6 +2307,7 @@ type Margin {
type Menu implements Node {
id: ID!
name: String!
slug: String!
items: [MenuItem]
}

Expand Down Expand Up @@ -2334,6 +2336,7 @@ type MenuCreate {

input MenuCreateInput {
name: String!
slug: String
items: [MenuItemInput]
}

Expand Down Expand Up @@ -2363,10 +2366,12 @@ enum MenuErrorCode {

input MenuFilterInput {
search: String
slug: [String]
}

input MenuInput {
name: String
slug: String
}

type MenuItem implements Node {
Expand Down Expand Up @@ -3229,7 +3234,7 @@ type OrderVoid {
orderErrors: [OrderError!]!
}

type Page implements Node {
type Page implements Node & ObjectWithMetadata {
seoTitle: String
seoDescription: String
id: ID!
Expand All @@ -3240,6 +3245,10 @@ type Page implements Node {
isPublished: Boolean!
slug: String!
created: DateTime!
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
translation(languageCode: LanguageCodeEnum!): PageTranslation
}

Expand Down Expand Up @@ -3792,6 +3801,7 @@ input ProductFilterInput {
price: PriceRangeInput
minimalPrice: PriceRangeInput
productTypes: [ID]
ids: [ID]
}

type ProductImage implements Node {
Expand Down Expand Up @@ -3878,6 +3888,7 @@ enum ProductOrderField {
DATE
TYPE
PUBLISHED
PUBLICATION_DATE
}

type ProductPricingInfo {
Expand Down Expand Up @@ -4288,7 +4299,7 @@ type Query {
draftOrders(sortBy: OrderSortingInput, filter: OrderDraftFilterInput, created: ReportingPeriod, before: String, after: String, first: Int, last: Int): OrderCountableConnection
ordersTotal(period: ReportingPeriod): TaxedMoney
orderByToken(token: UUID!): Order
menu(id: ID, name: String): Menu
menu(id: ID, name: String, slug: String): Menu
menus(sortBy: MenuSortingInput, filter: MenuFilterInput, before: String, after: String, first: Int, last: Int): MenuCountableConnection
menuItem(id: ID!): MenuItem
menuItems(sortBy: MenuItemSortingInput, filter: MenuItemFilterInput, before: String, after: String, first: Int, last: Int): MenuItemCountableConnection
Expand Down Expand Up @@ -4755,10 +4766,10 @@ type Shop {
defaultMailSenderAddress: String
description: String
domain: Domain!
homepageCollection: Collection
homepageCollection: Collection @deprecated(reason: "Use the `collection` query with the `slug` parameter. This field will be removed in Saleor 3.0")
languages: [LanguageDisplay]!
name: String!
navigation: Navigation
navigation: Navigation @deprecated(reason: "Fetch menus using the `menu` query with `slug` parameter.")
permissions: [Permission]!
phonePrefixes: [String]!
headerText: String
Expand Down
4 changes: 4 additions & 0 deletions src/fragments/pages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import gql from "graphql-tag";

import { metadataFragment } from "./metadata";

export const pageFragment = gql`
fragment PageFragment on Page {
id
Expand All @@ -11,8 +13,10 @@ export const pageFragment = gql`

export const pageDetailsFragment = gql`
${pageFragment}
${metadataFragment}
fragment PageDetailsFragment on Page {
...PageFragment
...MetadataFragment
contentJson
seoTitle
seoDescription
Expand Down
2 changes: 1 addition & 1 deletion src/fragments/types/MetadataFragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface MetadataFragment_privateMetadata {
}

export interface MetadataFragment {
__typename: "ServiceAccount" | "App" | "Product" | "ProductType" | "Attribute" | "Category" | "ProductVariant" | "DigitalContent" | "Collection" | "User" | "Checkout" | "Order" | "Fulfillment" | "Invoice";
__typename: "ServiceAccount" | "App" | "Product" | "ProductType" | "Attribute" | "Category" | "ProductVariant" | "DigitalContent" | "Collection" | "Page" | "User" | "Checkout" | "Order" | "Fulfillment" | "Invoice";
metadata: (MetadataFragment_metadata | null)[];
privateMetadata: (MetadataFragment_privateMetadata | null)[];
}
14 changes: 14 additions & 0 deletions src/fragments/types/PageDetailsFragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,26 @@
// GraphQL fragment: PageDetailsFragment
// ====================================================

export interface PageDetailsFragment_metadata {
__typename: "MetadataItem";
key: string;
value: string;
}

export interface PageDetailsFragment_privateMetadata {
__typename: "MetadataItem";
key: string;
value: string;
}

export interface PageDetailsFragment {
__typename: "Page";
id: string;
title: string;
slug: string;
isPublished: boolean;
metadata: (PageDetailsFragment_metadata | null)[];
privateMetadata: (PageDetailsFragment_privateMetadata | null)[];
contentJson: any;
seoTitle: string | null;
seoDescription: string | null;
Expand Down
Loading

0 comments on commit a0939a5

Please sign in to comment.