Skip to content

Commit

Permalink
Rename "App Route" to "Page" (#1159)
Browse files Browse the repository at this point in the history
* Rename "App Route" to "Page"

* Rename RouteType -> PageType
  • Loading branch information
illiakovalenko authored Sep 21, 2022
1 parent bf2f501 commit e1d1a02
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
# (as long as the GraphQLData helper is used)
contextItem: item(path: $contextItem, language: $language) {
id
# Get the page title from the app route template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
# Get the page title from the page template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
value
}
Expand All @@ -56,7 +56,7 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
# typing fragments can be used anywhere!
# so in this case, we're grabbing the 'pageTitle'
# field on all child route items.
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
jsonValue
value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function addRoutesToManifest(manifest: Manifest): Promise<void> {
// which routes can use by setting `template: YourCustomRouteTypeName` in their definition.
const appTemplateSection = 'Page Metadata';
manifest.setDefaultRouteType({
name: '<%- helper.getAppPrefix(appPrefix, appName) %>App Route',
name: '<%- helper.getAppPrefix(appPrefix, appName) %>Page',
fields: [
{
name: 'pageTitle',
Expand All @@ -25,7 +25,7 @@ export default function addRoutesToManifest(manifest: Manifest): Promise<void> {
type: CommonFieldTypes.SingleLineText,
},
],
insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>App Route'],
insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>Page'],
});

return mergeFs('./data/routes') // relative to process invocation (i.e. your package.json)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
# $contextItem should be set to the ID of the current context item (the route item)
contextItem: item(path: $contextItem, language: $language) {
id
# Get the page title from the app route template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
# Get the page title from the page template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
value
}
Expand All @@ -54,7 +54,7 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
# typing fragments can be used anywhere!
# so in this case, we're grabbing the 'pageTitle'
# field on all child route items.
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
jsonValue
value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export default {
name: '<%- helper.getAppPrefix(appPrefix, appName, false) %>ContentBlock',
},
{
name: 'C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute',
name: 'C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page',
},
{
name: 'JsonRendering',
Expand Down Expand Up @@ -192,13 +192,13 @@ export default {
},
{
kind: 'INTERFACE',
name: '<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute',
name: '<%- helper.getAppPrefix(appPrefix, appName, false) %>Page',
possibleTypes: [
{
name: '<%- helper.getAppPrefix(appPrefix, appName, false) %>ExampleCustomRouteType',
},
{
name: 'C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute',
name: 'C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
# (as long as the GraphQLData helper is used)
contextItem: item(path: $contextItem, language: $language) {
id
# Get the page title from the app route template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
# Get the page title from the page template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
value
}
Expand All @@ -56,7 +56,7 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
# typing fragments can be used anywhere!
# so in this case, we're grabbing the 'pageTitle'
# field on all child route items.
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
jsonValue
value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export default function addRoutesToManifest(manifest: Manifest): Promise<void> {
const appTemplateSection = 'Page Metadata';

manifest.setDefaultRouteType({
name: '<%- helper.getAppPrefix(appPrefix, appName) %>App Route',
displayName: 'App Route',
name: '<%- helper.getAppPrefix(appPrefix, appName) %>Page',
displayName: 'Page',
fields: [
{
name: 'pageTitle',
Expand All @@ -34,7 +34,7 @@ export default function addRoutesToManifest(manifest: Manifest): Promise<void> {
type: CommonFieldTypes.SingleLineText,
},
],
insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>App Route'],
insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>Page'],
});

return mergeFs('./data/routes') // relative to process invocation (i.e. your package.json)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
# $contextItem should be set to the ID of the current context item (the route item)
contextItem: item(path: $contextItem, language: $language) {
id
# Get the page title from the app route template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
# Get the page title from the page template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
value
}
Expand All @@ -54,7 +54,7 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
# typing fragments can be used anywhere!
# so in this case, we're grabbing the 'pageTitle'
# field on all child route items.
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
jsonValue
value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ import {
import NextLink from 'next/link';
import {
ConnectedDemoQueryDocument,
<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute as AppRoute,
<%- helper.getAppPrefix(appPrefix, appName, false) %>Page as Page,
Item,
<%- helper.getAppPrefix(appPrefix, appName, false) %>GraphQlConnectedDemo as GrapQLConnectedDemoDatasource,
} from './GraphQL-ConnectedDemo.dynamic.graphql';
import { ComponentProps } from 'lib/component-props';
import config from 'temp/config';

type RouteItem = AppRoute & Item;
type PageItem = Page & Item;

type GraphQLConnectedDemoData = {
datasource: GrapQLConnectedDemoDatasource;
contextItem: RouteItem;
contextItem: PageItem;
};

type GraphQLConnectedDemoProps = ComponentProps & GraphQLConnectedDemoData;
Expand Down Expand Up @@ -80,12 +80,12 @@ const GraphQLConnectedDemo = (props: GraphQLConnectedDemoProps): JSX.Element =>
children:
<ul>
{props.contextItem.children.results.map((child) => {
const routeItem = child as RouteItem;
const pageItem = child as PageItem;

return (
<li key={routeItem.id}>
<NextLink href={routeItem.url.path}>{routeItem.pageTitle?.value}</NextLink>
(editable title too! <Text field={routeItem.pageTitle?.jsonValue} />)
<li key={pageItem.id}>
<NextLink href={pageItem.url.path}>{pageItem.pageTitle?.value}</NextLink>
(editable title too! <Text field={pageItem.pageTitle?.jsonValue} />)
</li>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2179,7 +2179,7 @@
},
{
"kind": "OBJECT",
"name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
"name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
"ofType": null
},
{
Expand Down Expand Up @@ -17760,7 +17760,7 @@
"interfaces": [
{
"kind": "INTERFACE",
"name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
"name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
"ofType": null
},
{
Expand Down Expand Up @@ -18219,8 +18219,8 @@
},
{
"kind": "OBJECT",
"name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
"description": "/sitecore/templates/Project/<%- helper.getAppPrefix(appPrefix, appName, false) %>/<%- helper.getAppPrefix(appPrefix, appName, false) %>-App Route template (ID: {787584C0-A057-5876-9836-F8B3708F0CAF}). NOTE: This is a concrete type. Favor using interfaces instead of this type (e.g. <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute) for reliable querying.",
"name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
"description": "/sitecore/templates/Project/<%- helper.getAppPrefix(appPrefix, appName, false) %>/<%- helper.getAppPrefix(appPrefix, appName, false) %>-Page template (ID: {787584C0-A057-5876-9836-F8B3708F0CAF}). NOTE: This is a concrete type. Favor using interfaces instead of this type (e.g. <%- helper.getAppPrefix(appPrefix, appName, false) %>Page) for reliable querying.",
"fields": [
{
"name": "ancestors",
Expand Down Expand Up @@ -18643,7 +18643,7 @@
"interfaces": [
{
"kind": "INTERFACE",
"name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
"name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
"ofType": null
},
{
Expand Down Expand Up @@ -21496,8 +21496,8 @@
},
{
"kind": "INTERFACE",
"name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
"description": "/sitecore/templates/Project/<%- helper.getAppPrefix(appPrefix, appName, false) %>/<%- helper.getAppPrefix(appPrefix, appName, false) %>-App Route template (ID: {787584C0-A057-5876-9836-F8B3708F0CAF}). Also implements Route.",
"name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
"description": "/sitecore/templates/Project/<%- helper.getAppPrefix(appPrefix, appName, false) %>/<%- helper.getAppPrefix(appPrefix, appName, false) %>-Page template (ID: {787584C0-A057-5876-9836-F8B3708F0CAF}). Also implements Route.",
"fields": [
{
"name": "pageTitle",
Expand All @@ -21523,7 +21523,7 @@
},
{
"kind": "OBJECT",
"name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
"name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
"ofType": null
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
# (as long as the GraphQLData helper is used)
contextItem: item(path: $contextItem, language: $language) {
id
# Get the page title from the app route template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
# Get the page title from the page template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
value
}
Expand All @@ -56,7 +56,7 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
# typing fragments can be used anywhere!
# so in this case, we're grabbing the 'pageTitle'
# field on all child route items.
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
jsonValue
value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function addRoutesToManifest(manifest) {
const appTemplateSection = 'Page Metadata';

manifest.setDefaultRouteType({
name: '<%- helper.getAppPrefix(appPrefix, appName) %>App Route',
name: '<%- helper.getAppPrefix(appPrefix, appName) %>Page',
fields: [
{
name: 'pageTitle',
Expand All @@ -37,7 +37,7 @@ export default function addRoutesToManifest(manifest) {
type: CommonFieldTypes.SingleLineText,
},
],
insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>App Route'],
insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>Page'],
});

return mergeFs('./data/routes') // relative to process invocation (i.e. your package.json)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
# $contextItem should be set to the ID of the current context item (the route item)
contextItem: item(path: $contextItem, language: $language) {
id
# Get the page title from the app route template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
# Get the page title from the page template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
value
}
Expand All @@ -54,7 +54,7 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
# typing fragments can be used anywhere!
# so in this case, we're grabbing the 'pageTitle'
# field on all child route items.
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
jsonValue
value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>ContentBlock"
},
{
"name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute"
"name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page"
},
{
"name": "JsonRendering"
Expand Down Expand Up @@ -180,13 +180,13 @@
},
{
"kind": "INTERFACE",
"name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute",
"name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>Page",
"possibleTypes": [
{
"name": "<%- helper.getAppPrefix(appPrefix, appName, false) %>ExampleCustomRouteType"
},
{
"name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute"
"name": "C__<%- helper.getAppPrefix(appPrefix, appName, false) %>Page"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
# (as long as the GraphQLData helper is used)
contextItem: item(path: $contextItem, language: $language) {
id
# Get the page title from the app route template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
# Get the page title from the page template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
value
}
Expand All @@ -56,7 +56,7 @@ query IntegratedDemoQuery($datasource: String!, $contextItem: String!, $language
# typing fragments can be used anywhere!
# so in this case, we're grabbing the 'pageTitle'
# field on all child route items.
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
jsonValue
value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function addRoutesToManifest(manifest) {
const appTemplateSection = 'Page Metadata';

manifest.setDefaultRouteType({
name: '<%- helper.getAppPrefix(appPrefix, appName) %>App Route',
name: '<%- helper.getAppPrefix(appPrefix, appName) %>Page',
fields: [
{
name: 'pageTitle',
Expand All @@ -31,7 +31,7 @@ export default function addRoutesToManifest(manifest) {
type: CommonFieldTypes.SingleLineText,
},
],
insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>App Route'],
insertOptions: ['<%- helper.getAppPrefix(appPrefix, appName) %>Page'],
});

return mergeFs('./data/routes') // relative to process invocation (i.e. your package.json)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
# $contextItem should be set to the ID of the current context item (the route item)
contextItem: item(path: $contextItem, language: $language) {
id
# Get the page title from the app route template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
# Get the page title from the page template
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
value
}
Expand All @@ -54,7 +54,7 @@ query ConnectedDemoQuery($datasource: String!, $contextItem: String!, $language:
# typing fragments can be used anywhere!
# so in this case, we're grabbing the 'pageTitle'
# field on all child route items.
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>AppRoute {
...on <%- helper.getAppPrefix(appPrefix, appName, false) %>Page {
pageTitle {
jsonValue
value
Expand Down
Loading

0 comments on commit e1d1a02

Please sign in to comment.