Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GRIN-Global Client
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
GRIN-Global
GRIN-Global Client
Commits
c47b9b9f
Commit
c47b9b9f
authored
Nov 27, 2020
by
Maksym Tishchenko
Committed by
Matija Obreza
Dec 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Admin: AppResources full-text search
parent
77340f20
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
1 deletion
+70
-1
packages/client/src/model/gringlobal/AppResourceFilter.ts
packages/client/src/model/gringlobal/AppResourceFilter.ts
+1
-0
packages/ui-express/src/appresource/ui/admin/AppRecourseBrowsePage.tsx
...xpress/src/appresource/ui/admin/AppRecourseBrowsePage.tsx
+8
-1
packages/ui-express/src/appresource/ui/admin/c/Filters.tsx
packages/ui-express/src/appresource/ui/admin/c/Filters.tsx
+61
-0
No files found.
packages/client/src/model/gringlobal/AppResourceFilter.ts
View file @
c47b9b9f
...
...
@@ -26,6 +26,7 @@ class AppResourceFilter {
public
formName
:
StringFilter
;
public
valueMember
:
StringFilter
;
public
properties
:
StringFilter
;
public
_text
:
string
;
}
...
...
packages/ui-express/src/appresource/ui/admin/AppRecourseBrowsePage.tsx
View file @
c47b9b9f
...
...
@@ -18,11 +18,14 @@ import PageTitle from '@gringlobal/client/ui/common/PageTitle';
import
SysLang
from
'
@gringlobal/client/model/gringlobal/SysLang
'
;
import
{
AppResourceLink
}
from
'
ui/common/Links
'
;
import
Number
from
'
@gringlobal/client/ui/common/Number
'
;
import
Filters
from
'
appresource/ui/admin/c/Filters
'
;
import
AppResourceFilter
from
'
@gringlobal/client/model/gringlobal/AppResourceFilter
'
;
interface
IBrowsePageProps
extends
React
.
ClassAttributes
<
any
>
,
WithTranslation
,
WithBrowsePageBase
{
onSortChange
:
(
sortBy
:
string
,
dir
:
SortDirection
)
=>
void
;
applyFilter
:
(
filter
:
AppResourceFilter
)
=>
void
;
loadMore
:
()
=>
void
;
data
:
FilteredPage
<
AppResource
>
;
}
...
...
@@ -74,13 +77,17 @@ class BrowsePage extends React.Component<IBrowsePageProps> {
};
public
render
()
{
const
{
data
,
t
,
onSortChange
,
loadMore
}
=
this
.
props
;
const
{
data
,
t
,
onSortChange
,
applyFilter
,
loadMore
}
=
this
.
props
;
const
columns
=
AppResourceTableConfig
.
getColumns
(
data
&&
data
.
content
?
data
.
content
[
0
]
:
null
);
return
(
<>
<
PageTitle
title
=
{
t
(
'
appresource.admin.p.browse.title
'
)
}
/>
<
ContentHeader
title
=
{
t
(
'
appresource.admin.p.browse.title
'
)
}
>
<
Filters
onSubmit
=
{
applyFilter
}
filter
=
{
data
&&
data
.
filter
}
/>
</
ContentHeader
>
<
Table
tableKey
=
"appresource-list"
...
...
packages/ui-express/src/appresource/ui/admin/c/Filters.tsx
0 → 100644
View file @
c47b9b9f
import
*
as
React
from
'
react
'
;
import
{
Form
,
Field
,
FormProps
,
FormRenderProps
}
from
'
react-final-form
'
;
import
{
useTranslation
}
from
'
react-i18next
'
;
// UI
import
{
TextField
}
from
'
@gringlobal/client/ui/common/form/TextField
'
;
import
{
withStyles
,
WithStyles
}
from
'
@material-ui/core/styles
'
;
import
AppResourceFilter
from
'
@gringlobal/client/model/gringlobal/AppResourceFilter
'
;
const
styles
=
(
theme
)
=>
({
textField
:
{
'
margin
'
:
'
-1px 0
'
,
'
& input
'
:
{
backgroundColor
:
'
white
'
,
padding
:
'
6px 10px 7px
'
,
minWidth
:
'
300px
'
,
[
theme
.
breakpoints
.
down
(
'
sm
'
)]:
{
minWidth
:
'
120px
'
,
},
},
},
});
interface
IAppResourceFilters
extends
React
.
ClassAttributes
<
any
>
,
FormProps
{
filter
:
AppResourceFilter
;
}
function
appResourceFiltersInternal
(
props
:
FormRenderProps
&
WithStyles
)
{
const
{
handleSubmit
,
classes
}
=
props
;
const
{
t
}
=
useTranslation
();
return
(
<
form
onSubmit
=
{
handleSubmit
}
>
<
Field
placeholder
=
{
t
(
'
appresource.admin.c.filters.text
'
)
}
name
=
"_text"
type
=
"text"
component
=
{
TextField
}
className
=
{
classes
.
textField
}
/>
</
form
>
);
}
const
AppResourceFiltersInternal
=
withStyles
(
styles
)(
appResourceFiltersInternal
);
export
default
class
AppResourceFilters
extends
React
.
Component
<
IAppResourceFilters
,
any
>
{
public
render
()
{
const
{
onSubmit
,
filter
}
=
this
.
props
;
// console.log('filter: ', filter);
return
(
<
Form
initialValues
=
{
{
_text
:
filter
&&
filter
.
_text
?
filter
.
_text
:
null
}
}
// { ...filter }
onSubmit
=
{
onSubmit
}
render
=
{
(
props
)
=>
<
AppResourceFiltersInternal
{
...
props
}
/>
}
/>
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment