Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-workflow
Commits
e55e6613
Commit
e55e6613
authored
2 years ago
by
Amit Sharma
Browse files
Options
Download
Patches
Plain Diff
Added env script for reach
parent
34f2e61f
main
dev
feat/centro
feature/formlistapi
fix/remove-forms
revert-67-contributeByGitpod
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitpod.yml
+1
-0
.gitpod.yml
apps/wrapper/src/App.js
+1
-2
apps/wrapper/src/App.js
apps/wrapper/src/components/GenericForm/index.js
+4
-5
apps/wrapper/src/components/GenericForm/index.js
apps/wrapper/src/components/GenericForm/index.module.css
+10
-11
apps/wrapper/src/components/GenericForm/index.module.css
make-envs-for-react.sh
+1
-0
make-envs-for-react.sh
with
17 additions
and
18 deletions
+17
-18
.gitpod.yml
+
1
−
0
View file @
e55e6613
...
@@ -3,6 +3,7 @@ tasks:
...
@@ -3,6 +3,7 @@ tasks:
openMode
:
tab-after
openMode
:
tab-after
init
:
|
init
:
|
bash install-node.sh
bash install-node.sh
bash make-envs-for-react.sh
nvm use 14
nvm use 14
cd packages/enketo-express && pnpm i && pnpm i -g grunt
cd packages/enketo-express && pnpm i && pnpm i -g grunt
gp sync-done setup
gp sync-done setup
...
...
This diff is collapsed.
Click to expand it.
apps/wrapper/src/App.js
+
1
−
2
View file @
e55e6613
...
@@ -2,7 +2,6 @@ import './App.css';
...
@@ -2,7 +2,6 @@ import './App.css';
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
}
from
'
react
'
;
import
GenericForm
from
'
./components/GenericForm
'
;
import
GenericForm
from
'
./components/GenericForm
'
;
function
App
()
{
function
App
()
{
const
[
flows
,
setFlows
]
=
useState
([
const
[
flows
,
setFlows
]
=
useState
([
{
{
...
@@ -40,7 +39,7 @@ function App() {
...
@@ -40,7 +39,7 @@ function App() {
{
flows
?.
map
(
el
=>
<
div
className
=
'
workflowBtns
'
onClick
=
{()
=>
setSelectedFlow
(
el
)}
>
{
el
.
name
}
<
/div>
)
}
{
flows
?.
map
(
el
=>
<
div
className
=
'
workflowBtns
'
onClick
=
{()
=>
setSelectedFlow
(
el
)}
>
{
el
.
name
}
<
/div>
)
}
<
/div
>
<
/div
>
<
/
>
<
/
>
:
<
GenericForm
{...{
selectedFlow
}}
/
>
:
<
GenericForm
{...{
selectedFlow
,
setSelectedFlow
}}
/
>
}
}
<
/div
>
<
/div
>
...
...
This diff is collapsed.
Click to expand it.
apps/wrapper/src/components/GenericForm/index.js
+
4
−
5
View file @
e55e6613
...
@@ -4,7 +4,7 @@ import styles from './index.module.css';
...
@@ -4,7 +4,7 @@ import styles from './index.module.css';
const
GITPOD_URL
=
process
.
env
.
GITPOD_WORKSPACE_URL
const
GITPOD_URL
=
process
.
env
.
GITPOD_WORKSPACE_URL
const
GenericForm
=
(
props
)
=>
{
const
GenericForm
=
(
props
)
=>
{
const
{
selectedFlow
}
=
props
;
const
{
selectedFlow
,
setSelectedFlow
}
=
props
;
const
formSpec
=
require
(
`../../
${
selectedFlow
.
config
}
`
);
const
formSpec
=
require
(
`../../
${
selectedFlow
.
config
}
`
);
const
[
isFirst
,
setIsFirst
]
=
useState
(
true
);
const
[
isFirst
,
setIsFirst
]
=
useState
(
true
);
// Encode string method to URI
// Encode string method to URI
...
@@ -14,6 +14,7 @@ const GenericForm = (props) => {
...
@@ -14,6 +14,7 @@ const GenericForm = (props) => {
const
getFormURI
=
(
form
,
ofsd
,
prefillSpec
)
=>
{
const
getFormURI
=
(
form
,
ofsd
,
prefillSpec
)
=>
{
console
.
log
(
form
,
ofsd
,
prefillSpec
);
console
.
log
(
form
,
ofsd
,
prefillSpec
);
// return encodeURIComponent(`https://3006-samagradevelop-workflow-gkbrz650idv.ws-us89b.gitpod.io/prefill?form=${form}&onFormSuccessData=${encodeFunction(ofsd)}&prefillSpec=${encodeFunction(prefillSpec)}`);
return
encodeURIComponent
(
`
${
GITPOD_URL
.
slice
(
0
,
GITPOD_URL
.
indexOf
(
'
/
'
)
+
2
)
+
"
3006-
"
+
GITPOD_URL
.
slice
(
GITPOD_URL
.
indexOf
(
'
/
'
)
+
2
)}
/prefill?form=
${
form
}
&onFormSuccessData=
${
encodeFunction
(
ofsd
)}
&prefillSpec=
${
encodeFunction
(
prefillSpec
)}
`
);
return
encodeURIComponent
(
`
${
GITPOD_URL
.
slice
(
0
,
GITPOD_URL
.
indexOf
(
'
/
'
)
+
2
)
+
"
3006-
"
+
GITPOD_URL
.
slice
(
GITPOD_URL
.
indexOf
(
'
/
'
)
+
2
)}
/prefill?form=
${
form
}
&onFormSuccessData=
${
encodeFunction
(
ofsd
)}
&prefillSpec=
${
encodeFunction
(
prefillSpec
)}
`
);
}
}
...
@@ -56,10 +57,8 @@ const GenericForm = (props) => {
...
@@ -56,10 +57,8 @@ const GenericForm = (props) => {
return
(
return
(
<
div
className
=
{
styles
.
container
}
>
<
div
className
=
{
styles
.
container
}
>
<
div
className
=
{
styles
.
header
}
>
<
div
>
{
selectedFlow
.
name
}
<
/div
>
<
div
>
Go
back
<
/div
>
<
div
onClick
=
{()
=>
setSelectedFlow
({})}
>
Go
Back
<
/div
>
<
div
>
{
selectedFlow
.
name
}
<
/div
>
<
/div
>
<
iframe
title
=
'
current-form
'
<
iframe
title
=
'
current-form
'
className
=
{
styles
.
odkForm
}
className
=
{
styles
.
odkForm
}
src
=
{
src
=
{
...
...
This diff is collapsed.
Click to expand it.
apps/wrapper/src/components/GenericForm/index.module.css
+
10
−
11
View file @
e55e6613
...
@@ -6,23 +6,22 @@
...
@@ -6,23 +6,22 @@
align-items
:
center
;
align-items
:
center
;
width
:
40vw
;
width
:
40vw
;
padding-bottom
:
2rem
;
padding-bottom
:
2rem
;
position
:
relative
;
}
}
.header
{
.container
>
div
:nth-child
(
1
)
{
display
:
flex
;
font-size
:
3rem
;
flex-direction
:
row
;
width
:
100%
;
justify-content
:
space-between
;
}
.header
:nth-child
(
1
)
{
font-size
:
1rem
;
color
:
#ffc119
;
color
:
#ffc119
;
}
}
.
header
:nth-child
(
2
)
{
.
container
>
div
:nth-child
(
2
)
{
font-size
:
3
rem
;
font-size
:
1
rem
;
color
:
#ffc119
;
color
:
#ffc119
;
position
:
absolute
;
top
:
0
;
left
:
0
;
cursor
:
pointer
;
margin-top
:
1.5rem
;
}
}
.odkForm
{
.odkForm
{
...
...
This diff is collapsed.
Click to expand it.
make-envs-for-react.sh
0 → 100644
+
1
−
0
View file @
e55e6613
echo
REACT_APP_GITPOD_WORKSPACE_URL
=
${
GITPOD_WORKSPACE_URL
}
>
./apps/wrappers/.env
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets