Skip to content

Commit

Permalink
Save layout correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
fmontes committed Jan 5, 2021
1 parent 20f4c7a commit 165572a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ describe('DotEditLayoutComponent', () => {
expect(dotGlobalMessageService.success).toHaveBeenCalledWith('Saved');
expect(dotGlobalMessageService.error).not.toHaveBeenCalled();

expect(dotPageLayoutService.save).toHaveBeenCalledWith('123', fakeLayout);
expect(dotPageLayoutService.save).toHaveBeenCalledWith('123', {
...fakeLayout,
title: null
});
expect(dotTemplateContainersCacheService.set).toHaveBeenCalledWith({
'0': {
type: 'containers',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ export class DotEditLayoutComponent implements OnInit {
);

this.dotPageLayoutService
.save(this.pageState.page.identifier, value)
.save(this.pageState.page.identifier, {
...value,
// To save a layout and no a template the title should be null
title: null
})
.pipe(take(1))
.subscribe(
(updatedPage: DotPageRender) => {
Expand Down

0 comments on commit 165572a

Please sign in to comment.