-
Notifications
You must be signed in to change notification settings - Fork 219
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: Show modal when you delete plugin #7875
imprv: Show modal when you delete plugin #7875
Conversation
...rc/features/growi-plugin/client/components/Admin/PluginsExtensionPageContents/PluginCard.tsx
Show resolved
Hide resolved
...ures/growi-plugin/client/components/Admin/PluginsExtensionPageContents/PluginDeleteModal.tsx
Show resolved
Hide resolved
...ures/growi-plugin/client/components/Admin/PluginsExtensionPageContents/PluginDeleteModal.tsx
Outdated
Show resolved
Hide resolved
...rc/features/growi-plugin/client/components/Admin/PluginsExtensionPageContents/PluginCard.tsx
Outdated
Show resolved
Hide resolved
...plugin/client/components/Admin/PluginsExtensionPageContents/PluginsExtensionPageContents.tsx
Outdated
Show resolved
Hide resolved
...ures/growi-plugin/client/components/Admin/PluginsExtensionPageContents/PluginDeleteModal.tsx
Outdated
Show resolved
Hide resolved
...ures/growi-plugin/client/components/Admin/PluginsExtensionPageContents/PluginDeleteModal.tsx
Outdated
Show resolved
Hide resolved
apps/app/src/stores/modal.tsx
Outdated
type PluginDeleteModalUtils = { | ||
open(plugin: IGrowiPluginHasId): void, | ||
close(): void, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
戻り値の型が void でいいのか確認お願いします 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
voidの場合戻り値がなく、呼び出し元の処理の完了を待たずに、open、closeメソッドを実行する。
type PluginDeleteModalUtils = { open(plugin: IGrowiPluginHasId): Promise<PluginDeleteModalStatus | undefined>, close(): Promise<PluginDeleteModalStatus | undefined>, }
このように修正することで、PluginDeleteModal内の処理(await apiv3Delete(reqUrl);)が完了するまで待つことができるようになりました。
型推論で足りるところをわざわざ型アサーションおり、不要のため削除しました。 async関数内でswrResponse.Dataをreturnしていましたが、グローバルステートの更新には不要なので削除し、型エイリアスでは |
@@ -47,6 +49,7 @@ const AdminLayout = ({ | |||
</div> | |||
|
|||
<PageCreateModal /> | |||
<PluginDeleteModal /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここには入れず、PluginsExtensionPageContents.tsx に入れてください
apps/app/src/stores/modal.tsx
Outdated
open, | ||
close, | ||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これも features/growi-plugin/client の中にあった方がいいね
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/growi-plugin/client/stores/admin-plugins.tsxに記述しました
catch (err) { | ||
toastError(err); | ||
} | ||
}, [id, closePluginDeleteModal, t, mutate]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
更にコード品質を上げるために、いくつか後続ストーリーを作ってください。
- apiv3Delete をカスタムフック化する
client/services/page-operation.ts
が参考になる
- toast 表示および Modal の close を PluginsExtensionPageContents にやらせる
- 責務の観点から
reg-suit detected visual differences. Check this report, and review them. ⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪ What do the circles mean?The number of circles represent the number of changed images.🔴 : Changed items, ⚪ : New items, ⚫ : Deleted items, and 🔵 Passed items How can I change the check status?If reviewers approve this PR, the reg context status will be green automatically. |
https://redmine.weseek.co.jp/issues/125483
プラグインカードの削除ボタンを押すと、削除確認用のモーダルが表示されるようにしました
デザインについてもui/uxチャンネルで取り決めました
https://wsgrowi.slack.com/archives/C0111HG81GB/p1689216931459769
2023-07-13.15.53.27.mov