Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • kszk/devteam/kszkepzes/old/kszkepzes-frontend
  • kbgergely/kszkepzes-frontend
2 results
Show changes
import { WRITE_NEWS, CLEAR_WRITE, SELECT_NEWS } from '../actions/types';
import { CLEAR_WRITE, SELECT_NEWS, WRITE_NEWS } from '../actions/types';
const INITIAL_STATE = { };
const INITIAL_STATE = {};
export default (state = INITIAL_STATE, action) => {
switch (action.type) {
......
import {
SELECT_TASK, WRITE_TASK, WRITE_TASK_DEADLINE, CLEAR_WRITE,
CLEAR_WRITE,
SELECT_TASK,
WRITE_TASK,
WRITE_TASK_DEADLINE,
} from '../actions/types';
const INITIAL_STATE = { };
const INITIAL_STATE = {};
export default (state = INITIAL_STATE, action) => {
switch (action.type) {
......
import {
ABSENT_CHANGE,
ADD_EVENT,
CHANGE_NO,
CLEAR_WRITE,
DELETE_EVENT,
GET_EVENTS,
GET_EVENT_BY_ID,
VISITOR_CHANGE,
WRITE_EVENT,
ADD_EVENT,
DELETE_EVENT,
CLEAR_WRITE,
ABSENT_CHANGE,
CHANGE_NO,
} from '../actions/types';
const INITIAL_STATE = { events: [], newEvent: {} };
......@@ -25,7 +25,10 @@ export default (state = INITIAL_STATE, action) => {
}
if (state.selectedEvent.absent.indexOf(action.payload) > -1) {
// Ha az absentbe van ki kell venni
state.selectedEvent.absent.splice(state.selectedEvent.absent.indexOf(action.payload), 1);
state.selectedEvent.absent.splice(
state.selectedEvent.absent.indexOf(action.payload),
1
);
}
state.selectedEvent.visitors.push(action.payload);
return {
......@@ -41,8 +44,10 @@ export default (state = INITIAL_STATE, action) => {
return { ...state };
}
if (state.selectedEvent.visitors.indexOf(action.payload) > -1) {
state.selectedEvent.visitors
.splice(state.selectedEvent.visitors.indexOf(action.payload), 1);
state.selectedEvent.visitors.splice(
state.selectedEvent.visitors.indexOf(action.payload),
1
);
}
state.selectedEvent.absent.push(action.payload);
return {
......@@ -55,13 +60,17 @@ export default (state = INITIAL_STATE, action) => {
};
case CHANGE_NO:
if (state.selectedEvent.visitors.indexOf(action.payload) > -1) {
state.selectedEvent.visitors
.splice(state.selectedEvent.visitors.indexOf(action.payload), 1);
state.selectedEvent.visitors.splice(
state.selectedEvent.visitors.indexOf(action.payload),
1
);
}
if (state.selectedEvent.absent.indexOf(action.payload) > -1) {
// Ha az absentbe van ki kell venni
state.selectedEvent.absent
.splice(state.selectedEvent.absent.indexOf(action.payload), 1);
state.selectedEvent.absent.splice(
state.selectedEvent.absent.indexOf(action.payload),
1
);
}
return {
...state,
......@@ -72,7 +81,10 @@ export default (state = INITIAL_STATE, action) => {
},
};
case WRITE_EVENT:
return { ...state, newEvent: { ...state.newEvent, [action.target]: action.payload } };
return {
...state,
newEvent: { ...state.newEvent, [action.target]: action.payload },
};
case ADD_EVENT:
return { ...state, events: [...state.events, action.payload] };
case DELETE_EVENT:
......
/* eslint-disable no-case-declarations */
import {
GET_TASKS,
GET_SOLUTIONS,
CORRECT_SOLUTION,
ADD_SOLUTION,
ADD_TASK,
CORRECT_SOLUTION,
DELETE_TASK,
EDIT_TASK,
ADD_SOLUTION,
GET_PROFILES,
GET_DOCUMENTS,
GET_PROFILES,
GET_SOLUTIONS,
GET_TASKS,
} from '../actions/types';
const INITIAL_STATE = {
......@@ -19,7 +19,6 @@ const INITIAL_STATE = {
documents: [],
};
export default (state = INITIAL_STATE, action) => {
switch (action.type) {
case GET_TASKS:
......@@ -27,29 +26,42 @@ export default (state = INITIAL_STATE, action) => {
case GET_SOLUTIONS:
return { ...state, solutions: action.payload };
case CORRECT_SOLUTION:
const modifiedSolution = state.solutions.find((sol) => sol.id === action.payload.id);
const modifiedSolution = state.solutions.find(
(sol) => sol.id === action.payload.id
);
const modifiedSolutions = state.solutions.slice();
modifiedSolutions.splice(state.solutions.indexOf(modifiedSolution), 1, action.payload);
modifiedSolutions.splice(
state.solutions.indexOf(modifiedSolution),
1,
action.payload
);
return { ...state, solutions: [...modifiedSolutions] };
case ADD_SOLUTION:
return { ...state, solutions: [action.payload, ...state.solutions], id: action.payload.id };
return {
...state,
solutions: [action.payload, ...state.solutions],
id: action.payload.id,
};
case ADD_TASK:
return { ...state, tasks: [action.payload, ...state.tasks] };
case DELETE_TASK:
return {
...state,
tasks: [...state.tasks.slice(0, state.tasks.indexOf(action.payload)),
...state.tasks.slice(state.tasks.indexOf(action.payload) + 1)],
tasks: [
...state.tasks.slice(0, state.tasks.indexOf(action.payload)),
...state.tasks.slice(state.tasks.indexOf(action.payload) + 1),
],
};
case EDIT_TASK:
return {
...state,
tasks: [...state.tasks.map((task) => {
if (task.id !== action.payload.id) {
return task;
}
return action.payload;
}),
tasks: [
...state.tasks.map((task) => {
if (task.id !== action.payload.id) {
return task;
}
return action.payload;
}),
],
};
case GET_PROFILES:
......
import {
GET_NEWS, ADD_NEWS, DELETE_NEWS, EDIT_NEWS,
} from '../actions/types';
import { ADD_NEWS, DELETE_NEWS, EDIT_NEWS, GET_NEWS } from '../actions/types';
const INITIAL_STATE = [];
......
import {
GET_NOTES_BY_EVENT,
WRITE_NOTE,
ADD_EVENT_NOTE,
CLEAR_WRITE,
GET_NOTES_BY_EVENT,
WRITE_NOTE,
} from '../actions/types';
const INITIAL_STATE = { eventNotes: [], actualNote: {} };
......@@ -12,7 +12,10 @@ export default (state = INITIAL_STATE, action) => {
case GET_NOTES_BY_EVENT:
return { ...state, eventNotes: action.payload };
case WRITE_NOTE:
return { ...state, actualNote: { ...state.actualNote, note: action.payload } };
return {
...state,
actualNote: { ...state.actualNote, note: action.payload },
};
case ADD_EVENT_NOTE:
return { ...state, eventNotes: [...state.eventNotes, action.payload] };
case CLEAR_WRITE:
......
import {
GET_TRAINEES, GET_PROFILES, GET_SELECTED_PROFILE, SET_STATUS,
GET_PROFILES,
GET_SELECTED_PROFILE,
GET_TRAINEES,
SET_STATUS,
} from '../actions/types';
const INITIAL_STATE = { profiles: [], selectedProfile: {} };
......@@ -13,10 +16,16 @@ export default (state = INITIAL_STATE, action) => {
case GET_SELECTED_PROFILE:
return { ...state, selectedProfile: action.payload };
case SET_STATUS:
const index = state.profiles.findIndex((item) => item.id === action.payload.id);
const index = state.profiles.findIndex(
(item) => item.id === action.payload.id
);
state.profiles.splice(index, 1, action.payload);
if (action.payload.id === state.selectedProfile.id) {
return { ...state, profiles: [...state.profiles], selectedProfile: action.payload };
return {
...state,
profiles: [...state.profiles],
selectedProfile: action.payload,
};
}
return { ...state, profiles: [...state.profiles] };
default:
......
import {
GET_DEADLINE,
GET_USERDATA,
PROFILE_CHANGE,
GROUP_CHANGE,
GET_DEADLINE,
PROFILE_CHANGE,
} from '../actions/types';
const INITIAL_STATE = {
};
const INITIAL_STATE = {};
export default (state = INITIAL_STATE, action) => {
switch (action.type) {
......
import { combineReducers } from 'redux';
import UserReducer from './UserReducer';
import NewsReducer from './NewsReducer';
import AddNewsReducer from './AddNewsReducer';
import EditNewsReducer from './EditNewsReducer';
import HomeworksReducer from './HomeworksReducer';
import AddTaskReducer from './AddTaskReducer';
import AddSolutionReducer from './AddSolutionReducer';
import EventReducer from './EventReducer';
import TraineeReducer from './TraineeReducer';
import NoteReducer from './NoteReducer';
import AddTaskReducer from './AddTaskReducer';
import CorrectSolutionReducer from './CorrectSolutionReducer';
import EditNewsReducer from './EditNewsReducer';
import EditTaskReducer from './EditTaskReducer';
import EventReducer from './EventReducer';
import GroupsReducer from './GroupsReducer';
import MentorsReducer from './MentorsReducer';
import HomeworksReducer from './HomeworksReducer';
import ImagesReducer from './ImagesReducer';
import MentorsReducer from './MentorsReducer';
import NewsReducer from './NewsReducer';
import NoteReducer from './NoteReducer';
import TraineeReducer from './TraineeReducer';
import UserReducer from './UserReducer';
import { combineReducers } from 'redux';
const rootReducer = combineReducers({
user: UserReducer,
......
......@@ -11,13 +11,13 @@
// This link also includes instructions on opting out of this behavior.
const isLocalhost = Boolean(
window.location.hostname === 'localhost'
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
|| window.location.hostname === '[::1]'
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
|| window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/,
),
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
export default function register() {
......@@ -80,8 +80,8 @@ function checkValidServiceWorker(swUrl) {
.then((response) => {
// Ensure service worker exists, and that we really are getting a JS file.
if (
response.status === 404
|| response.headers.get('content-type').indexOf('javascript') === -1
response.status === 404 ||
response.headers.get('content-type').indexOf('javascript') === -1
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then((registration) => {
......@@ -96,7 +96,7 @@ function checkValidServiceWorker(swUrl) {
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.',
'No internet connection found. App is running in offline mode.'
);
});
}
......
const { createProxyMiddleware } = require('http-proxy-middleware');
const { createProxyMiddleware } = require("http-proxy-middleware");
module.exports = function (app) {
app.use(
'/api',
"/api",
createProxyMiddleware({
target: 'http://localhost:8000',
target: "http://localhost:8000",
changeOrigin: true,
})
}),
);
app.use(
'/admin',
"/admin",
createProxyMiddleware({
target: 'http://localhost:8000',
target: "http://localhost:8000",
changeOrigin: true,
})
}),
);
app.use(
'/staticfiles',
"/staticfiles",
createProxyMiddleware({
target: 'http://localhost:8000',
target: "http://localhost:8000",
changeOrigin: true,
})
}),
);
app.use(
'/mediafiles',
"/mediafiles",
createProxyMiddleware({
target: 'http://localhost:8000',
target: "http://localhost:8000",
changeOrigin: true,
})
}),
);
app.use(
"/oidc",
createProxyMiddleware({
target: "http://localhost:8000",
changeOrigin: true,
}),
);
};
Source diff could not be displayed: it is too large. Options to address this: view the blob.