ページURLが空の時currentNameを使うように (#5368)
* ページURLが空の時currentNameを使う * 空の時はページURLにcurrentNameを代入するように * Update src/client/app/common/views/pages/page-editor/page-editor.vue Co-Authored-By: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * update validator * Update src/client/app/common/views/pages/page-editor/page-editor.vue Co-Authored-By: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * やっぱりuuidは統一 * エラー処理を追加 * some fix * ちょっとだけ翻訳の追加と改善 * リファクタリング * Revert "やっぱりuuidは統一" This reverts commit 965a860504e8b09e5561a4ab862f8bab6a95e8d5. * やっぱりuuidをわける * エラー判定をidからcodeに+リファクタリング
This commit is contained in:
		
							parent
							
								
									a08c20d9af
								
							
						
					
					
						commit
						cefd2a4c54
					
				
					 4 changed files with 23 additions and 14 deletions
				
			
		|  | @ -2020,6 +2020,8 @@ pages: | ||||||
|   page-created: "ページを作成しました" |   page-created: "ページを作成しました" | ||||||
|   page-updated: "ページを更新しました" |   page-updated: "ページを更新しました" | ||||||
|   name-already-exists: "指定されたページURLは既に存在しています" |   name-already-exists: "指定されたページURLは既に存在しています" | ||||||
|  |   title-invalid-name: "不正なページURLです" | ||||||
|  |   text-invalid-name: "空白でないか確認してください" | ||||||
|   are-you-sure-delete: "このページを削除しますか?" |   are-you-sure-delete: "このページを削除しますか?" | ||||||
|   page-deleted: "ページを削除しました" |   page-deleted: "ページを削除しました" | ||||||
|   edit-this-page: "このページを編集" |   edit-this-page: "このページを編集" | ||||||
|  |  | ||||||
|  | @ -232,6 +232,23 @@ export default Vue.extend({ | ||||||
| 				eyeCatchingImageId: this.eyeCatchingImageId, | 				eyeCatchingImageId: this.eyeCatchingImageId, | ||||||
| 			}; | 			}; | ||||||
| 
 | 
 | ||||||
|  | 			function onError(err) { | ||||||
|  | 				if (err.id == '3d81ceae-475f-4600-b2a8-2bc116157532') { | ||||||
|  | 						if (err.info.param == 'name') { | ||||||
|  | 							this.$root.dialog({ | ||||||
|  | 								type: 'error', | ||||||
|  | 								title: this.$t('title-invalid-name'), | ||||||
|  | 								text: this.$t('text-invalid-name') | ||||||
|  | 							}); | ||||||
|  | 						} | ||||||
|  | 					} else if (err.code == 'NAME_ALREADY_EXISTS') { | ||||||
|  | 						this.$root.dialog({ | ||||||
|  | 							type: 'error', | ||||||
|  | 							text: this.$t('name-already-exists') | ||||||
|  | 						}); | ||||||
|  | 					} | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
| 			if (this.pageId) { | 			if (this.pageId) { | ||||||
| 				options.pageId = this.pageId; | 				options.pageId = this.pageId; | ||||||
| 				this.$root.api('pages/update', options) | 				this.$root.api('pages/update', options) | ||||||
|  | @ -242,12 +259,7 @@ export default Vue.extend({ | ||||||
| 						text: this.$t('page-updated') | 						text: this.$t('page-updated') | ||||||
| 					}); | 					}); | ||||||
| 				}).catch(err => { | 				}).catch(err => { | ||||||
| 					if(err.id == '2298a392-d4a1-44c5-9ebb-ac1aeaa5a9ab'){ | 					onError(err); | ||||||
| 						this.$root.dialog({ |  | ||||||
| 							type: 'error', |  | ||||||
| 							text: this.$t('name-already-exists') |  | ||||||
| 						}); |  | ||||||
| 					} |  | ||||||
| 				}); | 				}); | ||||||
| 			} else { | 			} else { | ||||||
| 				this.$root.api('pages/create', options) | 				this.$root.api('pages/create', options) | ||||||
|  | @ -260,12 +272,7 @@ export default Vue.extend({ | ||||||
| 					}); | 					}); | ||||||
| 					this.$router.push(`/i/pages/edit/${this.pageId}`); | 					this.$router.push(`/i/pages/edit/${this.pageId}`); | ||||||
| 				}).catch(err => { | 				}).catch(err => { | ||||||
| 					if(err.id == '4650348e-301c-499a-83c9-6aa988c66bc1'){ | 					onError(err); | ||||||
| 						this.$root.dialog({ |  | ||||||
| 							type: 'error', |  | ||||||
| 							text: this.$t('name-already-exists') |  | ||||||
| 						}); |  | ||||||
| 					} |  | ||||||
| 				}); | 				}); | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ export const meta = { | ||||||
| 		}, | 		}, | ||||||
| 
 | 
 | ||||||
| 		name: { | 		name: { | ||||||
| 			validator: $.str, | 			validator: $.str.min(1), | ||||||
| 		}, | 		}, | ||||||
| 
 | 
 | ||||||
| 		summary: { | 		summary: { | ||||||
|  |  | ||||||
|  | @ -36,7 +36,7 @@ export const meta = { | ||||||
| 		}, | 		}, | ||||||
| 
 | 
 | ||||||
| 		name: { | 		name: { | ||||||
| 			validator: $.optional.str, | 			validator: $.str.min(1), | ||||||
| 		}, | 		}, | ||||||
| 
 | 
 | ||||||
| 		summary: { | 		summary: { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue