|
@@ -66,12 +66,17 @@ function emitPageSeenEvent(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function getActivityAction(
|
|
function getActivityAction(
|
|
|
|
|
+ isIdenticalPathPage: boolean,
|
|
|
pageWithMeta?:
|
|
pageWithMeta?:
|
|
|
| IPageToShowRevisionWithMeta
|
|
| IPageToShowRevisionWithMeta
|
|
|
| IDataWithRequiredMeta<PageDocument, IPageInfoBasic>
|
|
| IDataWithRequiredMeta<PageDocument, IPageInfoBasic>
|
|
|
| IDataWithMeta<null, IPageNotFoundInfo>
|
|
| IDataWithMeta<null, IPageNotFoundInfo>
|
|
|
| null,
|
|
| null,
|
|
|
): SupportedActionType {
|
|
): SupportedActionType {
|
|
|
|
|
+ if (isIdenticalPathPage) {
|
|
|
|
|
+ return SupportedAction.ACTION_PAGE_NOT_CREATABLE;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const meta = pageWithMeta?.meta;
|
|
const meta = pageWithMeta?.meta;
|
|
|
if (isIPageNotFoundInfo(meta)) {
|
|
if (isIPageNotFoundInfo(meta)) {
|
|
|
if (meta.isForbidden) {
|
|
if (meta.isForbidden) {
|
|
@@ -150,7 +155,13 @@ export async function getServerSidePropsForInitial(
|
|
|
emitPageSeenEvent(context, mergedProps.pageWithMeta?.data?._id);
|
|
emitPageSeenEvent(context, mergedProps.pageWithMeta?.data?._id);
|
|
|
|
|
|
|
|
// Persist activity
|
|
// Persist activity
|
|
|
- addActivity(context, getActivityAction(mergedProps.pageWithMeta));
|
|
|
|
|
|
|
+ addActivity(
|
|
|
|
|
+ context,
|
|
|
|
|
+ getActivityAction(
|
|
|
|
|
+ mergedProps.isIdenticalPathPage,
|
|
|
|
|
+ mergedProps.pageWithMeta,
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
return mergedResult;
|
|
return mergedResult;
|
|
|
}
|
|
}
|
|
@@ -174,7 +185,13 @@ export async function getServerSidePropsForSameRoute(
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
// Persist activity
|
|
// Persist activity
|
|
|
- addActivity(context, getActivityAction(internalProps?.pageWithMeta));
|
|
|
|
|
|
|
+ addActivity(
|
|
|
|
|
+ context,
|
|
|
|
|
+ getActivityAction(
|
|
|
|
|
+ pageDataProps.isIdenticalPathPage,
|
|
|
|
|
+ internalProps?.pageWithMeta,
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
const mergedResult = mergeGetServerSidePropsResults(
|
|
const mergedResult = mergeGetServerSidePropsResults(
|
|
|
{ props: pageDataProps },
|
|
{ props: pageDataProps },
|