Merge branch 'edge_v4' into 'develop'

Merge to develop

See merge request !255
parents 96f089d9 1cb2f0e4
<?php
/**
* @file
* Contains \Drupal\query_example\Controller\QueryExampleController.
* Contains \Drupal\query_example\Controller\QueryExampleController
*/
namespace Drupal\epal\Controller;
......@@ -20,8 +20,6 @@ use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\TypedData\Plugin\DataType\TimeStamp;
use Drupal\Core\Language\LanguageManagerInterface;
class HelpDesk extends ControllerBase {
protected $entity_query;
......@@ -35,7 +33,6 @@ class HelpDesk extends ControllerBase {
Connection $connection,
LoggerChannelFactoryInterface $loggerChannel
) {
$this->entityTypeManager = $entityTypeManager;
$this->entity_query = $entity_query;
$connection = Database::getConnection();
......@@ -53,20 +50,14 @@ class HelpDesk extends ControllerBase {
);
}
private function respondWithStatus($arr, $s) {
$res = new JsonResponse($arr);
$res->setStatusCode($s);
return $res;
}
public function sendEmail(Request $request)
{
if (!$request->isMethod('POST')) {
return $this->respondWithStatus([
"message" => t("Method Not Allowed")
......@@ -87,10 +78,8 @@ class HelpDesk extends ControllerBase {
'message' => t("post with no data"),
], Response::HTTP_BAD_REQUEST);
}
}
private function sendEmailToHelpDesk($email, $name, $cont_message, $surname) {
$mailManager = \Drupal::service('plugin.manager.mail');
......@@ -115,9 +104,6 @@ class HelpDesk extends ControllerBase {
public function findTotalStudents(Request $request)
{
$authToken = $request->headers->get('PHP_AUTH_USER');
$users = $this->entityTypeManager->getStorage('user')->loadByProperties(array('name' => $authToken));
$user = reset($users);
......@@ -127,21 +113,6 @@ class HelpDesk extends ControllerBase {
], Response::HTTP_FORBIDDEN);
}
//user role validation
$roles = $user->getRoles();
$validRole = false;
foreach ($roles as $role) {
if ($role === "applicant") {
$validRole = true;
break;
}
}
if (!$validRole) {
return $this->respondWithStatus([
'message' => t("User Invalid Role"),
], Response::HTTP_FORBIDDEN);
}
$list = array();
$sCon = $this->connection
......@@ -150,13 +121,7 @@ class HelpDesk extends ControllerBase {
$numApplications = $sCon->countQuery()->execute()->fetchField();
array_push($list, (object) array('name' => "Αριθμός Αιτήσεων (συνολικά)", 'numStudents' => $numApplications));
return $this->respondWithStatus($list, Response::HTTP_OK);
}
}
This diff is collapsed.
......@@ -12,54 +12,51 @@
"typings": "rimraf typings/ && typings install"
},
"devDependencies": {
"@types/d3": "^4.8.0",
"@types/node": "^6.0.48",
"@types/redux-logger": "^3.0.0",
"@types/systemjs": "^0.20.2",
"angular2-router-loader": "^0.3.4",
"angular2-template-loader": "^0.6.0",
"babel-core": "^6.20.0",
"babel-loader": "^6.2.9",
"babel-preset-env": "^1.1.4",
"babel-preset-es2015": "^6.18.0",
"babel-preset-stage-1": "^6.16.0",
"babili-webpack-plugin": "^0.1.1",
"bootstrap-loader": "^2.0.0-beta.20",
"css-loader": "^0.25.0",
"node-sass": "^4.5.0",
"redux-logger": "^2.7.4",
"resolve-url-loader": "^1.6.1",
"sass-loader": "^4.1.1",
"style-loader": "^0.13.1",
"to-string-loader": "^1.1.5",
"tslint": "^3.15.1",
"tslint-loader": "^2.1.5",
"typescript": "^2.0.10",
"url-loader": "^0.5.7",
"webpack": "^1.14.0",
"webpack-cleanup-plugin": "^0.5.1",
"webpack-closure-compiler": "^2.1.4",
"webpack-dashboard": "^0.2.0",
"webpack-dev-server": "^1.16.2"
},
"dependencies": {
"@angular/common": "^2.0.0",
"@angular/compiler": "^2.0.0",
"@angular/core": "^2.0.0",
"@angular/forms": "^2.0.0",
"@angular/http": "^2.0.0",
"@angular/platform-browser": "^2.0.0",
"@angular/platform-browser-dynamic": "^2.0.0",
"@angular/router": "^3.2.0",
"@angular-redux/store": "^6.5.7",
"@angular/animations": "^4.3.1",
"@angular/common": "^4.3.1",
"@angular/compiler": "^4.3.1",
"@angular/compiler-cli": "^4.3.1",
"@angular/core": "^4.3.1",
"@angular/forms": "^4.3.1",
"@angular/http": "^4.3.1",
"@angular/platform-browser": "^4.3.1",
"@angular/platform-browser-dynamic": "^4.3.1",
"@angular/platform-server": "^4.3.1",
"@angular/router": "^4.3.1",
"@ngui/auto-complete": "^0.13.3",
"@types/d3": "^4.10.0",
"@types/file-saver": "0.0.1",
"@types/jquery": "^2.0.41",
"@types/node": "^6.0.60",
"@types/jquery": "^2.0.48",
"@types/node": "^6.0.85",
"@types/node-sass": "^3.10.32",
"babel-polyfill": "^6.20.0",
"babel-core": "^6.25.0",
"babel-loader": "^6.4.1",
"babel-polyfill": "^6.23.0",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-1": "^6.24.1",
"bootstrap": "^4.0.0-alpha.6",
"core-js": "^2.4.1",
"css-loader": "^0.25.0",
"d3": "^4.4.0",
"d3": "^4.10.0",
"es6-promise": "^4.0.5",
"es6-shim": "^0.35.0",
"file-loader": "^0.9.0",
......@@ -68,22 +65,25 @@
"fs-writefile-promise": "^2.0.0",
"html-webpack-plugin": "^2.24.1",
"immutable": "^3.8.1",
"jquery": "^3.1.1",
"mydatepicker": "^2.0.13",
"ng2-redux": "^5.1.0",
"ng2-smart-table": "^0.4.0-5",
"jquery": "^3.2.1",
"mydatepicker": "^2.0.26",
"ng2-smart-table": "^1.2.1",
"ngx-cookie": "^1.0.0",
"ngx-uploader": "^2.2.5",
"raw-loader": "^0.5.1",
"redux": "^3.6.0",
"redux": "^3.7.2",
"redux-logger": "^3.0.6",
"reflect-metadata": "0.1.8",
"rimraf": "^2.4.3",
"roboto-fontface": "^0.7.0",
"roboto-fontface": "^0.7.1",
"rxjs": "^5.0.0-rc.3",
"style-loader": "^0.13.1",
"ts-loader": "^1.2.1",
"typed-immutable-record": "0.0.6",
"typescript": "^2.4.2",
"url-loader": "^0.5.7",
"webpack": "^1.13.3",
"zone.js": ">=0.6.26"
"webpack-closure-compiler": "^2.1.5",
"zone.js": "^0.8.14"
}
}
import { COURSEFIELDS_RECEIVED, COURSEFIELDS_SELECTED_SAVE } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
@Injectable()
export class CourseFieldsActions {
constructor(
private _ngRedux: NgRedux<IAppState>,
private _hds: HelperDataService) {}
getCourseFields = () => {
const { courseFields } = this._ngRedux.getState();
if (courseFields.size === 0) {
return this._hds.getCourseFields().then(courseFields => {
return this._ngRedux.dispatch({
type: COURSEFIELDS_RECEIVED,
payload: {
courseFields
}
});
});
}
};
saveCourseFieldsSelected = (courseFieldsSelected) => {
return this._ngRedux.dispatch({
type: COURSEFIELDS_SELECTED_SAVE,
payload: {
courseFieldsSelected
}
});
};
}
import { CRITERIA_RECEIVED, CRITERIA_SAVE, CRITERIA_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
@Injectable()
export class CriteriaActions {
constructor(
private _ngRedux: NgRedux<IAppState>,
private _hds: HelperDataService) {}
getCriteria = (reload) => {
const { criter } = this._ngRedux.getState();
//if (sectorFields.size === 0) {
if (reload === true || (reload === false && criter.size === 0)) {
return this._hds.getCriteria().then(criteria => {
return this._ngRedux.dispatch({
type: CRITERIA_RECEIVED,
payload: {
criteria
}
});
});
}
};
saveCriteria = (criter) => {
return this._ngRedux.dispatch({
type: CRITERIA_SAVE,
payload: {
criter
}
});
};
initCriteria = () => {
return this._ngRedux.dispatch({
type: CRITERIA_INIT,
payload: {
}
});
};
}
import { EPALCLASSES_SAVE } from '../constants';
import { EPALCLASSES_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { IAppState } from '../store';
import { NgRedux } from "@angular-redux/store";
import { Injectable } from "@angular/core";
import { EPALCLASSES_SAVE } from "../constants";
import { EPALCLASSES_INIT } from "../constants";
import { IAppState } from "../store";
@Injectable()
export class EpalClassesActions {
constructor(
private _ngRedux: NgRedux<IAppState>) {}
private _ngRedux: NgRedux<IAppState>) { }
saveEpalClassesSelected = (epalClasses) => {
return this._ngRedux.dispatch({
......
import { CourseFieldsActions } from './coursefields.actions';
import { SectorFieldsActions } from './sectorfields.actions';
import { RegionSchoolsActions } from './regionschools.actions';
import { SectorCoursesActions } from './sectorcourses.actions';
import { StudentDataFieldsActions } from './studentdatafields.actions';
import { EpalClassesActions } from './epalclass.actions';
import { LoginInfoActions} from './logininfo.actions';
import { CriteriaActions} from './criteria.actions';
import { SectorFieldsActions } from "./sectorfields.actions";
import { RegionSchoolsActions } from "./regionschools.actions";
import { SectorCoursesActions } from "./sectorcourses.actions";
import { StudentDataFieldsActions } from "./studentdatafields.actions";
import { EpalClassesActions } from "./epalclass.actions";
import { LoginInfoActions } from "./logininfo.actions";
const ACTION_PROVIDERS = [ CourseFieldsActions, SectorFieldsActions, RegionSchoolsActions, SectorCoursesActions, StudentDataFieldsActions,
EpalClassesActions, LoginInfoActions, CriteriaActions];
const ACTION_PROVIDERS = [
SectorFieldsActions,
RegionSchoolsActions,
SectorCoursesActions,
StudentDataFieldsActions,
EpalClassesActions,
LoginInfoActions
];
export {
CourseFieldsActions,
SectorFieldsActions,
RegionSchoolsActions,
SectorCoursesActions,
StudentDataFieldsActions,
EpalClassesActions,
LoginInfoActions,
CriteriaActions,
ACTION_PROVIDERS,
};
import { LOGININFO_SAVE, PROFILE_SAVE, LOGININFO_RECEIVED, STATEMENTAGREE_SAVE } from '../constants';
import { LOGININFO_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
import { NgRedux } from "@angular-redux/store";
import { Injectable } from "@angular/core";
import { LOGININFO_SAVE, PROFILE_SAVE, STATEMENTAGREE_SAVE } from "../constants";
import { LOGININFO_INIT } from "../constants";
import { HelperDataService } from "../services/helper-data-service";
import { IAppState } from "../store";
@Injectable()
export class LoginInfoActions {
constructor(
private _ngRedux: NgRedux<IAppState>,
private _hds: HelperDataService) {}
private _hds: HelperDataService) { }
getloginInfo = (loginInfo) => {
return this._hds.getCurrentUser(loginInfo.auth_token, loginInfo.auth_role).then (loginInfos => {
return this._hds.getCurrentUser(loginInfo.auth_token, loginInfo.auth_role).then(loginInfos => {
return this._ngRedux.dispatch({
type: LOGININFO_SAVE,
payload: {
......@@ -21,7 +22,7 @@ export class LoginInfoActions {
}
});
});
}
}
saveMinEduloginInfo = (loginInfos) => {
return this._ngRedux.dispatch({
......@@ -30,25 +31,25 @@ export class LoginInfoActions {
loginInfos
}
});
};
};
saveProfile = (profile) => {
saveProfile = (profile) => {
return this._ngRedux.dispatch({
type: PROFILE_SAVE,
payload: {
profile
}
});
};
};
saveStatementAgree = (disclaimer_checked) => {
saveStatementAgree = (disclaimer_checked) => {
return this._ngRedux.dispatch({
type: STATEMENTAGREE_SAVE,
payload: {
disclaimer_checked
}
});
};
};
initLoginInfo = () => {
......
import { REGIONSCHOOLS_RECEIVED, REGIONSCHOOLS_SELECTED_SAVE, REGIONSCHOOLS_ORDER_SAVE, REGIONSCHOOLS_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
import { NgRedux } from "@angular-redux/store";
import { Injectable } from "@angular/core";
import {
REGIONSCHOOLS_INIT,
REGIONSCHOOLS_ORDER_SAVE,
REGIONSCHOOLS_RECEIVED,
REGIONSCHOOLS_SELECTED_SAVE,
} from "../constants";
import { HelperDataService } from "../services/helper-data-service";
import { IAppState } from "../store";
@Injectable()
export class RegionSchoolsActions {
constructor(
private _ngRedux: NgRedux<IAppState>,
private _hds: HelperDataService) {}
private _hds: HelperDataService) { }
getRegionSchools = (classActive,courseActive, reload) => {
getRegionSchools = (classActive, courseActive, reload) => {
const { regions } = this._ngRedux.getState();
if (reload === true || (reload === false && regions.size === 0)) {
return this._hds.getRegionsWithSchools(classActive,courseActive).then(regions => {
return this._hds.getRegionsWithSchools(classActive, courseActive).then(regions => {
return this._ngRedux.dispatch({
type: REGIONSCHOOLS_RECEIVED,
payload: {
......@@ -32,22 +38,6 @@ export class RegionSchoolsActions {
});
};
/*
getRegionSchools_Reload = (courseActive) => {
const { regions } = this._ngRedux.getState();
//if (regions.size === 0) {
return this._hds.getRegionsWithSchools(courseActive).then(regions => {
return this._ngRedux.dispatch({
type: REGIONSCHOOLS_RECEIVED,
payload: {
regions
}
});
});
//}
};
*/
saveRegionSchoolsSelected = (checked, i, j) => {
return this._ngRedux.dispatch({
type: REGIONSCHOOLS_SELECTED_SAVE,
......
import { SECTORCOURSES_RECEIVED, SECTORCOURSES_SELECTED_SAVE, SECTORCOURSES_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
import { NgRedux } from "@angular-redux/store";
import { Injectable } from "@angular/core";
import { SECTORCOURSES_INIT, SECTORCOURSES_RECEIVED, SECTORCOURSES_SELECTED_SAVE } from "../constants";
import { HelperDataService } from "../services/helper-data-service";
import { IAppState } from "../store";
@Injectable()
export class SectorCoursesActions {
constructor(
private _ngRedux: NgRedux<IAppState>,
private _hds: HelperDataService) {}
private _hds: HelperDataService) { }
getSectorCourses = (reload) => {
const { sectors } = this._ngRedux.getState();
//if (sectors.size === 0) {
// if (sectors.size === 0) {
if (reload === true || (reload === false && sectors.size === 0)) {
return this._hds.getSectorsWithCourses().then(sectors => {
return this._ngRedux.dispatch({
......@@ -33,28 +34,15 @@ export class SectorCoursesActions {
});
};
/*
getSectorCourses_Reload = () => {
const { sectors } = this._ngRedux.getState();
//if (sectors.size === 0) {
return this._hds.getSectorsWithCourses().then(sectors => {
return this._ngRedux.dispatch({
type: SECTORCOURSES_RECEIVED,
payload: {
sectors
}
});
});
//}
};
*/
saveSectorCoursesSelected = (sectorCoursesSelected,sectorSelected) => {
saveSectorCoursesSelected = (oldSIndex, oldCIndex, checked, i, j) => {
return this._ngRedux.dispatch({
type: SECTORCOURSES_SELECTED_SAVE,
payload: {
sectorCoursesSelected,
sectorSelected
oldSIndex: oldSIndex,
oldCIndex: oldCIndex,
checked: checked,
sIndex: i,
cIndex: j
}
});
};
......
import { SECTORFIELDS_RECEIVED, SECTORFIELDS_SELECTED_SAVE, SECTORFIELDS_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { IAppState } from '../store';
import { HelperDataService } from '../services/helper-data-service';
import { NgRedux } from "@angular-redux/store";
import { Injectable } from "@angular/core";
import { SECTORFIELDS_INIT, SECTORFIELDS_RECEIVED, SECTORFIELDS_SELECTED_SAVE } from "../constants";
import { HelperDataService } from "../services/helper-data-service";
import { IAppState } from "../store";
@Injectable()
export class SectorFieldsActions {
......@@ -12,7 +13,7 @@ export class SectorFieldsActions {
getSectorFields = (reload) => {
const { sectorFields } = this._ngRedux.getState();
//if (sectorFields.size === 0) {
// if (sectorFields.size === 0) {
if (reload === true || (reload === false && sectorFields.size === 0)) {
return this._hds.getSectorFields().then(sectorFields => {
return this._ngRedux.dispatch({
......@@ -34,11 +35,12 @@ export class SectorFieldsActions {
};
saveSectorFieldsSelected = (sectorFieldsSelected) => {
saveSectorFieldsSelected = (prevChoice: number, newChoice: number) => {
return this._ngRedux.dispatch({
type: SECTORFIELDS_SELECTED_SAVE,
payload: {
sectorFieldsSelected
prevChoice: prevChoice,
newChoice: newChoice
}
});
};
......
import { STUDENTDATAFIELDS_SAVE, STUDENTDATAFIELDS_INIT } from '../constants';
import { Injectable } from '@angular/core';
import { NgRedux } from 'ng2-redux';
import { IAppState } from '../store';
//import { UserDataService } from '../services/user-data-service';
import { NgRedux } from "@angular-redux/store";
import { Injectable } from "@angular/core";
import { STUDENTDATAFIELDS_INIT, STUDENTDATAFIELDS_SAVE } from "../constants";
import { IAppState } from "../store";
@Injectable()
export class StudentDataFieldsActions {
constructor(
private _ngRedux: NgRedux<IAppState>) {}
private _ngRedux: NgRedux<IAppState>) { }
saveStudentDataFields = (studentDataFields) => {
......@@ -17,7 +16,6 @@ export class StudentDataFieldsActions {
payload: {
studentDataFields
}
});
};
......
import { RouterModule } from '@angular/router';
import { RouterModule } from "@angular/router";
import { MainRoutes, MainDeclarations }
from './containers/main.routes';
import { MainDeclarations, MainRoutes } from "./containers/main.routes";
export const routes = [
...MainRoutes
......
export const API_ENDPOINT = '';
export const API_ENDPOINT_PARAMS = '';
export const API_ENDPOINT = "";
export const API_ENDPOINT_PARAMS = "";
export class AppSettings {
public static get API_ENDPOINT(): string {
return '';
return "";
}
public static get API_ENDPOINT_PARAMS(): string {
return '';
return "";
}
}
import 'reflect-metadata';
import 'babel-polyfill';
import 'core-js/es6';
import 'core-js/es7/reflect';
import { NgModule } from '@angular/core';
import { NgReduxModule, DevToolsExtension, NgRedux } from 'ng2-redux';
import {BrowserModule} from '@angular/platform-browser';
import { CookieModule } from 'ngx-cookie';