Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
greg
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
it-bott-integrasjoner
greg
Commits
dc71d3e0
Commit
dc71d3e0
authored
3 years ago
by
Jonas Braathen
Browse files
Options
Downloads
Patches
Plain Diff
Hide 'available in search' checkbox behind a feature flag
parent
21fe6245
No related branches found
No related tags found
1 merge request
!270
Hide 'available in search' checkbox behind a feature flag
Pipeline
#114869
passed
3 years ago
Stage: venv update
Stage: tests and linting
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/appConfig.ts
+4
-0
4 additions, 0 deletions
frontend/src/appConfig.ts
frontend/src/routes/sponsor/guest/newGuestRole/index.tsx
+20
-18
20 additions, 18 deletions
frontend/src/routes/sponsor/guest/newGuestRole/index.tsx
with
24 additions
and
18 deletions
frontend/src/appConfig.ts
+
4
−
0
View file @
dc71d3e0
...
...
@@ -27,6 +27,10 @@ export const appStagingWarning: boolean =
export
const
guestConsentStepEnabled
:
boolean
=
env
.
REACT_APP_GUEST_CONSENT_STEP_ENABLED
===
'
true
'
/* Should the 'available in search' field on roles be available for use? */
export
const
availableInSearchEnabled
:
boolean
=
env
.
REACT_APP_AVAILABLE_IN_SEARCH_ENABLED
===
'
true
'
/* Footer content */
export
const
responsibleOrganization
:
string
=
env
.
REACT_APP_RESPONSIBLE_ORGANIZATION
as
string
...
...
This diff is collapsed.
Click to expand it.
frontend/src/routes/sponsor/guest/newGuestRole/index.tsx
+
20
−
18
View file @
dc71d3e0
import
{
DatePicker
}
from
'
@mui/lab
'
import
{
useState
}
from
'
react
'
import
{
Controller
,
useForm
}
from
'
react-hook-form
'
import
{
useTranslation
}
from
'
react-i18next
'
import
{
Link
,
useHistory
,
useParams
}
from
'
react-router-dom
'
import
{
format
}
from
'
date-fns
'
import
{
addDays
}
from
'
date-fns/fp
'
import
{
DatePicker
}
from
'
@mui/lab
'
import
{
Checkbox
,
Button
,
...
...
@@ -15,17 +20,13 @@ import {
Typography
,
}
from
'
@mui/material
'
import
Page
from
'
components/page
'
import
{
forma
t
}
from
'
date-fn
s
'
import
{
Gues
t
}
from
'
interface
s
'
import
useOus
,
{
enSort
,
nbSort
,
OuData
}
from
'
hooks/useOus
'
import
useRoleTypes
,
{
RoleTypeData
}
from
'
hooks/useRoleTypes
'
import
{
Guest
}
from
'
interfaces
'
import
{
useState
}
from
'
react
'
import
{
Controller
,
useForm
}
from
'
react-hook-form
'
import
{
useTranslation
}
from
'
react-i18next
'
import
{
Link
,
useHistory
,
useParams
}
from
'
react-router-dom
'
import
SponsorInfoButtons
from
'
routes/components/sponsorInfoButtons
'
import
{
submitJsonOpts
}
from
'
utils
'
import
{
useFeatureContext
}
from
'
contexts/featureContext
'
import
{
availableInSearchEnabled
}
from
'
appConfig
'
type
AddRoleFormData
=
{
orgunit
:
number
...
...
@@ -72,7 +73,7 @@ const postRole = async (formData: AddRoleFormData, pid: string) => {
if
(
formData
.
comments
)
{
payload
.
comments
=
formData
.
comments
}
if
(
formData
.
available_in_search
)
{
if
(
availableInSearchEnabled
&&
formData
.
available_in_search
)
{
payload
.
available_in_search
=
formData
.
available_in_search
}
...
...
@@ -299,16 +300,17 @@ function NewGuestRole({ guest, reloadGuestInfo }: NewGuestRoleProps) {
{
...
register
(
'
comments
'
)
}
/>
)
}
<
FormControlLabel
control
=
{
<
Checkbox
id
=
"available_in_search"
{
...
register
(
'
available_in_search
'
)
}
/>
}
label
=
{
t
(
'
input.searchable
'
)
}
/>
{
availableInSearchEnabled
&&
(
<
FormControlLabel
control
=
{
<
Checkbox
id
=
"available_in_search"
{
...
register
(
'
available_in_search
'
)
}
/>
}
label
=
{
t
(
'
input.searchable
'
)
}
/>
)
}
<
Button
variant
=
"contained"
color
=
"secondary"
type
=
"submit"
>
{
t
(
'
button.save
'
)
}
</
Button
>
...
...
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