Bug/jenkins 40662 run details close problem (#677)
* [JENKINS-40662] fix deep link to run details / closing modal doesn't go back problem by detecting if the prior URL is run details and bailing to activity instead * Revert "[JENKINS-40662] fix deep link to run details / closing modal doesn't go back problem by detecting if the prior URL is run details and bailing to activity instead" This reverts commit 56061749e75dff55810012287af3c0541d56a9b0. * [JENKINS-40662] bake some intelligence into the LocationService so it handles a 'REPLACE' correctly * [JENKINS-40662] don't set the "previous" route if the history change was a "REPLACE" (also for Redux store) * [JENKINS-40662] publish new beta blueocean-core-js; update deps * [JENKINS-40662] publish beta blueocean-core-js; update the deps * [JENKINS-40662] publish beta blueocean-core-js; update the deps * [JENKINS-40662] tick blueocean-core-js version after publishing 0.0.43 * [JENKINS-40662] use prod version of blueocean-core-js
This commit is contained in:
parent
962d6a9a53
commit
fe65e25e6a
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@jenkins-cd/blueocean-core-js",
|
||||
"version": "0.0.42-unpublished",
|
||||
"version": "0.0.44-unpublished",
|
||||
"dependencies": {
|
||||
"@jenkins-cd/diag": {
|
||||
"version": "0.0.2",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@jenkins-cd/blueocean-core-js",
|
||||
"version": "0.0.43-unpublishedEvents1",
|
||||
"version": "0.0.44-unpublished",
|
||||
"description": "Shared JavaScript libraries for use with Jenkins Blue Ocean",
|
||||
"main": "dist/js/index.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
import { observable, action } from 'mobx';
|
||||
|
||||
/**
|
||||
* Stores the previous and current pathnames.
|
||||
*/
|
||||
export default class LocationService {
|
||||
@observable current;
|
||||
@observable previous;
|
||||
|
||||
@action setCurrent(current) {
|
||||
this.previous = this.current;
|
||||
this.current = current;
|
||||
@action setCurrent(newLocation) {
|
||||
if (newLocation.action !== 'REPLACE') {
|
||||
this.current = this.previous;
|
||||
}
|
||||
|
||||
this.current = newLocation.pathname;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -39,7 +39,7 @@
|
|||
"skin-deep": "0.16.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jenkins-cd/blueocean-core-js": "0.0.43-unpublishedEvents1",
|
||||
"@jenkins-cd/blueocean-core-js": "0.0.43",
|
||||
"@jenkins-cd/design-language": "0.0.97",
|
||||
"@jenkins-cd/js-extensions": "0.0.32",
|
||||
"@jenkins-cd/js-modules": "0.0.8",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -35,7 +35,7 @@
|
|||
"react-addons-test-utils": "15.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jenkins-cd/blueocean-core-js": "0.0.43-unpublishedEvents1",
|
||||
"@jenkins-cd/blueocean-core-js": "0.0.43",
|
||||
"@jenkins-cd/design-language": "0.0.97",
|
||||
"@jenkins-cd/js-extensions": "0.0.32",
|
||||
"@jenkins-cd/js-modules": "0.0.8",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -29,7 +29,7 @@
|
|||
"zombie": "4.2.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jenkins-cd/blueocean-core-js": "0.0.43-unpublishedEvents1",
|
||||
"@jenkins-cd/blueocean-core-js": "0.0.43",
|
||||
"@jenkins-cd/design-language": "0.0.97",
|
||||
"@jenkins-cd/js-extensions": "0.0.32",
|
||||
"@jenkins-cd/js-modules": "0.0.8",
|
||||
|
|
|
@ -155,19 +155,20 @@ function startApp(routes, stores) {
|
|||
const { dispatch, getState } = store;
|
||||
const { current } = getState().location;
|
||||
|
||||
// no current happens on the first request
|
||||
if (current) {
|
||||
// don't store current as previous if doing a REPLACE (or on the first request)
|
||||
if (newLocation.action !== 'REPLACE' && current) {
|
||||
dispatch({
|
||||
type: ACTION_TYPES.SET_LOCATION_PREVIOUS,
|
||||
payload: current,
|
||||
});
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: ACTION_TYPES.SET_LOCATION_CURRENT,
|
||||
payload: newLocation.pathname,
|
||||
});
|
||||
|
||||
locationService.setCurrent(newLocation.pathname);
|
||||
locationService.setCurrent(newLocation);
|
||||
});
|
||||
|
||||
sseService._initListeners();
|
||||
|
|
Loading…
Reference in New Issue