Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compendium-v2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
compendium-v2
Commits
4cec444b
Commit
4cec444b
authored
1 year ago
by
Bjarke Madsen
Browse files
Options
Downloads
Patches
Plain Diff
Don't show buttons on readonly surveys
parent
a350f798
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
survey-frontend/src/SurveyContainerComponent.tsx
+2
-2
2 additions, 2 deletions
survey-frontend/src/SurveyContainerComponent.tsx
survey-frontend/src/SurveyNavigationComponent.tsx
+4
-2
4 additions, 2 deletions
survey-frontend/src/SurveyNavigationComponent.tsx
with
6 additions
and
4 deletions
survey-frontend/src/SurveyContainerComponent.tsx
+
2
−
2
View file @
4cec444b
...
...
@@ -22,7 +22,7 @@ function SurveyContainerComponent({ loadFrom, saveTo = '', readonly = false }) {
},
[]);
if
(
surveyModel
===
undefined
)
{
return
'
loading...
'
return
'
loading
survey
...
'
}
async
function
getModel
()
{
...
...
@@ -128,7 +128,7 @@ function SurveyContainerComponent({ loadFrom, saveTo = '', readonly = false }) {
</
Row
>
<
Row
>
<
SurveyNavigationComponent
surveyModel
=
{
surveyModel
}
endSurvey
=
{
endSurvey
}
saveSurvey
=
{
saveSurvey
}
validatePage
=
{
validatePage
}
>
<
SurveyNavigationComponent
surveyModel
=
{
surveyModel
}
endSurvey
=
{
endSurvey
}
saveSurvey
=
{
saveSurvey
}
validatePage
=
{
validatePage
}
readonly
=
{
readonly
}
>
<
SurveyComponent
surveyModel
=
{
surveyModel
}
verificationStatus
=
{
verificationStatus
}
/>
</
SurveyNavigationComponent
>
</
Row
>
...
...
This diff is collapsed.
Click to expand it.
survey-frontend/src/SurveyNavigationComponent.tsx
+
4
−
2
View file @
4cec444b
...
...
@@ -3,9 +3,8 @@ import ProgressBar from './ProgressBar';
import
{
Container
,
Row
}
from
"
react-bootstrap
"
;
function
SurveyNavigationComponent
({
surveyModel
,
endSurvey
,
saveSurvey
,
validatePage
,
children
})
{
function
SurveyNavigationComponent
({
surveyModel
,
endSurvey
,
saveSurvey
,
validatePage
,
children
,
readonly
})
{
const
[
pageNo
,
setPageNo
]
=
useState
(
0
);
useEffect
(()
=>
{
setPageNo
(
surveyModel
.
currentPageNo
)
},
[
surveyModel
]);
...
...
@@ -27,6 +26,9 @@ function SurveyNavigationComponent({ surveyModel, endSurvey, saveSurvey, validat
};
const
renderExternalNavigation
=
()
=>
{
if
(
readonly
)
{
return
<></>;
}
return
(
<
div
className
=
"navigation-block"
>
<
div
className
=
"navigation-progress-container"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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