forked from EVOgeek/Vmeda.Online
		
	MOBILE-4219 edit-entry: Change save button and default publishstate
This commit is contained in:
		
							parent
							
								
									b38b77edd9
								
							
						
					
					
						commit
						823aba0467
					
				| @ -75,18 +75,10 @@ | |||||||
|             </div> |             </div> | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             <ion-item class="addon-blog-entry-buttons"> |             <ion-button class="ion-margin" expand="block" [attr.aria-label]="'core.save' | translate" | ||||||
|                 <ion-label> |                 [disabled]="form.invalid || (entry && !hasDataChangedForEdit)" (click)="save()"> | ||||||
|                     <ion-row> |                 {{ 'core.save' | translate }} | ||||||
|                         <ion-col> |             </ion-button> | ||||||
|                             <ion-button expand="block" [attr.aria-label]="(entry ? 'core.save' : 'addon.blog.addnewentry') | translate" |  | ||||||
|                                 [disabled]="form.invalid || (entry && !hasDataChangedForEdit)" (click)="save()"> |  | ||||||
|                                 {{ (entry ? 'core.save' : 'addon.blog.addnewentry') | translate }} |  | ||||||
|                             </ion-button> |  | ||||||
|                         </ion-col> |  | ||||||
|                     </ion-row> |  | ||||||
|                 </ion-label> |  | ||||||
|             </ion-item> |  | ||||||
| 
 | 
 | ||||||
|         </form> |         </form> | ||||||
|     </core-loading> |     </core-loading> | ||||||
|  | |||||||
| @ -60,7 +60,7 @@ export class AddonBlogEditEntryPage implements CanLeave, OnInit { | |||||||
|         subject: new FormControl<string>('', { nonNullable: true, validators: [Validators.required] }), |         subject: new FormControl<string>('', { nonNullable: true, validators: [Validators.required] }), | ||||||
|         summary: new FormControl<string>('', { nonNullable: true, validators: [Validators.required] }), |         summary: new FormControl<string>('', { nonNullable: true, validators: [Validators.required] }), | ||||||
|         publishState: new FormControl<AddonBlogPublishState>( |         publishState: new FormControl<AddonBlogPublishState>( | ||||||
|             ADDON_BLOG_PUBLISH_STATE.draft, |             ADDON_BLOG_PUBLISH_STATE.site, | ||||||
|             { nonNullable: true, validators: [Validators.required] }, |             { nonNullable: true, validators: [Validators.required] }, | ||||||
|         ), |         ), | ||||||
|         associateWithCourse: new FormControl<boolean>(false, { nonNullable: true, validators: [Validators.required] }), |         associateWithCourse: new FormControl<boolean>(false, { nonNullable: true, validators: [Validators.required] }), | ||||||
| @ -110,7 +110,7 @@ export class AddonBlogEditEntryPage implements CanLeave, OnInit { | |||||||
| 
 | 
 | ||||||
|         return form.subject.value !== '' || |         return form.subject.value !== '' || | ||||||
|             form.summary.value !== '' || |             form.summary.value !== '' || | ||||||
|             form.publishState.value !== ADDON_BLOG_PUBLISH_STATE.draft || |             form.publishState.value !== ADDON_BLOG_PUBLISH_STATE.site || | ||||||
|             CoreFileUploader.areFileListDifferent(this.files, this.initialFiles); |             CoreFileUploader.areFileListDifferent(this.files, this.initialFiles); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -165,7 +165,7 @@ export class AddonBlogEditEntryPage implements CanLeave, OnInit { | |||||||
|         this.form.setValue({ |         this.form.setValue({ | ||||||
|             subject: this.entry?.subject ?? '', |             subject: this.entry?.subject ?? '', | ||||||
|             summary: this.entry?.summary ?? '', |             summary: this.entry?.summary ?? '', | ||||||
|             publishState: this.entry?.publishstate ?? ADDON_BLOG_PUBLISH_STATE.draft, |             publishState: this.entry?.publishstate ?? ADDON_BLOG_PUBLISH_STATE.site, | ||||||
|             associateWithCourse: this.form.controls.associateWithCourse.value, |             associateWithCourse: this.form.controls.associateWithCourse.value, | ||||||
|             associateWithModule: this.form.controls.associateWithModule.value, |             associateWithModule: this.form.controls.associateWithModule.value, | ||||||
|         }); |         }); | ||||||
|  | |||||||
| @ -41,7 +41,7 @@ Feature: Edit blog entries | |||||||
|     And I set the field "Blog entry body" to "This is a new blog entry." in the app |     And I set the field "Blog entry body" to "This is a new blog entry." in the app | ||||||
|     And I press "Publish to" in the app |     And I press "Publish to" in the app | ||||||
|     And I press "Anyone on this site" in the app |     And I press "Anyone on this site" in the app | ||||||
|     And I press "Add a new entry" "button" in the app |     And I press "Save" "button" in the app | ||||||
| 
 | 
 | ||||||
|     Then I should find "Blog entries" in the app |     Then I should find "Blog entries" in the app | ||||||
|     And I should find "New blog entry" in the app |     And I should find "New blog entry" in the app | ||||||
| @ -60,7 +60,7 @@ Feature: Edit blog entries | |||||||
|     And I press "Add file" in the app |     And I press "Add file" in the app | ||||||
|     And I upload "stub7.txt" to "File" ".action-sheet-button" in the app |     And I upload "stub7.txt" to "File" ".action-sheet-button" in the app | ||||||
| 
 | 
 | ||||||
|     And I press "Add a new entry" "button" in the app |     And I press "Save" "button" in the app | ||||||
| 
 | 
 | ||||||
|     Then I should find "Blog entries" in the app |     Then I should find "Blog entries" in the app | ||||||
|     And I should find "Entry with attachments" in the app |     And I should find "Entry with attachments" in the app | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user