Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-web
ensembl-client
Commits
59505cb3
Unverified
Commit
59505cb3
authored
Aug 31, 2021
by
Jyothish
Committed by
GitHub
Aug 31, 2021
Browse files
add new track api url (#560)
parent
1032b825
Pipeline
#189252
passed with stages
in 4 minutes and 41 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
40 deletions
+29
-40
src/ensembl/src/shared/state/genome/genomeActions.ts
src/ensembl/src/shared/state/genome/genomeActions.ts
+29
-40
No files found.
src/ensembl/src/shared/state/genome/genomeActions.ts
View file @
59505cb3
...
...
@@ -41,26 +41,23 @@ export const fetchGenomeInfoAsyncActions = createAsyncAction(
'
genome/fetch_genome_info_failure
'
)
<
undefined
,
GenomeInfoData
,
Error
>
();
export
const
fetchGenomeData
=
(
genomeId
:
string
):
ThunkAction
<
void
,
any
,
null
,
Action
<
string
>>
=>
async
(
dispatch
)
=>
{
await
Promise
.
all
([
dispatch
(
fetchGenomeInfo
(
genomeId
)),
dispatch
(
fetchGenomeTrackCategories
(
genomeId
)),
dispatch
(
fetchGenomeKaryotype
(
genomeId
))
]);
dispatch
(
ensureSpeciesIsCommitted
(
genomeId
));
dispatch
(
fetchExampleEnsObjects
(
genomeId
));
};
export
const
fetchGenomeInfo
:
ActionCreator
<
ThunkAction
<
void
,
any
,
null
,
Action
<
string
>
>>
=
(
genomeId
:
string
)
=>
async
(
dispatch
,
getState
:
()
=>
RootState
)
=>
{
export
const
fetchGenomeData
=
(
genomeId
:
string
):
ThunkAction
<
void
,
any
,
null
,
Action
<
string
>>
=>
async
(
dispatch
)
=>
{
await
Promise
.
all
([
dispatch
(
fetchGenomeInfo
(
genomeId
)),
dispatch
(
fetchGenomeTrackCategories
(
genomeId
)),
dispatch
(
fetchGenomeKaryotype
(
genomeId
))
]);
dispatch
(
ensureSpeciesIsCommitted
(
genomeId
));
dispatch
(
fetchExampleEnsObjects
(
genomeId
));
};
export
const
fetchGenomeInfo
:
ActionCreator
<
ThunkAction
<
void
,
any
,
null
,
Action
<
string
>>
>
=
(
genomeId
:
string
)
=>
async
(
dispatch
,
getState
:
()
=>
RootState
)
=>
{
const
state
=
getState
();
const
genomeInfo
=
getGenomeInfoById
(
state
,
genomeId
);
if
(
genomeInfo
)
{
...
...
@@ -87,16 +84,12 @@ export const fetchGenomeTrackCategoriesAsyncActions = createAsyncAction(
'
genome/fetch_genome_track_categories_failure
'
)
<
string
,
GenomeTrackCategories
,
Error
>
();
export
const
fetchGenomeTrackCategories
:
ActionCreator
<
ThunkAction
<
void
,
any
,
null
,
Action
<
string
>
>>
=
(
genomeId
:
string
)
=>
async
(
dispatch
,
getState
:
()
=>
RootState
)
=>
{
export
const
fetchGenomeTrackCategories
:
ActionCreator
<
ThunkAction
<
void
,
any
,
null
,
Action
<
string
>>
>
=
(
genomeId
:
string
)
=>
async
(
dispatch
,
getState
:
()
=>
RootState
)
=>
{
try
{
const
currentGenomeTrackCategories
:
GenomeTrackCategories
=
getGenomeTrackCategories
(
getState
()
);
const
currentGenomeTrackCategories
:
GenomeTrackCategories
=
getGenomeTrackCategories
(
getState
());
if
(
currentGenomeTrackCategories
[
genomeId
])
{
return
;
...
...
@@ -108,10 +101,10 @@ export const fetchGenomeTrackCategories: ActionCreator<ThunkAction<
dispatch
(
fetchGenomeTrackCategoriesAsyncActions
.
request
(
genomeId
));
const
url
=
`/api/
genomesearch/genome
/track_categories
?genome_id=
${
genomeId
}
`
;
const
url
=
`/api/
tracks
/track_categories
/
${
genomeId
}
`
;
const
response
=
await
apiService
.
fetch
(
url
);
updatedGenomeTrackCategories
[
genomeId
]
=
response
.
track_categories
;
updatedGenomeTrackCategories
[
genomeId
]
=
response
.
track_categories
;
dispatch
(
fetchGenomeTrackCategoriesAsyncActions
.
success
(
updatedGenomeTrackCategories
...
...
@@ -128,16 +121,12 @@ export const fetchGenomeKaryotypeAsyncActions = createAsyncAction(
'
genome/fetch_genome_karyotype_failure
'
)
<
string
,
any
,
Error
>
();
export
const
fetchGenomeKaryotype
:
ActionCreator
<
ThunkAction
<
void
,
any
,
null
,
Action
<
string
>
>>
=
(
genomeId
:
string
)
=>
async
(
dispatch
,
getState
:
()
=>
RootState
)
=>
{
export
const
fetchGenomeKaryotype
:
ActionCreator
<
ThunkAction
<
void
,
any
,
null
,
Action
<
string
>>
>
=
(
genomeId
:
string
)
=>
async
(
dispatch
,
getState
:
()
=>
RootState
)
=>
{
try
{
const
currentGenomeKaryotype
:
|
GenomeKaryotypeItem
[]
|
null
=
getGenomeKaryotype
(
getState
());
const
currentGenomeKaryotype
:
GenomeKaryotypeItem
[]
|
null
=
getGenomeKaryotype
(
getState
());
if
(
currentGenomeKaryotype
)
{
return
;
...
...
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