Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
a6b09aa5
Commit
a6b09aa5
authored
Apr 07, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: add confirm dialog for disable password login setting
parent
ff81ea60
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
8 deletions
+24
-8
SystemSection.tsx
web/src/components/Settings/SystemSection.tsx
+24
-8
No files found.
web/src/components/Settings/SystemSection.tsx
View file @
a6b09aa5
...
@@ -9,6 +9,7 @@ import { WorkspaceSettingPrefix } from "@/store/v1";
...
@@ -9,6 +9,7 @@ import { WorkspaceSettingPrefix } from "@/store/v1";
import
{
WorkspaceGeneralSetting
}
from
"@/types/proto/api/v2/workspace_setting_service"
;
import
{
WorkspaceGeneralSetting
}
from
"@/types/proto/api/v2/workspace_setting_service"
;
import
{
WorkspaceSettingKey
}
from
"@/types/proto/store/workspace_setting"
;
import
{
WorkspaceSettingKey
}
from
"@/types/proto/store/workspace_setting"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
showCommonDialog
}
from
"../Dialog/CommonDialog"
;
import
Icon
from
"../Icon"
;
import
Icon
from
"../Icon"
;
import
showUpdateCustomizedProfileDialog
from
"../UpdateCustomizedProfileDialog"
;
import
showUpdateCustomizedProfileDialog
from
"../UpdateCustomizedProfileDialog"
;
...
@@ -72,6 +73,7 @@ const SystemSection = () => {
...
@@ -72,6 +73,7 @@ const SystemSection = () => {
};
};
const
handleDisablePasswordLoginChanged
=
async
(
value
:
boolean
)
=>
{
const
handleDisablePasswordLoginChanged
=
async
(
value
:
boolean
)
=>
{
const
updateSetting
=
async
()
=>
{
const
setting
=
{
...
workspaceGeneralSetting
,
disallowPasswordLogin
:
value
};
const
setting
=
{
...
workspaceGeneralSetting
,
disallowPasswordLogin
:
value
};
await
workspaceSettingServiceClient
.
setWorkspaceSetting
({
await
workspaceSettingServiceClient
.
setWorkspaceSetting
({
setting
:
{
setting
:
{
...
@@ -81,6 +83,20 @@ const SystemSection = () => {
...
@@ -81,6 +83,20 @@ const SystemSection = () => {
});
});
setWorkspaceGeneralSetting
(
setting
);
setWorkspaceGeneralSetting
(
setting
);
};
};
if
(
value
)
{
showCommonDialog
({
title
:
"Confirm"
,
content
:
"Are you sure to disable password login?"
,
style
:
"danger"
,
dialogName
:
"disable-password-login-dialog"
,
onConfirm
:
async
()
=>
{
await
updateSetting
();
},
});
}
else
{
await
updateSetting
();
}
};
const
handleUpdateCustomizedProfileButtonClick
=
()
=>
{
const
handleUpdateCustomizedProfileButtonClick
=
()
=>
{
showUpdateCustomizedProfileDialog
();
showUpdateCustomizedProfileDialog
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment