Skip to content

Conversation

@taikou-m
Copy link
Contributor

@taikou-m taikou-m commented May 2, 2025

修正内容

削除メニューアイテムが表示されないようにした。

task

https://redmine.weseek.co.jp/issues/165282

@changeset-bot
Copy link

changeset-bot bot commented May 2, 2025

⚠️ No Changeset found

Latest commit: e46034f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@miya miya requested a review from yuki-takei May 3, 2025 08:31
@miya miya assigned miya and unassigned miya May 3, 2025
@taikou-m taikou-m changed the title fix user homepage delete button feat: fix user homepage delete button May 9, 2025
@miya miya requested review from miya and yuki-takei May 19, 2025 01:45
@taikou-m taikou-m changed the title feat: fix user homepage delete button imprv: Hide user delete button May 20, 2025
@taikou-m taikou-m changed the title imprv: Hide user delete button imprv: The delete button on the user home page is now hidden for unauthorized users. May 20, 2025
mergify bot added a commit that referenced this pull request May 21, 2025
@mergify
Copy link
Contributor

mergify bot commented May 21, 2025

This pull request has been removed from the queue for the following reason: checks failed.

The merge conditions cannot be satisfied due to failing checks:

You can check the last failing draft PR here: #9958.

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

mergify bot added a commit that referenced this pull request May 30, 2025
Copy link
Member

@miya miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@mergify
Copy link
Contributor

mergify bot commented May 30, 2025

This pull request has been removed from the queue for the following reason: pull request dequeued.

Pull request #9915 has been dequeued. The pull request rule doesn't match anymore. The following conditions don't match anymore:

  • #changes-requested-reviews-by = 0.

You can check the last failing draft PR here: #9995.

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

}

return true;
}, [isGuestUser, isUsersHomepage, isUsersHomepageDeletionEnabled]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentPagePath が取得できていない (null) 場合を考慮してください

以下 AI の説明


currentPagePath が取得できていない場合(=値が undefinednull の場合)、このコードでは以下のように記述されています:

const isUsersHomepage = pagePathUtils.isUsersHomepage(currentPagePath ?? '');

ここで currentPagePath ?? '' となっているため、currentPagePath が「null または undefined の場合」は空文字列 ''pagePathUtils.isUsersHomepage に渡されます。

どうなるか?

  • pagePathUtils.isUsersHomepage('') の返り値がどうなるか次第です。
  • 一般的に「ユーザーのホームページかどうか」を判定する関数なら、空文字列は「ユーザーのホームページではない」と判定され、false を返す設計が多いです。

結果として

  • currentPagePath が取得できていない場合、isUsersHomepage はたいてい false になる。
  • isEnableActions の値は
    • ゲストユーザーなら false
    • それ以外は trueisUsersHomepagefalse なので2番目の if に入らないため)

要約
currentPagePath が取得できていない場合は「ユーザーのホームページではない」とみなされ、isEnableActions の判定にも特に悪影響はありません(通常どおりの権限判定になります)。

Copy link
Contributor

@yuki-takei yuki-takei Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentPagePath はなにか、を本質的に考えないといけない

currentPagePath が取得できないということは、システムグローバルに「今何のページを表示しているのか」を特定できていないということだ。
現状のコードでは、今何のページを表示しているのかを特定できないにも関わらず、isEnableActions は true となり、PageItemControl の各種ドロップダウンアイテムを表示して良い、という挙動になる。
つまり、「何のページかわからんけど削除メニュー表示しとくね」という挙動が有り得ることになる。

修正案

currentPagePath が取得できていない場合は isEnableActions を false にする

@yuki-takei yuki-takei self-requested a review May 30, 2025 13:15
}

return true;
}, [isGuestUser, isUsersHomepage, isUsersHomepageDeletionEnabled]);
Copy link
Contributor

@yuki-takei yuki-takei Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentPagePath はなにか、を本質的に考えないといけない

currentPagePath が取得できないということは、システムグローバルに「今何のページを表示しているのか」を特定できていないということだ。
現状のコードでは、今何のページを表示しているのかを特定できないにも関わらず、isEnableActions は true となり、PageItemControl の各種ドロップダウンアイテムを表示して良い、という挙動になる。
つまり、「何のページかわからんけど削除メニュー表示しとくね」という挙動が有り得ることになる。

修正案

currentPagePath が取得できていない場合は isEnableActions を false にする

@yuki-takei
Copy link
Contributor

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented Jun 4, 2025

queue

🛑 The pull request has been removed from the queue default

Details

The merge conditions cannot be satisfied due to failing checks.

You can take a look at Queue: Embarked in merge queue check runs for more details about the failure.

mergify bot added a commit that referenced this pull request Jun 4, 2025
mergify bot added a commit that referenced this pull request Jun 4, 2025
@mergify
Copy link
Contributor

mergify bot commented Jun 4, 2025

This pull request has been removed from the queue for the following reason: checks failed.

The merge conditions cannot be satisfied due to failing checks:

You can check the last failing draft PR here: #10016.

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@yuki-takei
Copy link
Contributor

@mergify requeue

@mergify
Copy link
Contributor

mergify bot commented Jun 4, 2025

requeue

✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically

@yuki-takei
Copy link
Contributor

@mergify queue

@mergify
Copy link
Contributor

mergify bot commented Jun 4, 2025

queue

✅ The pull request has been merged automatically

Details

The pull request has been merged automatically at 2d4369b

mergify bot added a commit that referenced this pull request Jun 4, 2025
mergify bot added a commit that referenced this pull request Jun 4, 2025
@mergify mergify bot merged commit 2d4369b into master Jun 4, 2025
21 of 22 checks passed
@mergify mergify bot deleted the fix/165282 branch June 4, 2025 14:16
@github-actions github-actions bot mentioned this pull request Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants