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
C
catalog.genesys-pgr.org
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Catalog
catalog.genesys-pgr.org
Commits
4ef70934
Commit
4ef70934
authored
Nov 18, 2018
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Allow using all published + owned descriptors
parent
be159f46
Pipeline
#7702
passed with stages
in 4 minutes and 23 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
3 deletions
+51
-3
src/datasets/ui/dataset-stepper/steps/traits/index.tsx
src/datasets/ui/dataset-stepper/steps/traits/index.tsx
+1
-1
src/descriptorlists/ui/descriptorlist-stepper/steps/select/index.tsx
...torlists/ui/descriptorlist-stepper/steps/select/index.tsx
+1
-1
src/descriptors/actions/dashboard.ts
src/descriptors/actions/dashboard.ts
+21
-0
src/service/DescriptorService.ts
src/service/DescriptorService.ts
+28
-1
No files found.
src/datasets/ui/dataset-stepper/steps/traits/index.tsx
View file @
4ef70934
...
...
@@ -5,7 +5,7 @@ import { bindActionCreators } from 'redux';
import
{
log
}
from
'
utilities/debug
'
;
import
{
parse
}
from
'
query-string
'
;
import
{
list
My
Descriptors
as
listMatchingDescriptors
}
from
'
descriptors/actions/dashboard
'
;
import
{
list
Accessible
Descriptors
as
listMatchingDescriptors
}
from
'
descriptors/actions/dashboard
'
;
import
{
addDescriptorsToDataset
,
removeDescriptorsFromDataset
}
from
'
datasets/actions/editor
'
;
import
Descriptor
from
'
model/catalog/Descriptor
'
;
...
...
src/descriptorlists/ui/descriptorlist-stepper/steps/select/index.tsx
View file @
4ef70934
...
...
@@ -10,7 +10,7 @@ import DescriptorFilter from 'model/catalog/DescriptorFilter';
import
{
listCrops
}
from
'
actions/crop
'
;
import
DescriptorPicker
from
'
descriptors/ui/c/DescriptorPicker
'
;
import
{
importDescriptor
}
from
'
descriptors/actions/editor
'
;
import
{
list
My
Descriptors
as
listMatchingDescriptors
}
from
'
descriptors/actions/dashboard
'
;
import
{
list
Accessible
Descriptors
as
listMatchingDescriptors
}
from
'
descriptors/actions/dashboard
'
;
import
{
Page
,
Pagination
}
from
'
model/common.model
'
;
import
{
loadDescriptorList
,
saveDescriptorList
,
addDescriptorsToDescriptorList
,
removeDescriptorsFromDescriptorList
,
...
...
src/descriptors/actions/dashboard.ts
View file @
4ef70934
...
...
@@ -49,6 +49,27 @@ export const createDescriptor = () => (dispatch) => {
return
dispatch
(
push
(
`/dashboard/descriptors/edit`
));
};
export
function
listAccessibleDescriptors
(
page
?,
results
?,
sortBy
?:
string
[],
filter
?:
string
|
DescriptorFilter
,
order
?)
{
return
(
dispatch
,
getState
)
=>
{
dispatch
(
loadingDescriptors
(
page
,
results
,
sortBy
,
filter
,
order
));
return
DescriptorService
.
listAccessibleDescriptors
(
filter
,
{
page
,
size
:
results
,
properties
:
sortBy
,
direction
:
order
})
.
then
((
paged
)
=>
{
dereferenceReferences
(
paged
.
content
,
'
owner
'
,
(
o
)
=>
o
as
Partner
);
if
(
paged
.
number
===
0
)
{
dispatch
(
receiveDescriptorPage
(
paged
,
page
,
results
,
sortBy
,
filter
,
order
));
}
else
{
dispatch
(
appendDescriptorPage
(
paged
,
page
,
results
,
sortBy
,
filter
,
order
));
}
return
dispatch
(
addFilterCode
(
paged
.
filterCode
,
paged
.
filter
));
})
.
catch
((
error
)
=>
{
log
(
'
Error
'
,
error
);
});
};
}
export
function
listMyDescriptors
(
page
?,
results
?,
sortBy
?:
string
[],
filter
?:
string
|
DescriptorFilter
,
order
?)
{
return
(
dispatch
,
getState
)
=>
{
...
...
src/service/DescriptorService.ts
View file @
4ef70934
...
...
@@ -16,6 +16,7 @@ const URL_EXPORT_DESCRIPTORS = `/api/v1/descriptor/export`;
const
URL_GET_OTHER_DESCRIPTOR_INFO
=
UrlTemplate
.
parse
(
`/api/v1/descriptor/extra/{UUID}`
);
const
URL_REVIEW_DESCRIPTOR
=
`/api/v1/descriptor/for-review`
;
const
URL_LIST_DESCRIPTORS
=
`/api/v1/descriptor/list`
;
const
URL_LIST_ACCESSIBLE_DESCRIPTORS
=
`/api/v1/descriptor/list-accessible`
;
const
URL_MY_DESCRIPTORS
=
`/api/v1/descriptor/list-mine`
;
const
URL_LIST_DESCRIPTORS_BY_SHORT
=
UrlTemplate
.
parse
(
`/api/v1/descriptor/list/{filterCode}`
);
const
URL_REJECT_DESCRIPTOR
=
`/api/v1/descriptor/reject`
;
...
...
@@ -198,6 +199,32 @@ class DescriptorService {
}).
then
(({
data
})
=>
data
as
FilteredPage
<
Descriptor
>
);
}
/**
* listAccessibleDescriptors at /api/v1/descriptor/list-accessible
*
* @param filter filter
* @param page undefined
*/
public
static
listAccessibleDescriptors
(
filter
:
string
|
DescriptorFilter
,
page
?:
IPageRequest
):
Promise
<
FilteredPage
<
Descriptor
>>
{
const
qs
=
page
&&
QueryString
.
stringify
({
f
:
typeof
filter
===
'
string
'
?
filter
:
undefined
,
p
:
page
.
page
||
undefined
,
l
:
page
.
size
||
undefined
,
d
:
page
.
direction
&&
page
.
direction
.
length
&&
page
.
direction
||
undefined
,
s
:
page
.
properties
||
undefined
,
},
{});
const
apiUrl
=
URL_LIST_ACCESSIBLE_DESCRIPTORS
+
(
qs
?
`?
${
qs
}
`
:
''
);
// console.log(`Fetching from ${apiUrl}`);
const
content
=
{
data
:
typeof
filter
===
'
string
'
?
null
:
{
...
filter
}
};
return
axiosBackend
.
request
({
url
:
apiUrl
,
method
:
'
POST
'
,
...
content
,
}).
then
(({
data
})
=>
data
as
FilteredPage
<
Descriptor
>
);
}
/**
* myDescriptors at /api/v1/descriptor/list-mine
*
...
...
@@ -206,7 +233,7 @@ class DescriptorService {
*/
public
static
myDescriptors
(
filter
:
string
|
DescriptorFilter
,
page
?:
IPageRequest
):
Promise
<
FilteredPage
<
Descriptor
>>
{
const
qs
=
QueryString
.
stringify
({
const
qs
=
page
&&
QueryString
.
stringify
({
f
:
typeof
filter
===
'
string
'
?
filter
:
undefined
,
p
:
page
.
page
||
undefined
,
l
:
page
.
size
||
undefined
,
...
...
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