Compare commits

...

3 Commits

Author SHA1 Message Date
HardiReady 5f1686c64e refactor package structure for statistics 2018-04-29 10:07:20 +02:00
HardiReady 20f92ce1e9 Change signup PN hyperlink (CC-21) 2018-04-29 09:53:51 +02:00
HardiReady 0bf730e0d4 Fix code style 2018-04-29 09:51:28 +02:00
33 changed files with 49 additions and 50 deletions

View File

@ -4,7 +4,7 @@
###-------------------------------------------------------------###
###------------------- HOW TO USE THIS FILE --------------------###
###-------------------------------------------------------------###
### 1. start express server with `npm run start-test` ###
### 1. start express server with `npm run start-api-test` ###
### 2. import data by executing script: `./populate-data.sh` ###
### 3. change data in app as you need for tests ###
### 4. export data state with: `./populate-data.sh -m save` ###

View File

@ -66,14 +66,14 @@ campaigns.route('/:id')
}
req.body.updatedAt = new Date();
req.body.$inc = { __v: 1 };
req.body.$inc = {__v: 1};
if (req.body.hasOwnProperty('__v')) {
delete req.body.__v;
}
// PATCH is easier with mongoose than PUT. You simply update by all data that comes from outside. no need to
// reset attributes that are missing.
CampaignModel.findByIdAndUpdate(req.params.id, req.body, { new: true }, (err, item) => {
CampaignModel.findByIdAndUpdate(req.params.id, req.body, {new: true}, (err, item) => {
if (err) {
err.status = codes.wrongrequest;
} else if (!item) {
@ -96,7 +96,7 @@ campaigns.route('/:id')
err.status = codes.notfound;
return next(err);
}
WarModel.find({ campaign: req.params.id }).remove().exec();
WarModel.find({campaign: req.params.id}).remove().exec();
// TODO: remove all the war logs from fs here!!!
res.locals.processed = true;
next();

View File

@ -1,7 +1,6 @@
<code_scheme name="OPT-CC" version="173">
<option name="FORMATTER_TAGS_ENABLED" value="true" />
<JSCodeStyleSettings>
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="USE_CHAINED_CALLS_GROUP_INDENTS" value="true" />
</JSCodeStyleSettings>
<TypeScriptCodeStyleSettings>

View File

@ -5,7 +5,7 @@
<p>Dieses Formular nur ausfüllen wenn du einer <b>HL</b> angehörst oder <b>SQL</b> bist. Dabei den Nutzernamen aus
dem OPT Forum verwenden!
Im Forum eine Nachricht an <a href="https://opt-dev.de/dashboard/index.php?conversation-add/&userID=9"
Im Forum eine Nachricht an <a href="https://operation-pandora.com/dashboard/index.php?conversation-add/&userID=9"
target="_blank">HardiReady</a>
senden, in welcher der 'geheime Text' steht, den du bei der Registrierung nutzt.<br>
Dabei kann es sich um irgend eine willkürliche Zeichenfolge oder einen Satz handeln - dient nur dem Abgleich.

View File

@ -1,14 +1,14 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {CampaignPlayer} from '../../models/model-interfaces';
import {PlayerService} from '../../services/logs/player.service';
import {ChartUtils} from '../../utils/chart-utils';
import {CampaignPlayer} from '../../../models/model-interfaces';
import {PlayerService} from '../../../services/logs/player.service';
import {ChartUtils} from '../../../utils/chart-utils';
@Component({
selector: 'campaign-player-detail',
templateUrl: './campaign-player-detail.component.html',
styleUrls: ['./campaign-player-detail.component.css', '../../style/list-entry.css',
'../../style/hide-scrollbar.css', '../../style/overview.css']
styleUrls: ['./campaign-player-detail.component.css', '../../../style/list-entry.css',
'../../../style/hide-scrollbar.css', '../../../style/overview.css']
})
export class CampaignPlayerDetailComponent implements OnInit {

View File

@ -2,14 +2,14 @@ import {Component, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {NgForm} from '@angular/forms';
import {Subscription} from 'rxjs/Subscription';
import {Campaign} from '../../models/model-interfaces';
import {CampaignService} from '../../services/logs/campaign.service';
import {Campaign} from '../../../models/model-interfaces';
import {CampaignService} from '../../../services/logs/campaign.service';
@Component({
selector: 'campaign-submit',
templateUrl: './campaign-submit.component.html',
styleUrls: ['./campaign-submit.component.css', '../../style/entry-form.css', '../../style/overview.css']
styleUrls: ['./campaign-submit.component.css', '../../../style/entry-form.css', '../../../style/overview.css']
})
export class CampaignSubmitComponent {
@ -41,7 +41,7 @@ export class CampaignSubmitComponent {
.subscribe(campaign => {
let redirectSuccessUrl = '../overview/';
if (this.campaign._id) {
redirectSuccessUrl = '../' + redirectSuccessUrl
redirectSuccessUrl = '../' + redirectSuccessUrl;
}
this.router.navigate([redirectSuccessUrl + campaign._id], {relativeTo: this.route});
},

View File

@ -1,17 +1,17 @@
import {Component, Input, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {PlayerService} from '../../services/logs/player.service';
import {CampaignService} from '../../services/logs/campaign.service';
import {Fraction} from '../../utils/fraction.enum';
import {PlayerService} from '../../../services/logs/player.service';
import {CampaignService} from '../../../services/logs/campaign.service';
import {Fraction} from '../../../utils/fraction.enum';
import {FormControl} from '@angular/forms';
import {Observable} from 'rxjs/Observable';
import {Player} from '../../models/model-interfaces';
import {Player} from '../../../models/model-interfaces';
@Component({
selector: 'stats-highscore',
templateUrl: './highscore.component.html',
styleUrls: ['./highscore.component.css', '../../style/list-entry.css', '../../style/overview.css']
styleUrls: ['./highscore.component.css', '../../../style/list-entry.css', '../../../style/overview.css']
})
export class StatisticHighScoreComponent implements OnInit {

View File

@ -1,14 +1,14 @@
import {Component, Input, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {CampaignService} from '../../services/logs/campaign.service';
import {ChartUtils} from '../../utils/chart-utils';
import {Fraction} from '../../utils/fraction.enum';
import {CampaignService} from '../../../services/logs/campaign.service';
import {ChartUtils} from '../../../utils/chart-utils';
import {Fraction} from '../../../utils/fraction.enum';
@Component({
selector: 'stats-overview',
templateUrl: './stats-overview.component.html',
styleUrls: ['./stats-overview.component.css', '../../style/list-entry.css', '../../style/overview.css']
styleUrls: ['./stats-overview.component.css', '../../../style/list-entry.css', '../../../style/overview.css']
})
export class StatisticOverviewComponent implements OnInit {

View File

@ -1,16 +1,16 @@
import {RouterModule, Routes} from '@angular/router';
import {StatisticComponent} from './stats.component';
import {WarListComponent} from './war-list/war-list.component';
import {StatisticOverviewComponent} from './overview/stats-overview.component';
import {WarItemComponent} from './war-list/war-item.component';
import {WarListComponent} from './war/war-list/war-list.component';
import {StatisticOverviewComponent} from './campaign/overview/stats-overview.component';
import {WarItemComponent} from './war/war-list/war-item.component';
import {ModuleWithProviders} from '@angular/core';
import {CampaignSubmitComponent} from './campaign-submit/campaign-submit.component';
import {CampaignPlayerDetailComponent} from './campaign-player-detail/campaign-player-detail.component';
import {WarDetailComponent} from './war-detail/war-detail.component';
import {ScoreboardComponent} from './war-detail/scoreboard/scoreboard.component';
import {CampaignSubmitComponent} from './campaign/campaign-submit/campaign-submit.component';
import {CampaignPlayerDetailComponent} from './campaign/campaign-player-detail/campaign-player-detail.component';
import {WarDetailComponent} from './war/war-detail/war-detail.component';
import {ScoreboardComponent} from './war/scoreboard/scoreboard.component';
import {WarSubmitComponent} from './war-submit/war-submit.component';
import {FractionStatsComponent} from './war-detail/fraction-stats/fraction-stats.component';
import {StatisticHighScoreComponent} from './highscore/highscore.component';
import {FractionStatsComponent} from './war/fraction-stats/fraction-stats.component';
import {StatisticHighScoreComponent} from './campaign/highscore/highscore.component';
export const statsRoutes: Routes = [{

View File

@ -38,7 +38,7 @@ export class WarSubmitComponent {
fileChange(event) {
if (this.validExtensions.filter(ext => event.target.files[0] &&
event.target.files[0].name.endsWith(ext)).length == 1) {
event.target.files[0].name.endsWith(ext)).length === 1) {
this.showFileError = false;
this.fileList = event.target.files;
} else {

View File

@ -1,17 +1,17 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {WarService} from '../../services/logs/war.service';
import {War} from '../../models/model-interfaces';
import {ChartUtils} from '../../utils/chart-utils';
import {Fraction} from '../../utils/fraction.enum';
import {LogsService} from '../../services/logs/logs.service';
import {ScoreboardComponent} from './scoreboard/scoreboard.component';
import {WarService} from '../../../services/logs/war.service';
import {War} from '../../../models/model-interfaces';
import {ChartUtils} from '../../../utils/chart-utils';
import {Fraction} from '../../../utils/fraction.enum';
import {LogsService} from '../../../services/logs/logs.service';
import {ScoreboardComponent} from '../scoreboard/scoreboard.component';
@Component({
selector: 'war-detail',
templateUrl: './war-detail.component.html',
styleUrls: ['./war-detail.component.css', '../../style/list-entry.css', '../../style/hide-scrollbar.css']
styleUrls: ['./war-detail.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
})
export class WarDetailComponent implements OnInit {

View File

@ -1,11 +1,11 @@
import {ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {War} from '../../models/model-interfaces';
import {LoginService} from '../../services/app-user-service/login-service';
import {War} from '../../../models/model-interfaces';
import {LoginService} from '../../../services/app-user-service/login-service';
@Component({
selector: 'pjm-war-item',
templateUrl: './war-item.component.html',
styleUrls: ['./war-item.component.css', '../../style/list-entry.css'],
styleUrls: ['./war-item.component.css', '../../../style/list-entry.css'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class WarItemComponent implements OnInit {

View File

@ -1,15 +1,15 @@
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {Campaign, War} from '../../models/model-interfaces';
import {WarService} from '../../services/logs/war.service';
import {LoginService} from '../../services/app-user-service/login-service';
import {CampaignService} from '../../services/logs/campaign.service';
import {RouteConfig} from '../../app.config';
import {Campaign, War} from '../../../models/model-interfaces';
import {WarService} from '../../../services/logs/war.service';
import {LoginService} from '../../../services/app-user-service/login-service';
import {CampaignService} from '../../../services/logs/campaign.service';
import {RouteConfig} from '../../../app.config';
@Component({
selector: 'war-list',
templateUrl: './war-list.component.html',
styleUrls: ['./war-list.component.css', '../../style/list-entry.css', '../../style/select-list.css']
styleUrls: ['./war-list.component.css', '../../../style/list-entry.css', '../../../style/select-list.css']
})
export class WarListComponent implements OnInit {