Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Frontend V2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Contributor 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
GraphPolaris
Frontend V2
Commits
a349c387
Commit
a349c387
authored
7 months ago
by
Marcos Pieras
Committed by
Dennis Collaris
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
feat: use standard entity pill for table vis settings
parent
c2278071
No related branches found
No related tags found
1 merge request
!183
table UI settings
Checking pipeline status
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libs/shared/lib/vis/visualizations/tablevis/tablevis.tsx
+68
-44
68 additions, 44 deletions
libs/shared/lib/vis/visualizations/tablevis/tablevis.tsx
with
68 additions
and
44 deletions
libs/shared/lib/vis/visualizations/tablevis/tablevis.tsx
+
68
−
44
View file @
a349c387
...
@@ -5,6 +5,7 @@ import { Input } from '@graphpolaris/shared/lib/components/inputs';
...
@@ -5,6 +5,7 @@ import { Input } from '@graphpolaris/shared/lib/components/inputs';
import
{
SettingsContainer
}
from
'
@graphpolaris/shared/lib/vis/components/config
'
;
import
{
SettingsContainer
}
from
'
@graphpolaris/shared/lib/vis/components/config
'
;
import
{
Button
}
from
'
@graphpolaris/shared/lib/components/buttons
'
;
import
{
Button
}
from
'
@graphpolaris/shared/lib/components/buttons
'
;
import
{
useSearchResultData
}
from
'
@graphpolaris/shared/lib/data-access
'
;
import
{
useSearchResultData
}
from
'
@graphpolaris/shared/lib/data-access
'
;
import
{
EntityPill
}
from
'
@graphpolaris/shared/lib/components/pills/Pill
'
;
export
type
TableProps
=
{
export
type
TableProps
=
{
id
:
string
;
id
:
string
;
...
@@ -144,51 +145,74 @@ const TableSettings = ({ settings, graphMetadata, updateSettings }: Visualizatio
...
@@ -144,51 +145,74 @@ const TableSettings = ({ settings, graphMetadata, updateSettings }: Visualizatio
return
(
return
(
<
SettingsContainer
>
<
SettingsContainer
>
<
Input
<
div
className
=
"my-2"
>
type
=
"dropdown"
<
Input
label
=
"Select entity"
className
=
"w-full text-justify justify-center"
value
=
{
settings
.
displayEntity
}
type
=
"dropdown"
onChange
=
{
(
val
)
=>
updateSettings
({
displayEntity
:
val
as
string
})
}
value
=
{
settings
.
displayEntity
}
options
=
{
graphMetadata
.
nodes
.
labels
}
options
=
{
graphMetadata
.
nodes
.
labels
}
/>
onChange
=
{
(
val
)
=>
updateSettings
({
displayEntity
:
val
as
string
})
}
<
Input
type
=
"boolean"
label
=
"Show barplot"
value
=
{
settings
.
showBarplot
}
onChange
=
{
(
val
)
=>
updateSettings
({
showBarplot
:
val
})
}
/>
overrideRender
=
{
<
Input
<
EntityPill
type
=
"dropdown"
title
=
{
label
=
"Items per page"
<
div
className
=
"flex flex-row justify-between items-center cursor-pointer"
>
value
=
{
settings
.
itemsPerPage
}
<
span
>
{
settings
.
displayEntity
||
''
}
</
span
>
onChange
=
{
(
val
)
=>
updateSettings
({
itemsPerPage
:
val
as
number
})
}
<
Button
variantType
=
"secondary"
variant
=
"ghost"
size
=
"2xs"
iconComponent
=
"icon-[ic--baseline-arrow-drop-down]"
/>
options
=
{
[
10
,
25
,
50
,
100
]
}
</
div
>
/>
}
<
Input
type
=
"number"
label
=
"Max Bars in Bar Plots"
value
=
{
settings
.
maxBarsCount
}
onChange
=
{
(
val
)
=>
updateSettings
({
maxBarsCount
:
val
})
}
/>
<
div
>
<
span
className
=
"text-sm"
>
Attributes to display:
</
span
>
<
Button
className
=
"w-full text-justify justify-start"
variantType
=
"secondary"
variant
=
"ghost"
size
=
"sm"
onClick
=
{
toggleCollapseAttr
}
iconComponent
=
"icon-[ic--baseline-arrow-drop-down]"
>
attributes:
{
'
'
}
</
Button
>
<
div
className
=
""
>
{
!
areCollapsedAttr
&&
(
<
Input
type
=
"checkbox"
value
=
{
settings
.
displayAttributes
}
options
=
{
selectedNodeAttributes
}
onChange
=
{
(
val
:
string
[]
|
string
)
=>
{
const
updatedVal
=
Array
.
isArray
(
val
)
?
val
:
[
val
];
updateSettings
({
displayAttributes
:
updatedVal
});
}
}
/>
/>
)
}
}
></
Input
>
<
div
className
=
"my-2"
>
<
Input
type
=
"boolean"
label
=
"Show barplot"
value
=
{
settings
.
showBarplot
}
onChange
=
{
(
val
)
=>
updateSettings
({
showBarplot
:
val
})
}
/>
</
div
>
<
div
className
=
"my-2"
>
<
Input
type
=
"dropdown"
label
=
"Items per page"
value
=
{
settings
.
itemsPerPage
}
onChange
=
{
(
val
)
=>
updateSettings
({
itemsPerPage
:
val
as
number
})
}
options
=
{
[
10
,
25
,
50
,
100
]
}
/>
</
div
>
<
div
className
=
"my-2"
>
<
Input
type
=
"number"
label
=
"Max Bars in Bar Plots"
value
=
{
settings
.
maxBarsCount
}
onChange
=
{
(
val
)
=>
updateSettings
({
maxBarsCount
:
val
})
}
/>
</
div
>
<
div
className
=
"flex flex-col items-start space-y-2"
>
<
span
className
=
"text-sm"
>
Attributes to display:
</
span
>
<
Button
className
=
"w-full text-justify justify-start"
variantType
=
"secondary"
variant
=
"ghost"
size
=
"sm"
onClick
=
{
toggleCollapseAttr
}
iconComponent
=
{
areCollapsedAttr
?
'
icon-[ic--baseline-arrow-right]
'
:
'
icon-[ic--baseline-arrow-drop-down]
'
}
>
attributes:
{
'
'
}
</
Button
>
<
div
className
=
""
>
{
!
areCollapsedAttr
&&
(
<
Input
type
=
"checkbox"
value
=
{
settings
.
displayAttributes
}
options
=
{
selectedNodeAttributes
}
onChange
=
{
(
val
:
string
[]
|
string
)
=>
{
const
updatedVal
=
Array
.
isArray
(
val
)
?
val
:
[
val
];
updateSettings
({
displayAttributes
:
updatedVal
});
}
}
/>
)
}
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
SettingsContainer
>
</
SettingsContainer
>
...
...
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