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

imprv: Can use registration approval request without mail settings #7581

Conversation

jam411
Copy link
Contributor

@jam411 jam411 commented Apr 18, 2023

task:https://redmine.weseek.co.jp/issues/120045

Screenshot

01 i18n 修正

Before

image

After

image

02 admin ユーザーあてに通知

image
image

newUser が Approval pending されている

image

inappnotifications ドキュメント

image

@jam411 jam411 requested a review from miya April 19, 2023 04:19
@jam411 jam411 requested a review from yuki-takei April 19, 2023 12:58
Copy link
Member

Choose a reason for hiding this comment

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

このコンポーネント、PageModelNotification と重複が多すぎて冗長。
120632 のスコープに共通化も入れてください。

共通化する際のヒント

  • PageModelNotification と UserModelNotification で共通でレンダリングする部分は HoC にすればよさそう
  • InAppNotificationElm もあわせてリファクタすべき
    • page に閉じるべきものは PageModelNotification に移す

Copy link
Contributor Author

Choose a reason for hiding this comment

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

スコープに入れました

this.activityEvent.on('updated', async(activity: ActivityDocument, target: IPage, descendantsSubscribedUsers?: Ref<IUser>[]) => {
// TODO: do not use any type
// https://redmine.weseek.co.jp/issues/120632
this.activityEvent.on('updated', async(activity: ActivityDocument, target: any, users?: Ref<IUser>[]) => {
Copy link
Member

Choose a reason for hiding this comment

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

変数名を descendantsSubscribedUsers から users にするメリットある?

Copy link
Contributor Author

@jam411 jam411 Apr 20, 2023

Choose a reason for hiding this comment

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

@yuki-takei
sendNotificationToAllAdmins() で adminUsers を渡すようにしたので引数名を汎用的な users にしました。

渡された users (descendantsSubscribedUsers) は createInAppNotification() で操作されます。
もう一度見てみると、createInAppNotificaiton() では const notificationTargetUsers = await activity?.getNotificationTargetUsers(); のようにここで通知する対象のユーザー情報を取得しているコードもあるので、
adminUsers の取得を sendNotificationToAllAdmins() で行うのではなく、createInAppNotification() 内で行えば引数名を変更しなくて済みそうです。

FB修正方針よさそうであればリファクタタスク 120632 のスコープに組み込みます。

await this.upsertByActivity(users, activity, snapshot);
await this.emitSocketIo(users);
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

この場合分け嫌なので 120632 のスコープにリファクタを入れてください

Copy link
Contributor Author

Choose a reason for hiding this comment

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

スコープに入れました

break;
default:
throw new Error(`No serializer found for targetModel: ${doc.targetModel}`);
}
Copy link
Member

Choose a reason for hiding this comment

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

この場合分け嫌なので 120632 のスコープにリファクタを入れてください

Copy link
Contributor Author

Choose a reason for hiding this comment

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

スコープに入れました

…cation' into imprv/119788-120045-can-use-sing-up-registration-setting-without-mail-setting
@yuki-takei yuki-takei merged commit 3284c1f into imprv/119788-mail-setting-and-id-password-login-specification Apr 20, 2023
8 checks passed
@yuki-takei yuki-takei deleted the imprv/119788-120045-can-use-sing-up-registration-setting-without-mail-setting branch April 20, 2023 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants