Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
00a4585c
Commit
00a4585c
authored
May 17, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expand props
parent
f8be36a5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
53 deletions
+32
-53
file-explorer.tsx
libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
+0
-0
remix-ui-modal-dialog.tsx
libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx
+9
-9
index.ts
libs/remix-ui/modal-dialog/src/lib/types/index.ts
+4
-2
toaster.tsx
libs/remix-ui/toaster/src/lib/toaster.tsx
+2
-4
remix-ui-workspace.tsx
libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
+17
-38
No files found.
libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
View file @
00a4585c
This diff is collapsed.
Click to expand it.
libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx
View file @
00a4585c
...
@@ -18,7 +18,7 @@ export const ModalDialog = (props: ModalDialogProps) => {
...
@@ -18,7 +18,7 @@ export const ModalDialog = (props: ModalDialogProps) => {
const
modalKeyEvent
=
(
keyCode
)
=>
{
const
modalKeyEvent
=
(
keyCode
)
=>
{
if
(
keyCode
===
27
)
{
// Esc
if
(
keyCode
===
27
)
{
// Esc
if
(
props
.
cancel
&&
props
.
cancel
.
fn
)
props
.
cancel
.
f
n
()
if
(
props
.
cancel
Fn
)
props
.
cancelF
n
()
handleHide
()
handleHide
()
}
else
if
(
keyCode
===
13
)
{
// Enter
}
else
if
(
keyCode
===
13
)
{
// Enter
enterHandler
()
enterHandler
()
...
@@ -33,9 +33,9 @@ export const ModalDialog = (props: ModalDialogProps) => {
...
@@ -33,9 +33,9 @@ export const ModalDialog = (props: ModalDialogProps) => {
const
enterHandler
=
()
=>
{
const
enterHandler
=
()
=>
{
if
(
state
.
toggleBtn
)
{
if
(
state
.
toggleBtn
)
{
if
(
props
.
ok
&&
props
.
ok
.
fn
)
props
.
ok
.
f
n
()
if
(
props
.
ok
Fn
)
props
.
okF
n
()
}
else
{
}
else
{
if
(
props
.
cancel
&&
props
.
cancel
.
fn
)
props
.
cancel
.
f
n
()
if
(
props
.
cancel
Fn
)
props
.
cancelF
n
()
}
}
handleHide
()
handleHide
()
}
}
...
@@ -79,29 +79,29 @@ export const ModalDialog = (props: ModalDialogProps) => {
...
@@ -79,29 +79,29 @@ export const ModalDialog = (props: ModalDialogProps) => {
</
div
>
</
div
>
<
div
className=
"modal-footer"
data
-
id=
{
`${props.id}ModalDialogModalFooter-react`
}
>
<
div
className=
"modal-footer"
data
-
id=
{
`${props.id}ModalDialogModalFooter-react`
}
>
{
/* todo add autofocus ^^ */
}
{
/* todo add autofocus ^^ */
}
{
props
.
ok
&&
{
props
.
ok
Label
&&
<
span
<
span
data
-
id=
{
`${props.id}-modal-footer-ok-react`
}
data
-
id=
{
`${props.id}-modal-footer-ok-react`
}
className=
{
'modal-ok btn btn-sm '
+
(
state
.
toggleBtn
?
'btn-dark'
:
'btn-light'
)
}
className=
{
'modal-ok btn btn-sm '
+
(
state
.
toggleBtn
?
'btn-dark'
:
'btn-light'
)
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
if
(
props
.
ok
.
fn
)
props
.
ok
.
f
n
()
if
(
props
.
ok
Fn
)
props
.
okF
n
()
handleHide
()
handleHide
()
}
}
}
}
>
>
{
props
.
ok
.
label
?
props
.
ok
.
l
abel
:
'OK'
}
{
props
.
ok
Label
?
props
.
okL
abel
:
'OK'
}
</
span
>
</
span
>
}
}
{
props
.
cancel
&&
{
props
.
cancel
Label
&&
<
span
<
span
data
-
id=
{
`${props.id}-modal-footer-cancel-react`
}
data
-
id=
{
`${props.id}-modal-footer-cancel-react`
}
className=
{
'modal-cancel btn btn-sm '
+
(
state
.
toggleBtn
?
'btn-light'
:
'btn-dark'
)
}
className=
{
'modal-cancel btn btn-sm '
+
(
state
.
toggleBtn
?
'btn-light'
:
'btn-dark'
)
}
data
-
dismiss=
"modal"
data
-
dismiss=
"modal"
onClick=
{
()
=>
{
onClick=
{
()
=>
{
if
(
props
.
cancel
.
fn
)
props
.
cancel
.
f
n
()
if
(
props
.
cancel
Fn
)
props
.
cancelF
n
()
handleHide
()
handleHide
()
}
}
}
}
>
>
{
props
.
cancel
.
label
?
props
.
cancel
.
l
abel
:
'Cancel'
}
{
props
.
cancel
Label
?
props
.
cancelL
abel
:
'Cancel'
}
</
span
>
</
span
>
}
}
</
div
>
</
div
>
...
...
libs/remix-ui/modal-dialog/src/lib/types/index.ts
View file @
00a4585c
...
@@ -2,8 +2,10 @@ export interface ModalDialogProps {
...
@@ -2,8 +2,10 @@ export interface ModalDialogProps {
id
?:
string
id
?:
string
title
?:
string
,
title
?:
string
,
message
?:
string
,
message
?:
string
,
ok
?:
{
label
:
string
,
fn
:
()
=>
void
},
okLabel
?:
string
,
cancel
:
{
label
:
string
,
fn
:
()
=>
void
},
okFn
?:
()
=>
void
,
cancelLabel
?:
string
,
cancelFn
?:
()
=>
void
,
modalClass
?:
string
,
modalClass
?:
string
,
showCancelIcon
?:
boolean
,
showCancelIcon
?:
boolean
,
hide
:
boolean
,
hide
:
boolean
,
...
...
libs/remix-ui/toaster/src/lib/toaster.tsx
View file @
00a4585c
...
@@ -91,10 +91,8 @@ export const Toaster = (props: ToasterProps) => {
...
@@ -91,10 +91,8 @@ export const Toaster = (props: ToasterProps) => {
<>
<>
<
ModalDialog
<
ModalDialog
message=
{
props
.
message
}
message=
{
props
.
message
}
cancel=
{
{
cancelLabel=
'Close'
label
:
'Close'
,
cancelFn=
{
()
=>
{}
}
fn
:
()
=>
{}
}
}
hide=
{
!
state
.
showModal
}
hide=
{
!
state
.
showModal
}
handleHide=
{
hideFullMessage
}
handleHide=
{
hideFullMessage
}
/>
/>
...
...
libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
View file @
00a4585c
...
@@ -145,14 +145,10 @@ export const Workspace = (props: WorkspaceProps) => {
...
@@ -145,14 +145,10 @@ export const Workspace = (props: WorkspaceProps) => {
hide
:
true
,
hide
:
true
,
title
:
''
,
title
:
''
,
message
:
null
,
message
:
null
,
ok
:
{
okLabel
:
''
,
label
:
''
,
okFn
:
()
=>
{},
fn
:
()
=>
{}
cancelLabel
:
''
,
},
cancelFn
:
()
=>
{},
cancel
:
{
label
:
''
,
fn
:
()
=>
{}
},
handleHide
:
null
handleHide
:
null
},
},
loadingLocalhost
:
false
,
loadingLocalhost
:
false
,
...
@@ -168,41 +164,20 @@ export const Workspace = (props: WorkspaceProps) => {
...
@@ -168,41 +164,20 @@ export const Workspace = (props: WorkspaceProps) => {
/* workspace creation, renaming and deletion */
/* workspace creation, renaming and deletion */
const
renameCurrentWorkspace
=
()
=>
{
const
renameCurrentWorkspace
=
()
=>
{
modal
(
'Rename Current Workspace'
,
renameModalMessage
(),
{
modal
(
'Rename Current Workspace'
,
renameModalMessage
(),
'OK'
,
onFinishRenameWorkspace
,
''
,
()
=>
{})
label
:
'OK'
,
fn
:
onFinishRenameWorkspace
},
{
label
:
''
,
fn
:
()
=>
{}
})
}
}
const
createWorkspace
=
()
=>
{
const
createWorkspace
=
()
=>
{
modal
(
'Create Workspace'
,
createModalMessage
(),
{
modal
(
'Create Workspace'
,
createModalMessage
(),
'OK'
,
onFinishCreateWorkspace
,
''
,
()
=>
{})
label
:
'OK'
,
fn
:
onFinishCreateWorkspace
},
{
label
:
''
,
fn
:
()
=>
{}
})
}
}
const
deleteCurrentWorkspace
=
()
=>
{
const
deleteCurrentWorkspace
=
()
=>
{
modal
(
'Delete Current Workspace'
,
'Are you sure to delete the current workspace?'
,
{
modal
(
'Delete Current Workspace'
,
'Are you sure to delete the current workspace?'
,
'OK'
,
onFinishDeleteWorkspace
,
''
,
()
=>
{})
label
:
'OK'
,
fn
:
onFinishDeleteWorkspace
},
{
label
:
''
,
fn
:
()
=>
{}
})
}
}
const
modalMessage
=
(
title
:
string
,
body
:
string
)
=>
{
const
modalMessage
=
(
title
:
string
,
body
:
string
)
=>
{
setTimeout
(()
=>
{
// wait for any previous modal a chance to close
setTimeout
(()
=>
{
// wait for any previous modal a chance to close
modal
(
title
,
body
,
{
modal
(
title
,
body
,
'OK'
,
()
=>
{},
''
,
null
)
label
:
'OK'
,
fn
:
()
=>
{}
},
null
)
},
200
)
},
200
)
}
}
...
@@ -297,7 +272,7 @@ export const Workspace = (props: WorkspaceProps) => {
...
@@ -297,7 +272,7 @@ export const Workspace = (props: WorkspaceProps) => {
})
})
}
}
const
modal
=
async
(
title
:
string
,
message
:
string
|
JSX
.
Element
,
ok
:
{
label
:
string
,
fn
:
()
=>
void
},
cancel
:
{
label
:
string
,
fn
:
()
=>
void
}
)
=>
{
const
modal
=
async
(
title
:
string
,
message
:
string
|
JSX
.
Element
,
ok
Label
:
string
,
okFn
:
()
=>
void
,
cancelLabel
:
string
,
cancelFn
:
()
=>
void
)
=>
{
await
setState
(
prevState
=>
{
await
setState
(
prevState
=>
{
return
{
return
{
...
prevState
,
...
prevState
,
...
@@ -306,8 +281,10 @@ export const Workspace = (props: WorkspaceProps) => {
...
@@ -306,8 +281,10 @@ export const Workspace = (props: WorkspaceProps) => {
hide
:
false
,
hide
:
false
,
message
,
message
,
title
,
title
,
ok
,
okLabel
,
cancel
,
okFn
,
cancelLabel
,
cancelFn
,
handleHide
:
handleHideModal
handleHide
:
handleHideModal
}
}
}
}
...
@@ -339,8 +316,10 @@ export const Workspace = (props: WorkspaceProps) => {
...
@@ -339,8 +316,10 @@ export const Workspace = (props: WorkspaceProps) => {
title=
{
state
.
modal
.
title
}
title=
{
state
.
modal
.
title
}
message=
{
state
.
modal
.
message
}
message=
{
state
.
modal
.
message
}
hide=
{
state
.
modal
.
hide
}
hide=
{
state
.
modal
.
hide
}
ok=
{
state
.
modal
.
ok
}
okLabel=
{
state
.
modal
.
okLabel
}
cancel=
{
state
.
modal
.
cancel
}
okFn=
{
state
.
modal
.
okFn
}
cancelLabel=
{
state
.
modal
.
cancelLabel
}
cancelFn=
{
state
.
modal
.
cancelFn
}
handleHide=
{
handleHideModal
}
>
handleHide=
{
handleHideModal
}
>
{
(
typeof
state
.
modal
.
message
!==
'string'
)
&&
state
.
modal
.
message
}
{
(
typeof
state
.
modal
.
message
!==
'string'
)
&&
state
.
modal
.
message
}
</
ModalDialog
>
</
ModalDialog
>
...
...
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