Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[カテゴリ設定]クラス名の登録時にチェック処理を追加(必須&ユニーク) #1887

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

masaton0216
Copy link
Contributor

@masaton0216 masaton0216 commented Nov 20, 2023

概要

  • (背景)登録時、及び、更新時に「クラス名」は何もバリデーションされていなかった。
  • とあるクライアントがカテゴリ設定を利用していたが、クラス名をすべて空で登録していた為、新着等のbladeでCSSのclass展開された際にすべて同値のクラス(cc_category_)となってしまい、意図した反映が出来ずにいた。
  • 上記のような運用事故をなくす為、カテゴリ設定のクラス名の登録時&更新時に下記チェックを追加しました。
    • 必須チェック
    • ユニークチェック
  • 更新時の配列へのunique制約の記法が四苦八苦しまして、時間がなかったこともあり、少し妥協した実装になってます。記法がわかったらリファクタリングしたいですが、とりあえず今は機能優先でPR出しちゃいます。

新規登録時(必須)

image

新規登録時(重複)

image

更新時(必須)

image

更新時(重複)

image

レビュー完了希望日

バグという程のものではないですが、なるはや

関連Pull requests/Issues

#1886
※本件、対応時に牟田さんと話題に挙がり、追加の運びとなりました。

参考

なし

DB変更の有無

なし

チェックリスト

@masaton0216 masaton0216 added the enhancement 機能強化 label Nov 20, 2023
@masaton0216 masaton0216 self-assigned this Nov 20, 2023
@masaton0216 masaton0216 marked this pull request as draft November 22, 2023 03:07
@masaton0216
Copy link
Contributor Author

カテゴリ設定できる箇所が他プラグインにもあった為、他も対応予定。
とりあえず「saveCategories」でgrepした結果、下記がHITしたので対応有無を判断の後、対応する。

  • ブログ
  • 施設予約
  • データベース
  • FAQ
  • 課題管理
  • リンクリスト

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 機能強化
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant