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
!114
Draft: Feature/project info publications modal + table
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Draft: Feature/project info publications modal + table
feature/project-info-publications-modal
into
development
Overview
0
Commits
3
Pipelines
4
Changes
14
Closed
Tadeusz Miesiąc
requested to merge
feature/project-info-publications-modal
into
development
1 year ago
Overview
0
Commits
3
Pipelines
4
Changes
14
Expand
Description
Initialised publications table
Things done
added modal for publications list
added headless table for publications
added sorting by column
added pagination
added search bar (component is ready and functional but decided to comment it out due to need of adjusting whole modal layout)
Things that haven't been done in this PR (yet)
testing
elements on map column
filtering by submap (selector)
Edited
1 year ago
by
Tadeusz Miesiąc
0
0
Merge request reports
Viewing commit
e4366cb2
Prev
Next
Show latest version
14 files
+
287
−
31
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
14
Search (e.g. *.vue) (Ctrl+P)
e4366cb2
feat(publications): sorting by, sort order, search bar
· e4366cb2
Tadeusz Miesiąc
authored
1 year ago
src/components/FunctionalArea/Modal/PublicationsModal/PublicationsSearch/PublicationsSearch.component.tsx
0 → 100644
+
46
−
0
Options
import
{
ChangeEvent
,
useEffect
,
useState
}
from
'
react
'
;
import
lensIcon
from
'
@/assets/vectors/icons/lens.svg
'
;
import
{
useDebounce
}
from
'
@/hooks/useDebounce
'
;
import
{
useAppDispatch
}
from
'
@/redux/hooks/useAppDispatch
'
;
import
{
getPublications
}
from
'
@/redux/publications/publications.thunks
'
;
import
{
useAppSelector
}
from
'
@/redux/hooks/useAppSelector
'
;
import
{
isLoadingSelector
}
from
'
@/redux/publications/publications.selectors
'
;
import
Image
from
'
next/image
'
;
export
const
PublicationsSearch
=
():
JSX
.
Element
=>
{
const
dispatch
=
useAppDispatch
();
const
isLoading
=
useAppSelector
(
isLoadingSelector
);
const
[
value
,
setValue
]
=
useState
(
''
);
const
debouncedValue
=
useDebounce
<
string
>
(
value
);
const
handleChange
=
(
event
:
ChangeEvent
<
HTMLInputElement
>
):
void
=>
{
setValue
(
event
.
target
.
value
);
};
useEffect
(()
=>
{
dispatch
(
getPublications
({
search
:
debouncedValue
}));
},
[
dispatch
,
debouncedValue
]);
return
(
<
div
className
=
"mt-5"
>
<
input
value
=
{
value
}
name
=
"search-input"
aria-label
=
"search-input"
data-testid
=
"search-input"
onChange
=
{
handleChange
}
disabled
=
{
isLoading
}
className
=
"h-9 w-72 rounded-[64px] border border-transparent bg-cultured px-4 py-2.5 text-xs font-medium text-font-400 outline-none hover:border-greyscale-600 focus:border-greyscale-600"
/>
<
button
disabled
=
{
isLoading
}
type
=
"button"
className
=
"bg-transparent"
>
<
Image
src
=
{
lensIcon
}
alt
=
"lens icon"
height
=
{
16
}
width
=
{
16
}
className
=
"absolute right-4 top-2.5"
/>
</
button
>
</
div
>
);
};
Loading