import { RECEIVE_USER, ADD_PROJECT_NOTIFICATIONS, REMOVE_PROJECT_NOTIFICATIONS } from './actions';
function addProjectNotifications (state, project) {
- const found = state.find(notification => {
- return notification.project.internalId === project.internalId;
- });
+ const found = state.find(notification => notification.project.internalId === project.internalId);
if (found) {
return state;
}
function removeProjectNotifications (state, project) {
- return state.filter(notification => {
- return notification.project.internalId !== project.internalId;
- });
+ return state.filter(notification => notification.project.internalId !== project.internalId);
}
export const initialState = {
projectNotifications: window.sonarqube.notifications.project
};
-export default function (state = initialState, action) {
+export default function (state = initialState, action = {}) {
switch (action.type) {
case RECEIVE_USER:
return {
return tasks.map(task => task.id === newTask.id ? newTask : task);
}
-export default function (state = initialState, action) {
+export default function (state = initialState, action = {}) {
switch (action.type) {
case INIT:
return {
errorMessage: null
};
-export function current (state = initialState, action) {
+export function current (state = initialState, action = {}) {
/* eslint no-case-declarations: 0 */
/* FIXME fix it ^^^ */
switch (action.type) {
}
}
-export function bucket (state = [], action) {
+export function bucket (state = [], action = {}) {
switch (action.type) {
case INIT:
return merge(state, action.component);
const isNew = !this.model;
return _.extend(ModalForm.prototype.serializeData.apply(this, arguments), {
metrics,
- canCreateMetric: !isNew || (isNew && metrics.length > 0)
+ canCreateMetric: !isNew || metrics.length > 0
});
}
});
const initialState = {};
-export default function rootReducer (state = initialState, action) {
+export default function rootReducer (state = initialState, action = {}) {
switch (action.type) {
case SET_STATE:
return { ...state, ...action.nextState };
const outOfBounds = b.from > line || b.from + b.size < line;
const currentFile = b._ref === '1';
const shouldDisplayForCurrentFile = outOfBounds || foundOne;
- const shouldDisplay = !currentFile || (currentFile && shouldDisplayForCurrentFile);
+ const shouldDisplay = !currentFile || shouldDisplayForCurrentFile;
const isOk = (b._ref != null) && shouldDisplay;
if (b._ref === '1' && !outOfBounds) {
foundOne = true;