Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
minerva
frontend
Merge requests
!113
feat: add graphics full tab business logic (
MIN-165
)
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
feat: add graphics full tab business logic (
MIN-165
)
MIN-165-graphics-full-tab-business-logic
into
development
Overview
20
Commits
4
Pipelines
8
Changes
54
9 unresolved threads
Hide all comments
Merged
Adrian Orłów
requested to merge
MIN-165-graphics-full-tab-business-logic
into
development
1 year ago
Overview
20
Commits
4
Pipelines
8
Changes
54
9 unresolved threads
Hide all comments
Expand
Closes
MIN-165
Objective:
Implement export graphics tab business logic
What has been done:
CheckboxFilter handle radio type
ImageFormat component
ImageSize component
graphics download handler
unit tests for all above
Edited
1 year ago
by
Adrian Orłów
0
0
Merge request reports
Compare
development
version 3
0dee60b6
1 year ago
version 2
834e532a
1 year ago
version 1
cbc2243d
1 year ago
development (base)
and
latest version
latest version
359c31b8
4 commits,
1 year ago
version 3
0dee60b6
3 commits,
1 year ago
version 2
834e532a
2 commits,
1 year ago
version 1
cbc2243d
1 commit,
1 year ago
54 files
+
1661
−
97
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
54
Search (e.g. *.vue) (Ctrl+P)
src/components/Map/Drawer/ExportDrawer/CheckboxFilter/OptionInput/OptionInput.component.tsx
0 → 100644
+
48
−
0
Options
import
{
twMerge
}
from
'
tailwind-merge
'
;
import
{
CheckboxItem
}
from
'
../CheckboxFilter.types
'
;
interface
Props
{
option
:
CheckboxItem
;
currentOptions
:
CheckboxItem
[];
type
:
'
checkbox
'
|
'
radio
'
;
handleCheckboxChange
(
option
:
CheckboxItem
):
void
;
handleRadioChange
(
option
:
CheckboxItem
):
void
;
}
export
const
OptionInput
=
({
option
,
currentOptions
=
[],
type
,
handleCheckboxChange
,
handleRadioChange
,
}:
Props
):
React
.
ReactNode
=>
{
const
isChecked
=
Boolean
(
currentOptions
.
find
(
currentOption
=>
currentOption
.
id
===
option
.
id
));
const
handleChange
=
():
void
=>
{
switch
(
type
)
{
case
'
checkbox
'
:
handleCheckboxChange
(
option
);
break
;
case
'
radio
'
:
handleRadioChange
(
option
);
break
;
default
:
throw
new
Error
(
`
${
type
}
is unknown option input type`
);
}
};
return
(
<
label
className
=
"flex items-center gap-x-2"
>
<
input
type
=
{
type
}
className
=
{
twMerge
(
'
h-4 w-4 shrink-0 accent-primary-500
'
,
type
===
'
radio
'
&&
'
rounded-full
'
,
)
}
onChange
=
{
handleChange
}
checked
=
{
isChecked
}
/>
<
div
className
=
"break-all text-sm"
>
{
option
.
label
}
</
div
>
</
label
>
);
};
Loading