Feature/1941 mass reference section fix validation error messages#1961
Open
Feature/1941 mass reference section fix validation error messages#1961
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
大量データ参照用セクションで、削除時に発生するバリデーションエラーが表示されない/正しい形式で表示されない問題(#1941)を解消するための修正です。フロント側でエラー配列の扱いと表示文字列の組み立てを見直し、ユーザーに意味のあるエラーを出すことに主眼があります。
Changes:
errosというタイポをerrorsに修正し、エラー判定が正しく動くように修正errors(ValidateError配列 or 文字列配列)を想定して、アラート表示用の文字列へ整形する処理を追加
| alert(errors); | ||
| // テキストの改行を除去するヘルパー関数 | ||
| const normalizeText = (text) => { | ||
| return String(text).replace(/\n/g, ' '); |
There was a problem hiding this comment.
[imo] normalizeText が改行除去として \n のみ置換しているため、サーバ側メッセージが \r\n の場合に \r が残って表示が崩れる可能性があります。\r も含めて正規化する(例: \r?\n を置換する)か、連続する改行コード全体を空白に置換する実装に寄せるのが安全です。
Suggested change
| return String(text).replace(/\n/g, ' '); | |
| // CRLF(\r\n)、LF(\n)、CR(\r) など連続する改行コードをまとめて空白に正規化する | |
| return String(text).replace(/[\r\n]+/g, ' '); |
iplass-gem/src/main/resources/META-INF/resources/scripts/gem/functions.js
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
対応内容
closes #1941
動作確認・スクリーンショット(任意)
レビュー観点・補足情報(任意)