Remove redux capabilites stuff
This commit is contained in:
parent
42bf4f2f77
commit
0d47f44ef7
|
@ -106,8 +106,8 @@ export class Activity extends Component {
|
|||
return null;
|
||||
}
|
||||
|
||||
const isMultiBranchPipeline = capabilities.find(cap => cap === MULTIBRANCH_PIPELINE) !== null;
|
||||
|
||||
const isMultiBranchPipeline = capabilities.find(cap => cap === MULTIBRANCH_PIPELINE) !== undefined;
|
||||
|
||||
// Only show the Run button for non multi-branch pipelines.
|
||||
// Multi-branch pipelines have the Run/play button beside them on
|
||||
// the Branches/PRs tab.
|
||||
|
|
|
@ -51,8 +51,6 @@ export const ACTION_TYPES = keymirror({
|
|||
SET_NODE: null,
|
||||
SET_NODES: null,
|
||||
SET_LOGS: null,
|
||||
SET_CAPABILITIES: null,
|
||||
|
||||
});
|
||||
|
||||
export const actionHandlers = {
|
||||
|
@ -90,14 +88,6 @@ export const actionHandlers = {
|
|||
[ACTION_TYPES.SET_NODE](state, { payload }): State {
|
||||
return state.set('node', { ...payload });
|
||||
},
|
||||
[ACTION_TYPES.SET_CAPABILITIES](state, { payload }): State {
|
||||
const caps = { ...state.caps } || {};
|
||||
for (const clzz of Object.keys(payload.map)) {
|
||||
const entry = payload.map[clzz];
|
||||
caps[clzz] = entry.classes;
|
||||
}
|
||||
return state.set('capabilities', caps);
|
||||
},
|
||||
[ACTION_TYPES.SET_NODES](state, { payload }): State {
|
||||
const nodes = { ...state.nodes } || {};
|
||||
nodes[payload.nodesBaseUrl] = payload;
|
||||
|
@ -858,27 +848,7 @@ export const actions = {
|
|||
));
|
||||
};
|
||||
},
|
||||
|
||||
fetchCapabilitiesIfNeeded(_class) {
|
||||
return (dispatch, getState) => {
|
||||
if (!_class) {
|
||||
return null;
|
||||
}
|
||||
const caps = getState().adminStore.capabilities;
|
||||
const baseUrl = UrlConfig.jenkinsRootURL;
|
||||
const url = `${baseUrl}blue/rest/classes/?q=${_class}`;
|
||||
|
||||
if (caps && caps[_class]) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return dispatch(actions.generateData(
|
||||
url,
|
||||
ACTION_TYPES.SET_CAPABILITIES
|
||||
));
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
resetTestDetails() {
|
||||
return (dispatch) =>
|
||||
dispatch({
|
||||
|
|
|
@ -15,7 +15,6 @@ export {
|
|||
isMultiBranch,
|
||||
currentBranches,
|
||||
testResults,
|
||||
capabilities,
|
||||
} from './reducer';
|
||||
export {
|
||||
ACTION_TYPES,
|
||||
|
|
|
@ -26,7 +26,6 @@ export const isMultiBranch = createSelector(
|
|||
return null;
|
||||
}
|
||||
);
|
||||
export const capabilities = createSelector([adminStore], store => store.capabilities);
|
||||
|
||||
// reducer
|
||||
export function reducer(state = new State(), action:Object):State {
|
||||
|
|
Loading…
Reference in New Issue