Arthur Bogaart pushed to branch feature/create-content at cms-community / hippo-addon-channel-manager
Commits: 4315d031 by Arthur Bogaart at 2017-11-20T13:36:00+01:00 CHANNELMGR-1596 Check for undefined rootPath and add missing values in test - - - - - 2 changed files: - frontend-ng/src/app/channel/sidePanels/rightSidePanel/create-content/step-1/step-1.component.spec.ts - frontend-ng/src/app/channel/sidePanels/rightSidePanel/create-content/step-1/step-1.component.ts Changes: ===================================== frontend-ng/src/app/channel/sidePanels/rightSidePanel/create-content/step-1/step-1.component.spec.ts ===================================== --- a/frontend-ng/src/app/channel/sidePanels/rightSidePanel/create-content/step-1/step-1.component.spec.ts +++ b/frontend-ng/src/app/channel/sidePanels/rightSidePanel/create-content/step-1/step-1.component.spec.ts @@ -142,6 +142,8 @@ describe('Create content step 1 component', () => { component.nameUrlFields.nameField = 'New doc'; component.nameUrlFields.urlField = 'new-doc'; component.documentType = 'hap:contentdocument'; + component.documentLocationField.rootPath = '/content/documents/hap/news'; + component.documentLocationField.documentLocation = '/content/documents/hap/news/2017/12'; const data = { name: 'New doc', ===================================== frontend-ng/src/app/channel/sidePanels/rightSidePanel/create-content/step-1/step-1.component.ts ===================================== --- a/frontend-ng/src/app/channel/sidePanels/rightSidePanel/create-content/step-1/step-1.component.ts +++ b/frontend-ng/src/app/channel/sidePanels/rightSidePanel/create-content/step-1/step-1.component.ts @@ -80,9 +80,9 @@ export class CreateContentComponent implements OnInit { } submit() { - const location = this.documentLocationField.documentLocation; const rootPath = this.documentLocationField.rootPath; - const defaultPath = location.substring(rootPath.length + 1); + const location = this.documentLocationField.documentLocation; + const defaultPath = location ? location.substring(rootPath.length + 1) : ''; const document: DocumentDetails = { name: this.nameUrlFields.nameField, View it on GitLab: https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/4315d03142aa36247311d46dde038eb15275d093 --- View it on GitLab: https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/4315d03142aa36247311d46dde038eb15275d093 You're receiving this email because of your account on code.onehippo.org.
_______________________________________________ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn