Skip to content

Commit 3ecfecd

Browse files
authored
Merge pull request #9 from robertsoniv/master
Refresh page list on back click
2 parents 07bf425 + f97c8a3 commit 3ecfecd

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

projects/lib/src/admin/components/page-editor/page-editor.component.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import * as OrderCloudSDK from 'ordercloud-javascript-sdk';
1212
import { PageContentDoc } from '../../models/page-content-doc.interface';
1313
import { JDocument, HeadStartSDK } from '@ordercloud/headstart-sdk';
1414
import { NgbModalRef, NgbModal } from '@ng-bootstrap/ng-bootstrap';
15-
import { v4 as guid } from 'uuid';
1615
import { PAGE_SCHEMA } from '../../constants/page-schema.constants';
1716
import { RequiredDeep } from '@ordercloud/headstart-sdk/dist/models/RequiredDeep';
1817

@@ -46,9 +45,7 @@ export class PageEditorComponent implements OnInit, OnChanges {
4645
confirmModal: NgbModalRef;
4746
isLoadingSave: boolean;
4847

49-
constructor(
50-
private modalService: NgbModal
51-
) {}
48+
constructor(private modalService: NgbModal) {}
5249

5350
ngOnInit(): void {
5451
this.page = Object.assign(
@@ -99,7 +96,9 @@ export class PageEditorComponent implements OnInit, OnChanges {
9996

10097
async onSubmit(): Promise<void> {
10198
this.isLoadingSave = true;
102-
const updated = await this.saveChanges().finally(() => this.isLoadingSave = false);
99+
const updated = await this.saveChanges().finally(
100+
() => (this.isLoadingSave = false)
101+
);
103102
this.pageSaved.emit(updated);
104103
}
105104

@@ -119,7 +118,6 @@ export class PageEditorComponent implements OnInit, OnChanges {
119118
});
120119
}
121120
return HeadStartSDK.Documents.Create(PAGE_SCHEMA.ID, {
122-
ID: guid(),
123121
Doc: {
124122
...this.page,
125123
Author: fullName,

projects/lib/src/admin/components/page-list/page-list.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export class PageListComponent implements OnInit {
106106

107107
goToList(e: MouseEvent): void {
108108
this.selected = undefined;
109+
this.ngOnInit();
109110
}
110111

111112
async selectPage(page): Promise<void> {

0 commit comments

Comments
 (0)