Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Mizu
Commits
7ba14ad2
Commit
7ba14ad2
authored
3 years ago
by
Amit Fainholts
Browse files
Options
Download
Email Patches
Plain Diff
bugs fixies
parent
212b50d7
feature/ui/TRA-4192_workspace_management
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
ui/src/components/Modals/AddUserModal/AddUserModal.tsx
+5
-3
ui/src/components/Modals/AddUserModal/AddUserModal.tsx
ui/src/components/Modals/AddWorkspaceModal/AddWorkspaceModal.tsx
+1
-1
...components/Modals/AddWorkspaceModal/AddWorkspaceModal.tsx
ui/src/components/SettingsModal/SettingModal.tsx
+1
-1
ui/src/components/SettingsModal/SettingModal.tsx
ui/src/components/WorkspaceSettings/WorkspaceSettings.tsx
+7
-0
ui/src/components/WorkspaceSettings/WorkspaceSettings.tsx
with
14 additions
and
5 deletions
+14
-5
ui/src/components/Modals/AddUserModal/AddUserModal.tsx
+
5
-
3
View file @
7ba14ad2
...
...
@@ -60,13 +60,13 @@ export const AddUserModal: FC<AddUserModalProps> = ({isOpen, onCloseModal, userD
},[])
useEffect
(()
=>
{
if
(
isEditMode
&&
userData
?.
inviteToken
){
setInvite
({...
invite
,
link
:
mapTokenToLink
(
userData
?.
inviteToken
),
isSuceeded
:
true
,
sent
:
true
})
if
(
isEditMode
){
userData
?.
inviteToken
&&
setInvite
({...
invite
,
link
:
mapTokenToLink
(
userData
?.
inviteToken
),
isSuceeded
:
true
,
sent
:
true
})
userData
.
workspaceId
=
userData
?.
workspace
?.
id
}
setEditMode
(
isEditMode
)
setUserData
({...
userData
}
as
UserData
)
// eslint-disable-next-line react-hooks/exhaustive-deps
},[
isEditMode
,
userData
])
...
...
@@ -81,6 +81,7 @@ export const AddUserModal: FC<AddUserModalProps> = ({isOpen, onCloseModal, userD
const
updateUser
=
async
()
=>
{
try
{
await
api
.
updateUser
(
userDataModel
)
onUserChange
(
userDataModel
)
toast
.
success
(
"
User has been modified
"
)
}
catch
(
error
)
{
toast
.
error
(
"
Error accured modifing user
"
)
...
...
@@ -180,6 +181,7 @@ export const AddUserModal: FC<AddUserModalProps> = ({isOpen, onCloseModal, userD
</
div
>
</>;
return
(<>
<
ConfirmationModal
isOpen
=
{
isOpen
}
onClose
=
{
onClose
}
onConfirm
=
{
onClose
}
title
=
{
`
${
editMode
?
"
Edit
"
:
"
Add
"
}
User`
}
customActions
=
{
addUsermodalCustomActions
}
>
...
...
This diff is collapsed.
Click to expand it.
ui/src/components/Modals/AddWorkspaceModal/AddWorkspaceModal.tsx
+
1
-
1
View file @
7ba14ad2
...
...
@@ -106,7 +106,7 @@ const AddWorkspaceModal: FC<AddWorkspaceModalProp> = ({isOpen,onCloseModal, work
}
return
(<>
<
ConfirmationModal
isOpen
=
{
isOpen
}
onClose
=
{
onClose
}
onConfirm
=
{
onConfirm
}
title
=
{
title
}
confirmButtonText
=
{
"
add
"
}
confirmDisabled
=
{
!
isFormValid
()
}
>
<
ConfirmationModal
isOpen
=
{
isOpen
}
onClose
=
{
onClose
}
onConfirm
=
{
onConfirm
}
title
=
{
title
}
confirmButtonText
=
{
"
save
"
}
confirmDisabled
=
{
!
isFormValid
()
}
>
{
isSaveLoading
&&
<
LoadingOverlay
/>
}
<
h3
className
=
'comfirmation-modal__sub-section-header'
>
DETAILS
</
h3
>
<
div
className
=
'comfirmation-modal__sub-section'
>
...
...
This diff is collapsed.
Click to expand it.
ui/src/components/SettingsModal/SettingModal.tsx
+
1
-
1
View file @
7ba14ad2
...
...
@@ -75,7 +75,7 @@ export const SettingsModal: React.FC<SettingsModalProps> = ({isOpen, onClose}) =
>
<
Fade
in
=
{
isOpen
}
>
<
Box
sx
=
{
modalStyle
}
style
=
{
{
width
:
"
40vw
"
,
maxWidth
:
600
,
height
:
"
70vh
"
,
padding
:
0
,
display
:
"
flex
"
,
justifyContent
:
"
space-between
"
,
flexDirection
:
"
column
"
}
}
>
<
div
style
=
{
{
padding
:
32
,
paddingBottom
:
0
}
}
>
<
div
style
=
{
{
padding
:
32
,
paddingBottom
:
0
,
overflowY
:
"
scroll
"
}
}
>
<
div
className
=
"settingsTitle"
>
Tapping Settings
</
div
>
<
div
className
=
"settingsSubtitle"
style
=
{
{
marginTop
:
20
}
}
>
Please choose from below the namespaces for tapping, traffic for namespaces selected will be displayed as default workspace.
...
...
This diff is collapsed.
Click to expand it.
ui/src/components/WorkspaceSettings/WorkspaceSettings.tsx
+
7
-
0
View file @
7ba14ad2
...
...
@@ -6,6 +6,7 @@ import AddWorkspaceModal, { WorkspaceData } from "../Modals/AddWorkspaceModal/Ad
import
{
toast
}
from
"
react-toastify
"
;
import
ConfirmationModal
from
"
../UI/Modals/ConfirmationModal
"
;
import
spinner
from
"
../assets/spinner.svg
"
;
import
LoadingOverlay
from
"
../LoadingOverlay
"
;
const
api
=
Api
.
getInstance
();
...
...
@@ -20,6 +21,7 @@ export const WorkspaceSettings : React.FC = () => {
const
[
isEditMode
,
setIsEditMode
]
=
useState
(
false
);
const
[
isOpenDeleteModal
,
setIsOpenDeleteModal
]
=
useState
(
false
);
const
[
isLoading
,
setIsLoading
]
=
useState
(
false
);
const
[
isDeleteLoading
,
setIsDeleteLoading
]
=
useState
(
false
);
const
buttonConfig
=
{
onClick
:
()
=>
{
setIsOpen
(
true
);
setIsEditMode
(
false
);
setWorkspaceData
({}
as
WorkspaceData
)},
text
:
"
Add Workspace
"
}
...
...
@@ -56,6 +58,7 @@ export const WorkspaceSettings : React.FC = () => {
const
onDeleteConfirmation
=
async
()
=>
{
try
{
setIsDeleteLoading
(
true
);
const
workspaceLeft
=
workspacesRows
.
filter
(
ws
=>
ws
.
id
!==
workspaceData
.
id
);
setWorkspacesRows
(
workspaceLeft
);
await
api
.
deleteWorkspace
(
workspaceData
.
id
);
...
...
@@ -66,6 +69,9 @@ export const WorkspaceSettings : React.FC = () => {
console
.
error
(
e
);
toast
.
error
(
"
Workspace hasn't deleted
"
);
}
finally
{
setIsDeleteLoading
(
false
);
}
}
const
onRowEdit
=
(
row
)
=>
{
...
...
@@ -85,6 +91,7 @@ export const WorkspaceSettings : React.FC = () => {
<
ConfirmationModal
isOpen
=
{
isOpenDeleteModal
}
onClose
=
{
()
=>
setIsOpenDeleteModal
(
false
)
}
onConfirm
=
{
onDeleteConfirmation
}
confirmButtonText
=
"Delete Workspace"
title
=
"Delete Workspace"
confirmButtonColor
=
"#DB2156"
className
=
{
"
delete-comfirmation-modal
"
}
>
{
isDeleteLoading
&&
<
LoadingOverlay
/>
}
<
p
>
Are you sure you want to delete this workspace?
</
p
>
</
ConfirmationModal
>
</>);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help