Further work #3

This commit is contained in:
Lukas Obermann
2017-01-07 21:26:01 +13:00
parent 30e11e9d4d
commit 9259e02e02
90 changed files with 2258 additions and 2646 deletions
+1588 -1770
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
@@ -1,11 +1,11 @@
import * as ActionTypes from '../constants/ActionTypes';
import ActionTypes from '../constants/ActionTypes';
import alert from '../utils/alert';
import AppDispatcher from '../dispatcher/AppDispatcher';
import WebAPIUtils from '../utils/WebAPIUtils';
export async function register(email: string, name: string, displayName: string, password: string) {
AppDispatcher.dispatch({
type: ActionTypes.REGISTER,
type: ActionTypes.WAIT_START,
status: 'pending',
statusMessage: 'Registrierung wird durchgeführt'
});
@@ -31,7 +31,7 @@ export async function register(email: string, name: string, displayName: string,
alert('Benutzername und Email-Adresse bereits vorhanden', 'Sowohl die E-Mail-Adresse als auch der Benutzername werden bereits verwendet.');
}
AppDispatcher.dispatch({
type: ActionTypes.REGISTER,
type: ActionTypes.REGISTRATION_SUCCESS,
status: 'success'
});
}
@@ -39,7 +39,7 @@ export async function register(email: string, name: string, displayName: string,
catch (e) {
WebAPIUtils.connectionError(e);
AppDispatcher.dispatch({
type: ActionTypes.REGISTER,
type: ActionTypes.REGISTRATION_SUCCESS,
error: e,
status: 'error'
});
+66
View File
@@ -0,0 +1,66 @@
import AppDispatcher from '../dispatcher/AppDispatcher';
import ActionTypes from '../constants/ActionTypes';
import createOverlay from '../utils/createOverlay';
import ELStore from '../stores/ELStore';
import HeroCreation from '../views/herolist/HeroCreation';
import React from 'react';
import alert from '../utils/alert';
import WebAPIUtils from '../utils/WebAPIUtils';
export default {
refresh(): void {
WebAPIUtils.getHeroes();
},
filter(text: string): void {
AppDispatcher.dispatch({
type: ActionTypes.FILTER_HEROLIST,
text
});
},
sort(option: string): void {
AppDispatcher.dispatch({
type: ActionTypes.SORT_HEROLIST,
option
});
},
changeView(view: string): void {
AppDispatcher.dispatch({
type: ActionTypes.CHANGE_HEROLIST_VIEW,
view
});
},
load(id: string): void {
if (ELStore.getStartID() !== 'EL_0') {
alert(
'Nicht gespeicherter Held',
'Du hast offenbar bereits einen Helden geöffnet, der noch nicht vollständig gespeichert wurde. Möchtest du trotzdem fortfahren oder vorher den anderen Helden speichern, damit keine Änderungen verloren gehen?',
[
{
label: 'Laden',
onClick: this.loadFx.bind(null, id)
},
{
label: 'Abbrechen'
}
]
);
} else {
this.loadFx(id);
}
},
loadFx(id: string): void {
AppDispatcher.dispatch({
type: ActionTypes.CLEAR_HERO
});
WebAPIUtils.loadHero(id);
},
createNewHero(options: Object): void {
AppDispatcher.dispatch({
type: ActionTypes.CREATE_NEW_HERO,
...options
});
},
save(): void {
}
};
+28
View File
@@ -0,0 +1,28 @@
import AppDispatcher from '../dispatcher/AppDispatcher';
import ActionTypes from '../constants/ActionTypes';
export default {
selectRace(raceID: string): void {
AppDispatcher.dispatch({
type: ActionTypes.SELECT_RACE,
raceID
});
},
filter(text: string): void {
AppDispatcher.dispatch({
type: ActionTypes.FILTER_RACES,
text
});
},
sort(option: string): void {
AppDispatcher.dispatch({
type: ActionTypes.SORT_RACES,
option
});
},
changeValueVisibility(): void {
AppDispatcher.dispatch({
type: ActionTypes.CHANGE_RACE_VALUE_VISIBILITY
});
}
};
+205
View File
@@ -0,0 +1,205 @@
import ActionTypes from '../constants/ActionTypes';
import alert from '../utils/alert';
import AppDispatcher from '../dispatcher/AppDispatcher';
import HerolistStore from '../stores/HerolistStore';
export default {
startLoading(): void {
AppDispatcher.dispatch({
type: ActionTypes.WAIT_START
});
},
runtimeError(): void {
alert('Da hat etwas nicht geklappt', 'Dies darf nicht passieren! Melde dies bitte als Fehler! Wir versuchen, das Problem schnellstmöglich zu beheben!');
AppDispatcher.dispatch({
type: ActionTypes.WAIT_END
});
},
connectionError(error: Error): void {
alert('Verbindung nicht möglich', 'Die App konnte keine Verbindung zum Server herstellen. Bitte überprüfe deine Internetverbindung! ' + JSON.stringify(error) + ' Es kann bei diesem Problem auch möglich sein, dass etwas im Programmablauf nicht stimmt. Informiere uns bitte über dein Problem, sollte es deiner Erkenntnis nach nicht an der Verbindung liegen!');
AppDispatcher.dispatch({
type: ActionTypes.WAIT_END
});
},
receiveLists(raw: Object): void {
AppDispatcher.dispatch({
type: ActionTypes.RECEIVE_RAW_LISTS,
...raw
});
},
registrationSuccess(): void {
alert('Konto bestätigen', 'Wir haben dir eine E-Mail an die angegebene Adresse geschickt. Dort wirst du einen Bestätigungslink finden, dem du einfach nur zu folgen brauchst, um dein Konto zu aktivieren.');
AppDispatcher.dispatch({
type: ActionTypes.REGISTRATION_SUCCESS
});
},
forgotPasswordSuccess(callback: string): void {
switch (callback) {
case 'false':
alert('E-Mail nicht vorhanden', 'Die eingegebene E-Mail-Adresse ist nicht registriert.');
AppDispatcher.dispatch({
type: ActionTypes.WAIT_END
});
break;
default:
alert('E-Mail erfolgreich verschickt', 'Du kannst jetzt in dein Postfach schauen; wir haben dir die E-Mail mit dem Link zum Zurücksetzen deines Passworts geschickt!');
AppDispatcher.dispatch({
type: ActionTypes.WAIT_END
});
break;
}
},
forgotUsernameSuccess(callback: string): void {
switch (callback) {
case 'false':
alert('E-Mail nicht vorhanden', 'Die eingegebene E-Mail-Adresse ist nicht registriert.');
AppDispatcher.dispatch({
type: ActionTypes.WAIT_END
});
break;
default:
alert('E-Mail erfolgreich verschickt', 'Du kannst jetzt in dein Postfach schauen; wir haben dir die E-Mail mit deinem Benutzernamen geschickt!');
AppDispatcher.dispatch({
type: ActionTypes.WAIT_END
});
break;
}
},
resendActivationSuccess(callback: string): void {
switch (callback) {
case 'false':
this.runtimeError();
break;
default:
alert('E-Mail erfolgreich verschickt', 'Du kannst jetzt in dein Postfach schauen; wir haben dir die Aktivierungsemail erneut geschickt!');
AppDispatcher.dispatch({
type: ActionTypes.WAIT_END
});
break;
}
},
receiveAccount(callback: string, name: string): void {
switch (callback) {
case 'false':
alert('Anmeldeversuch fehlgeschlagen', 'Die eigegebene Kombination aus Benutzername und Passwort wurde nicht erkannt. Stelle sicher, dass du dich nicht vertippt hast und versuche es nochmal.');
AppDispatcher.dispatch({
type: ActionTypes.WAIT_END
});
break;
case 'notactive':
alert('Benutzerkonto nicht aktiviert', 'Das hinterlegte Benutzerkonto wurde noch nicht aktivert. Bitte aktiviere das Konto über den Aktivierungslink in der Aktivierungsemail.');
AppDispatcher.dispatch({
type: ActionTypes.WAIT_END
});
break;
case 'logged':
alert('Benutzer bereits angemeldet', 'Das Konto ist momentan an einem anderen Ort (Gerät oder Browser) angemeldet. Es kann nicht mehrere Male auf ein Konto zugegriffen werden.');
AppDispatcher.dispatch({
type: ActionTypes.WAIT_END
});
break;
default: {
// let [ id, heroes ] = JSON.parse(callback);
let id = parseInt(callback);
let heroes = [];
AppDispatcher.dispatch({
type: ActionTypes.RECEIVE_ACCOUNT,
id, name, heroes
});
}
}
},
logoutSuccess(): void {
AppDispatcher.dispatch({
type: ActionTypes.LOGOUT_SUCCESS
});
},
changeUsernameSuccess(callback: string, name: string): void {
switch (callback) {
case 'false':
this.runtimeError();
break;
default:
alert('Passwort erfolgreich geändert', 'Dein Passwort wurde erfolgreich geändert.');
AppDispatcher.dispatch({
type: ActionTypes.ACCOUNTNAME_CHANGE_SUCCESS,
name
});
break;
}
},
changePasswordSuccess(callback: string): void {
switch (callback) {
case 'false':
this.runtimeError();
break;
default:
alert('Passwort erfolgreich geändert', 'Dein Passwort wurde erfolgreich geändert.');
AppDispatcher.dispatch({
type: ActionTypes.PASSWORD_CHANGE_SUCCESS
});
break;
}
},
deleteAccountSuccess(callback: string): void {
switch (callback) {
case 'false':
this.runtimeError();
break;
default:
alert('Konto gelöscht', 'Dein Konto wurde mitsamt aller Helden und Gruppen erfolgreich gelöscht.');
AppDispatcher.dispatch({
type: ActionTypes.CLEAR_ACCOUNT
});
break;
}
},
herolistRefreshSuccess(rawHeroes: string): void {
switch (rawHeroes) {
case 'false':
this.runtimeError();
break;
default:
AppDispatcher.dispatch({
type: ActionTypes.RECEIVE_RAW_HEROLIST,
rawHeroes
});
break;
}
},
loadHeroSuccess(id: string, data: string): void {
var short = HerolistStore.get(id);
data = JSON.parse(data);
AppDispatcher.dispatch({
type: ActionTypes.RECEIVE_HERO,
...(Object.assign({}, short, data))
});
},
saveHeroSuccess(): void {
AppDispatcher.dispatch({
type: ActionTypes.SAVE_HERO_SUCCESS
});
},
changeHeroAvatarSuccess(url: string): void {
switch (url) {
case 'false':
this.runtimeError();
break;
default:
AppDispatcher.dispatch({
type: ActionTypes.UPDATE_HERO_AVATAR,
url
});
break;
}
}
};
+17
View File
@@ -0,0 +1,17 @@
import AppDispatcher from '../dispatcher/AppDispatcher';
import ActionTypes from '../constants/ActionTypes';
export default {
showTab(tab: string): void {
AppDispatcher.dispatch({
type: ActionTypes.SHOW_TAB,
tab
});
},
showSection(section: string): void {
AppDispatcher.dispatch({
type: ActionTypes.SHOW_TAB_SECTION,
section
});
}
};
+34
View File
@@ -0,0 +1,34 @@
import AppDispatcher from '../dispatcher/AppDispatcher';
import ActionTypes from '../constants/ActionTypes';
export default {
filter(text: string): void {
AppDispatcher.dispatch({
type: ActionTypes.FILTER_TALENTS,
text
});
},
sort(option: string): void {
AppDispatcher.dispatch({
type: ActionTypes.SORT_TALENTS,
option
});
},
changeTalentRating(): void {
AppDispatcher.dispatch({
type: ActionTypes.CHANGE_TALENT_RATING
});
},
addPoint(id: string): void {
AppDispatcher.dispatch({
type: ActionTypes.ADD_TALENT_POINT,
id
});
},
removePoint(id: string): void {
AppDispatcher.dispatch({
type: ActionTypes.REMOVE_TALENT_POINT,
id
});
}
};
-14
View File
@@ -1,14 +0,0 @@
"use strict";
var ActionTypes = require("../constants/ActionTypes");
exports.login = function (name, displayName, email, sessionToken) { return ({
type: ActionTypes.LOGIN,
payload: {
name: name,
displayName: displayName,
email: email,
sessionToken: sessionToken
}
}); };
exports.logout = function (tab) { return ({
type: ActionTypes.LOGOUT
}); };
+2 -2
View File
@@ -12,7 +12,7 @@ export interface LoginAction {
};
}
export const login = (name: string, displayName: string, email: string, sessionToken: string, heroes: RawHerolist) => ({
export const login = (name: string, displayName: string, email: string, sessionToken: string, heroes: RawHerolist): LoginAction => ({
type: ActionTypes.RECEIVE_LOGIN,
payload: {
name,
@@ -27,6 +27,6 @@ export interface LogoutAction {
type: ActionTypes.RECEIVE_LOGOUT;
}
export const logout = () => ({
export const logout = (): LogoutAction => ({
type: ActionTypes.RECEIVE_LOGOUT
});
+9 -69
View File
@@ -1,7 +1,5 @@
import AppDispatcher from '../dispatcher/AppDispatcher';
import * as ActionTypes from '../constants/ActionTypes';
import createOverlay from '../utils/createOverlay';
import ELStore from '../stores/ELStore';
import HeroCreation from '../views/herolist/HeroCreation';
import React from 'react';
import alert from '../utils/alert';
@@ -39,29 +37,29 @@ export interface RawHerolist {
export const request = () => WebAPIUtils.getHeroes();
export interface SortHerolistAction {
type: ActionTypes.SORT_HEROLIST;
export interface SetHerolistSortOrderAction {
type: ActionTypes.SET_HEROLIST_SORT_ORDER;
payload: {
sortOrder: string;
};
}
export const sort = (sortOrder: string): SortHerolistAction => ({
type: ActionTypes.SORT_HEROLIST,
export const setHerolistSortOrder = (sortOrder: string): SetHerolistSortOrderAction => ({
type: ActionTypes.SET_HEROLIST_SORT_ORDER,
payload: {
sortOrder
}
});
export interface FilterHerolistAction {
type: ActionTypes.FILTER_HEROLIST;
export interface SetHerolistVisibilityFilterAction {
type: ActionTypes.SET_HEROLIST_VISIBILITY_FILTER;
payload: {
filterOption: string;
};
}
export const filter = (filterOption: string): FilterHerolistAction => ({
type: ActionTypes.FILTER_HEROLIST,
export const setHerolistVisibilityFilter = (filterOption: string): SetHerolistVisibilityFilterAction => ({
type: ActionTypes.SET_HEROLIST_VISIBILITY_FILTER,
payload: {
filterOption
}
@@ -74,67 +72,9 @@ export interface ReceiveHerolistAction {
};
}
export const receive = (heroes: RawHerolist): ReceiveHerolistAction => ({
export const receiveHerolist = (heroes: RawHerolist): ReceiveHerolistAction => ({
type: ActionTypes.RECEIVE_HEROLIST,
payload: {
heroes
}
});
export default {
refresh(): void {
WebAPIUtils.getHeroes();
},
filter(text: string): void {
AppDispatcher.dispatch({
type: ActionTypes.FILTER_HEROLIST,
text
});
},
sort(option: string): void {
AppDispatcher.dispatch({
type: ActionTypes.SORT_HEROLIST,
option
});
},
changeView(view: string): void {
AppDispatcher.dispatch({
type: 'CHANGE_HEROLIST_VIEW',
view
});
},
load(id: string): void {
if (ELStore.getStartID() !== 'EL_0') {
alert(
'Nicht gespeicherter Held',
'Du hast offenbar bereits einen Helden geöffnet, der noch nicht vollständig gespeichert wurde. Möchtest du trotzdem fortfahren oder vorher den anderen Helden speichern, damit keine Änderungen verloren gehen?',
[
{
label: 'Laden',
onClick: this.loadFx.bind(null, id)
},
{
label: 'Abbrechen'
}
]
);
} else {
this.loadFx(id);
}
},
loadFx(id: string): void {
AppDispatcher.dispatch({
type: 'CLEAR_HERO'
});
WebAPIUtils.loadHero(id);
},
createNewHero(options: Object): void {
AppDispatcher.dispatch({
type: 'CREATE_NEW_HERO',
...options
});
},
save(): void {
}
};
+31
View File
@@ -0,0 +1,31 @@
import * as ActionTypes from '../constants/ActionTypes';
export interface SetSectionAction {
type: ActionTypes.SET_SECTION;
payload: {
section: 'main' | 'hero' | 'group';
tab?: string;
};
}
export const setSection = (section: 'main' | 'hero' | 'group', tab?: string): SetSectionAction => ({
type: ActionTypes.SET_SECTION,
payload: {
section,
tab
}
});
export interface SetTabAction {
type: ActionTypes.SET_TAB;
payload: {
tab: string;
};
}
export const setTab = (tab: string): SetTabAction => ({
type: ActionTypes.SET_TAB,
payload: {
tab
}
});
+11 -30
View File
@@ -1,4 +1,3 @@
import AppDispatcher from '../dispatcher/AppDispatcher';
import * as ActionTypes from '../constants/ActionTypes';
export interface SelectRaceAction {
@@ -8,7 +7,7 @@ export interface SelectRaceAction {
};
}
export const selectRace = (id: string) => ({
export const selectRace = (id: string): SelectRaceAction => ({
type: ActionTypes.SELECT_RACE,
payload: {
id
@@ -16,41 +15,23 @@ export const selectRace = (id: string) => ({
});
export interface SortRacesAction {
type: ActionTypes.SORT_RACES;
type: ActionTypes.SET_RACES_SORT_ORDER;
payload: {
sortOrder: string;
};
}
export const sortRaces = (sortOrder: string) => ({
type: ActionTypes.SORT_RACES,
export const sortRaces = (sortOrder: string): SortRacesAction => ({
type: ActionTypes.SET_RACES_SORT_ORDER,
payload: {
sortOrder
}
});
export default {
selectRace(raceID: string): void {
AppDispatcher.dispatch({
type: ActionTypes.ATS.SELECT_RACE,
raceID
});
},
filter(text: string): void {
AppDispatcher.dispatch({
type: ActionTypes.ATS.FILTER_RACES,
text
});
},
sort(option: string): void {
AppDispatcher.dispatch({
type: ActionTypes.ATS.SORT_RACES,
option
});
},
changeValueVisibility(): void {
AppDispatcher.dispatch({
type: ActionTypes.ATS.CHANGE_RACE_VALUE_VISIBILITY
});
}
};
export interface SwitchRaceValueVisibilityAction {
type: ActionTypes.SWITCH_RACE_VALUE_VISIBILITY;
}
export const switchRaceValueVisibilityFilter = (sortOrder: string): SwitchRaceValueVisibilityAction => ({
type: ActionTypes.SWITCH_RACE_VALUE_VISIBILITY
});
+2 -205
View File
@@ -1,7 +1,5 @@
import * as ActionTypes from '../constants/ActionTypes';
import alert from '../utils/alert';
import AppDispatcher from '../dispatcher/AppDispatcher';
import HerolistStore from '../stores/HerolistStore';
import { RawRace } from '../reducers/RacesReducer';
import { Hero } from '../reducers/HerolistReducer';
@@ -140,7 +138,7 @@ export interface ReceiveDataTablesAction {
};
}
export const receiveDataTables = (data: RawData) => ({
export const receiveDataTables = (data: RawData): ReceiveDataTablesAction => ({
type: ActionTypes.RECEIVE_DATA_TABLES,
payload: {
data,
@@ -156,211 +154,10 @@ export interface ReceiveHeroDataAction {
};
}
export const receiveHeroData = (data: Hero) => ({
export const receiveHeroData = (data: Hero): ReceiveHeroDataAction => ({
type: ActionTypes.RECEIVE_HERO_DATA,
payload: {
data,
pending: false
}
});
export default {
startLoading(): void {
AppDispatcher.dispatch({
type: ActionTypes.ATS.WAIT_START
});
},
runtimeError(): void {
alert('Da hat etwas nicht geklappt', 'Dies darf nicht passieren! Melde dies bitte als Fehler! Wir versuchen, das Problem schnellstmöglich zu beheben!');
AppDispatcher.dispatch({
type: ActionTypes.ATS.WAIT_END
});
},
connectionError(error: Error): void {
alert('Verbindung nicht möglich', 'Die App konnte keine Verbindung zum Server herstellen. Bitte überprüfe deine Internetverbindung! ' + JSON.stringify(error) + ' Es kann bei diesem Problem auch möglich sein, dass etwas im Programmablauf nicht stimmt. Informiere uns bitte über dein Problem, sollte es deiner Erkenntnis nach nicht an der Verbindung liegen!');
AppDispatcher.dispatch({
type: ActionTypes.ATS.WAIT_END
});
},
receiveLists(raw: Object): void {
AppDispatcher.dispatch({
type: ActionTypes.ATS.RECEIVE_RAW_LISTS,
...raw
});
},
registrationSuccess(): void {
alert('Konto bestätigen', 'Wir haben dir eine E-Mail an die angegebene Adresse geschickt. Dort wirst du einen Bestätigungslink finden, dem du einfach nur zu folgen brauchst, um dein Konto zu aktivieren.');
AppDispatcher.dispatch({
type: ActionTypes.ATS.REGISTRATION_SUCCESS
});
},
forgotPasswordSuccess(callback: string): void {
switch (callback) {
case 'false':
alert('E-Mail nicht vorhanden', 'Die eingegebene E-Mail-Adresse ist nicht registriert.');
AppDispatcher.dispatch({
type: ActionTypes.ATS.WAIT_END
});
break;
default:
alert('E-Mail erfolgreich verschickt', 'Du kannst jetzt in dein Postfach schauen; wir haben dir die E-Mail mit dem Link zum Zurücksetzen deines Passworts geschickt!');
AppDispatcher.dispatch({
type: ActionTypes.ATS.WAIT_END
});
break;
}
},
forgotUsernameSuccess(callback: string): void {
switch (callback) {
case 'false':
alert('E-Mail nicht vorhanden', 'Die eingegebene E-Mail-Adresse ist nicht registriert.');
AppDispatcher.dispatch({
type: ActionTypes.ATS.WAIT_END
});
break;
default:
alert('E-Mail erfolgreich verschickt', 'Du kannst jetzt in dein Postfach schauen; wir haben dir die E-Mail mit deinem Benutzernamen geschickt!');
AppDispatcher.dispatch({
type: ActionTypes.ATS.WAIT_END
});
break;
}
},
resendActivationSuccess(callback: string): void {
switch (callback) {
case 'false':
this.runtimeError();
break;
default:
alert('E-Mail erfolgreich verschickt', 'Du kannst jetzt in dein Postfach schauen; wir haben dir die Aktivierungsemail erneut geschickt!');
AppDispatcher.dispatch({
type: ActionTypes.ATS.WAIT_END
});
break;
}
},
receiveAccount(callback: string, name: string): void {
switch (callback) {
case 'false':
alert('Anmeldeversuch fehlgeschlagen', 'Die eigegebene Kombination aus Benutzername und Passwort wurde nicht erkannt. Stelle sicher, dass du dich nicht vertippt hast und versuche es nochmal.');
AppDispatcher.dispatch({
type: ActionTypes.ATS.WAIT_END
});
break;
case 'notactive':
alert('Benutzerkonto nicht aktiviert', 'Das hinterlegte Benutzerkonto wurde noch nicht aktivert. Bitte aktiviere das Konto über den Aktivierungslink in der Aktivierungsemail.');
AppDispatcher.dispatch({
type: ActionTypes.ATS.WAIT_END
});
break;
case 'logged':
alert('Benutzer bereits angemeldet', 'Das Konto ist momentan an einem anderen Ort (Gerät oder Browser) angemeldet. Es kann nicht mehrere Male auf ein Konto zugegriffen werden.');
AppDispatcher.dispatch({
type: ActionTypes.ATS.WAIT_END
});
break;
default: {
// let [ id, heroes ] = JSON.parse(callback);
let id = parseInt(callback);
let heroes = [];
AppDispatcher.dispatch({
type: ActionTypes.ATS.RECEIVE_ACCOUNT,
id, name, heroes
});
}
}
},
logoutSuccess(): void {
AppDispatcher.dispatch({
type: ActionTypes.ATS.LOGOUT_SUCCESS
});
},
changeUsernameSuccess(callback: string, name: string): void {
switch (callback) {
case 'false':
this.runtimeError();
break;
default:
alert('Passwort erfolgreich geändert', 'Dein Passwort wurde erfolgreich geändert.');
AppDispatcher.dispatch({
type: ActionTypes.ATS.ACCOUNTNAME_CHANGE_SUCCESS,
name
});
break;
}
},
changePasswordSuccess(callback: string): void {
switch (callback) {
case 'false':
this.runtimeError();
break;
default:
alert('Passwort erfolgreich geändert', 'Dein Passwort wurde erfolgreich geändert.');
AppDispatcher.dispatch({
type: ActionTypes.ATS.PASSWORD_CHANGE_SUCCESS
});
break;
}
},
deleteAccountSuccess(callback: string): void {
switch (callback) {
case 'false':
this.runtimeError();
break;
default:
alert('Konto gelöscht', 'Dein Konto wurde mitsamt aller Helden und Gruppen erfolgreich gelöscht.');
AppDispatcher.dispatch({
type: ActionTypes.ATS.CLEAR_ACCOUNT
});
break;
}
},
herolistRefreshSuccess(rawHeroes: string): void {
switch (rawHeroes) {
case 'false':
this.runtimeError();
break;
default:
AppDispatcher.dispatch({
type: ActionTypes.ATS.RECEIVE_RAW_HEROLIST,
rawHeroes
});
break;
}
},
loadHeroSuccess(id: string, data: string): void {
var short = HerolistStore.get(id);
data = JSON.parse(data);
AppDispatcher.dispatch({
type: ActionTypes.ATS.RECEIVE_HERO,
...(Object.assign({}, short, data))
});
},
saveHeroSuccess(): void {
AppDispatcher.dispatch({
type: ActionTypes.ATS.SAVE_HERO_SUCCESS
});
},
changeHeroAvatarSuccess(url: string): void {
switch (url) {
case 'false':
this.runtimeError();
break;
default:
AppDispatcher.dispatch({
type: ActionTypes.ATS.UPDATE_HERO_AVATAR,
url
});
break;
}
}
};
-15
View File
@@ -1,15 +0,0 @@
import * as ActionTypes from '../constants/ActionTypes';
export interface SortTalentsAction {
type: ActionTypes.SORT_TALENTS;
payload: {
sortOrder: string;
};
}
export const sortTalents = (sortOrder: string) => ({
type: ActionTypes.SORT_TALENTS,
payload: {
sortOrder
}
});
-31
View File
@@ -1,31 +0,0 @@
"use strict";
var AppDispatcher_1 = require("../dispatcher/AppDispatcher");
var ActionTypes = require("../constants/ActionTypes");
exports.showSection = function (section, tab) { return ({
type: ActionTypes.SHOW_SECTION,
payload: {
section: section,
tab: tab
}
}); };
exports.showTab = function (tab) { return ({
type: ActionTypes.SHOW_TAB,
payload: {
tab: tab
}
}); };
exports.__esModule = true;
exports["default"] = {
showTab: function (tab) {
AppDispatcher_1["default"].dispatch({
type: ActionTypes.SHOW_TAB,
tab: tab
});
},
showSection: function (section) {
AppDispatcher_1["default"].dispatch({
type: 'SHOW_TAB_SECTION',
section: section
});
}
};
-47
View File
@@ -1,47 +0,0 @@
import AppDispatcher from '../dispatcher/AppDispatcher';
import * as ActionTypes from '../constants/ActionTypes';
export interface ShowSectionAction {
type: ActionTypes.SHOW_SECTION;
payload: {
section: 'main' | 'hero' | 'group';
tab?: string;
};
}
export const showSection = (section: 'main' | 'hero' | 'group', tab?: string): ShowSectionAction => ({
type: ActionTypes.SHOW_SECTION,
payload: {
section,
tab
}
});
export interface ShowTabAction {
type: ActionTypes.SHOW_TAB;
payload: {
tab: string;
};
}
export const showTab = (tab: string): ShowTabAction => ({
type: ActionTypes.SHOW_TAB,
payload: {
tab
}
});
export default {
showTab(tab: string): void {
AppDispatcher.dispatch({
type: ActionTypes.SHOW_TAB,
tab
});
},
showSection(section: string): void {
AppDispatcher.dispatch({
type: 'SHOW_TAB_SECTION',
section
});
}
};
+4 -37
View File
@@ -1,48 +1,15 @@
import AppDispatcher from '../dispatcher/AppDispatcher';
import * as ActionTypes from '../constants/ActionTypes';
export interface SortTalentsAction {
type: ActionTypes.SORT_TALENTS;
export interface SetTalentsSortOrderAction {
type: ActionTypes.SET_TALENTS_SORT_ORDER;
payload: {
sortOrder: string;
};
}
export const sortTalents = (sortOrder: string) => ({
type: ActionTypes.SORT_TALENTS,
export const setTalentsSortOrder = (sortOrder: string): SetTalentsSortOrderAction => ({
type: ActionTypes.SET_TALENTS_SORT_ORDER,
payload: {
sortOrder
}
});
export default {
filter(text: string): void {
AppDispatcher.dispatch({
type: ActionTypes.ATS.FILTER_TALENTS,
text
});
},
sort(option: string): void {
AppDispatcher.dispatch({
type: ActionTypes.ATS.SORT_TALENTS,
option
});
},
changeTalentRating(): void {
AppDispatcher.dispatch({
type: ActionTypes.ATS.CHANGE_TALENT_RATING
});
},
addPoint(id: string): void {
AppDispatcher.dispatch({
type: ActionTypes.ATS.ADD_TALENT_POINT,
id
});
},
removePoint(id: string): void {
AppDispatcher.dispatch({
type: ActionTypes.ATS.REMOVE_TALENT_POINT,
id
});
}
};
+5 -5
View File
@@ -1,6 +1,6 @@
import { Component, PropTypes } from 'react';
import * as React from 'react';
import AccountActions from '../../actions/AccountActions';
import AccountActions from '../../_actions/AccountActions';
import APStore from '../../stores/APStore';
import AuthStore from '../../stores/AuthStore';
import AvatarWrapper from '../AvatarWrapper';
@@ -8,15 +8,15 @@ import BorderButton from '../BorderButton';
import createOverlay from '../../utils/createOverlay';
import ELStore from '../../stores/ELStore';
import HeroCreation from '../../views/herolist/HeroCreation';
import HerolistActions from '../../actions/HerolistActions';
import HistoryActions from '../../actions/HistoryActions';
import HerolistActions from '../../_actions/HerolistActions';
import HistoryActions from '../../_actions/HistoryActions';
import HistoryStore from '../../stores/HistoryStore';
import IconButton from '../IconButton';
import InGameActions from '../../actions/InGameActions';
import InGameActions from '../../_actions/InGameActions';
import Login from '../../views/account/Login';
import PhaseStore from '../../stores/PhaseStore';
import ProfileStore from '../../stores/ProfileStore';
import TabActions from '../../actions/TabActions';
import TabActions from '../../_actions/TabActions';
import Text from '../Text';
import TitleBarBack from './TitleBarBack';
import TitleBarLeft from './TitleBarLeft';
+1 -1
View File
@@ -1,6 +1,6 @@
import { Component } from 'react';
import * as React from 'react';
import TabActions from '../../actions/TabActions';
import TabActions from '../../_actions/TabActions';
import TitleBarBackArrow from './TitleBarBackArrow';
export default class TitleBarBack extends Component<any, any> {
+1 -1
View File
@@ -1,7 +1,7 @@
import { Component, PropTypes } from 'react';
import * as React from 'react';
import TabProps from '../../components/Tab';
import TabActions from '../../actions/TabActions';
import TabActions from '../../_actions/TabActions';
interface Props {
active: string;
-167
View File
@@ -1,167 +0,0 @@
"use strict";
var keymirror_1 = require("keymirror");
exports.INITIALIZE = 'INITIALIZE';
exports.SHOW_SECTION = 'SHOW_SECTION';
exports.SHOW_TAB = 'SHOW_TAB';
exports.FILTER_HEROLIST = 'FILTER_HEROLIST';
exports.SORT_HEROLIST = 'SORT_HEROLIST';
exports.LOGIN = 'LOGIN';
exports.LOGOUT = 'LOGOUT';
exports.ATS = keymirror_1["default"]({
// ServerActions
RECEIVE_RAW_LISTS: null,
// WaitStore
WAIT_START: null,
WAIT_END: null,
// TabStore
SHOW_TAB_SECTION: null,
SHOW_TAB: null,
// AuthStore
RECEIVE_ACCOUNT: null,
UPDATE_USERNAME: null,
LOGOUT_SUCCESS: null,
CLEAR_ACCOUNT: null,
ACCOUNTNAME_CHANGE_SUCCESS: null,
PASSWORD_CHANGE_SUCCESS: null,
// Registration
REGISTRATION_SUCCESS: null,
// PaneStore
HEROES_SHOW: null,
HEROES_HIDE: null,
COLLAPSE_HEROES: null,
// HerolistStore
RECEIVE_RAW_HEROLIST: null,
SEARCH_HEROLIST: null,
FILTER_HEROLIST: null,
SORT_HEROLIST: null,
CHANGE_HEROLIST_VIEW: null,
CREATE_NEW_HERO: null,
RECEIVE_HERO: null,
// ProfileStore
UPDATE_HERO_NAME: null,
UPDATE_HERO_AVATAR: null,
UPDATE_FAMILY: null,
UPDATE_PLACEOFBIRTH: null,
UPDATE_DATEOFBIRTH: null,
UPDATE_AGE: null,
UPDATE_HAIRCOLOR: null,
UPDATE_EYECOLOR: null,
UPDATE_SIZE: null,
UPDATE_WEIGHT: null,
UPDATE_TITLE: null,
UPDATE_SOCIALSTATUS: null,
UPDATE_CHARACTERISTICS: null,
UPDATE_OTHERINFO: null,
REROLL_HAIRCOLOR: null,
REROLL_EYECOLOR: null,
REROLL_SIZE: null,
REROLL_WEIGHT: null,
UNLOAD_HERO: null,
CLEAR_HERO: null,
SAVE_HERO_SUCCESS: null,
// PhaseStore
FINALIZE_CHARACTER_CREATION: null,
// APStore
ADD_ADVENTURE_POINTS: null,
// RaceStore
SELECT_RACE: null,
FILTER_RACES: null,
SORT_RACES: null,
CHANGE_RACE_VALUE_VISIBILITY: null,
// CultureStore
SELECT_CULTURE: null,
FILTER_CULTURES: null,
SORT_CULTURES: null,
CHANGE_CULTURE_VALUE_VISIBILITY: null,
CHANGE_CULTURE_VIEW: null,
CHANGE_CULTURE_PACKAGE: null,
CHANGE_CULTURE_LITERACY: null,
// ProfessionStore
SELECT_PROFESSION: null,
FILTER_PROFESSIONS: null,
SORT_PROFESSIONS: null,
CHANGE_PROFESSION_VIEW: null,
ASSIGN_RCP_ENTRIES: null,
// ProfessionVariantStore
SELECT_PROFESSION_VARIANT: null,
// AttributeStore
ADD_ATTRIBUTE_POINT: null,
REMOVE_ATTRIBUTE_POINT: null,
ADD_MAX_ENERGY_POINT: null,
// DisAdvStore
FILTER_DISADV: null,
CHANGE_DISADV_RATING: null,
ACTIVATE_DISADV: null,
DEACTIVATE_DISADV: null,
UPDATE_DISADV_TIER: null,
// TalentsStore
FILTER_TALENTS: null,
SORT_TALENTS: null,
CHANGE_TALENT_RATING: null,
ADD_TALENT_POINT: null,
REMOVE_TALENT_POINT: null,
// CombatTechniquesStore
FILTER_COMBATTECHNIQUES: null,
SORT_COMBATTECHNIQUES: null,
ADD_COMBATTECHNIQUE_POINT: null,
REMOVE_COMBATTECHNIQUE_POINT: null,
// SpellsStore
FILTER_SPELLS: null,
SORT_SPELLS: null,
UPDATE_SPELL_VIEW: null,
ACTIVATE_SPELL: null,
DEACTIVATE_SPELL: null,
ADD_SPELL_POINT: null,
REMOVE_SPELL_POINT: null,
// LiturgiesStore
FILTER_LITURGIES: null,
SORT_LITURGIES: null,
UPDATE_LITURGY_VIEW: null,
ACTIVATE_LITURGY: null,
DEACTIVATE_LITURGY: null,
ADD_LITURGY_POINT: null,
REMOVE_LITURGY_POINT: null,
// SpecialAbilitiesStore
FILTER_SPECIALABILITIES: null,
SORT_SPECIALABILITIES: null,
UPDATE_SPECIALABILITY_VIEW: null,
ACTIVATE_SPECIALABILITY: null,
DEACTIVATE_SPECIALABILITY: null,
UPDATE_SPECIALABILITY_TIER: null,
// InventoryStore
FILTER_ITEMS: null,
SORT_ITEMS: null,
ADD_ITEM: null,
SAVE_ITEM: null,
REMOVE_ITEM: null,
// GroupsStore
SHOW_MASTER_REQUESTED_LIST: null,
HIDE_MASTER_REQUESTED_LIST: null,
// InGameStore
LOAD_RAW_INGAME_DATA: null,
INGAME_PREVIOUS_PHASE: null,
INGAME_NEXT_PHASE: null,
UPDATE_INGAME_CAST: null,
CANCEL_INGAME_CAST: null,
INGAME_USE_ENDURANCE: null,
INGAME_USE_ACTION: null,
INGAME_USE_FREE_ACTION: null,
INGAME_ACTIVATE_FIGHTER: null,
INGAME_DEACTIVATE_FIGHTER: null,
INGAME_EDIT_START: null,
INGAME_EDIT_UPDATE_VALUE: null,
INGAME_EDIT_UPDATE_CAST_VALUE: null,
INGAME_EDIT_UPDATE_DUPLICATE_VALUE: null,
INGAME_EDIT_END: null,
INGAME_ADD_FIGHTER: null,
INGAME_DUPLICATE_FIGHTER: null,
INGAME_REMOVE_FIGHTER: null,
INGAME_RESET_PHASES: null,
INGAME_RESET_HEALTH: null,
INGAME_RESET_ALL: null,
INGAME_UPDATE_ONLINE_LINK: null,
INGAME_SAVE: null,
INGAME_SWITCH_OPTION: null
});
exports.__esModule = true;
exports["default"] = exports.ATS;
+17 -14
View File
@@ -8,15 +8,13 @@ function keyMirror<T>(data: T): { [K in keyof T]: K; } {
return newData;
}
// import keyMirror from 'keymirror';
export type RECEIVE_DATA_TABLES = 'RECEIVE_DATA_TABLES';
export const RECEIVE_DATA_TABLES = 'RECEIVE_DATA_TABLES';
export type SHOW_SECTION = 'SHOW_SECTION';
export const SHOW_SECTION = 'SHOW_SECTION';
export type SHOW_TAB = 'SHOW_TAB';
export const SHOW_TAB = 'SHOW_TAB';
export type SET_SECTION = 'SET_SECTION';
export const SET_SECTION = 'SET_SECTION';
export type SET_TAB = 'SET_TAB';
export const SET_TAB = 'SET_TAB';
export type REQUEST_LOGIN = 'REQUEST_LOGIN';
export const REQUEST_LOGIN = 'REQUEST_LOGIN';
@@ -26,13 +24,13 @@ export type REQUEST_LOGOUT = 'REQUEST_LOGOUT';
export const REQUEST_LOGOUT = 'REQUEST_LOGOUT';
export type RECEIVE_LOGOUT = 'RECEIVE_LOGOUT';
export const RECEIVE_LOGOUT = 'RECEIVE_LOGOUT';
export type REGISTER = 'REGISTER';
export const REGISTER = 'REGISTER';
export type REQUEST_REGISTRATION = 'REQUEST_REGISTRATION';
export const REQUEST_REGISTRATION = 'REQUEST_REGISTRATION';
export type FILTER_HEROLIST = 'FILTER_HEROLIST';
export const FILTER_HEROLIST = 'FILTER_HEROLIST';
export type SORT_HEROLIST = 'SORT_HEROLIST';
export const SORT_HEROLIST = 'SORT_HEROLIST';
export type SET_HEROLIST_VISIBILITY_FILTER = 'SET_HEROLIST_VISIBILITY_FILTER';
export const SET_HEROLIST_VISIBILITY_FILTER = 'SET_HEROLIST_VISIBILITY_FILTER';
export type SET_HEROLIST_SORT_ORDER = 'SET_HEROLIST_SORT_ORDER';
export const SET_HEROLIST_SORT_ORDER = 'SET_HEROLIST_SORT_ORDER';
export type REQUEST_HEROLIST = 'REQUEST_HEROLIST';
export const REQUEST_HEROLIST = 'REQUEST_HEROLIST';
export type RECEIVE_HEROLIST = 'RECEIVE_HEROLIST';
@@ -45,8 +43,13 @@ export const RECEIVE_HERO_DATA = 'RECEIVE_HERO_DATA';
export type SELECT_RACE = 'SELECT_RACE';
export const SELECT_RACE = 'SELECT_RACE';
export type SORT_RACES = 'SORT_RACES';
export const SORT_RACES = 'SORT_RACES';
export type SET_RACES_SORT_ORDER = 'SET_RACES_SORT_ORDER';
export const SET_RACES_SORT_ORDER = 'SET_RACES_SORT_ORDER';
export type SWITCH_RACE_VALUE_VISIBILITY = 'SWITCH_RACE_VALUE_VISIBILITY';
export const SWITCH_RACE_VALUE_VISIBILITY = 'SWITCH_RACE_VALUE_VISIBILITY';
export type SET_TALENTS_SORT_ORDER = 'SET_TALENTS_SORT_ORDER';
export const SET_TALENTS_SORT_ORDER = 'SET_TALENTS_SORT_ORDER';
export const ATS = keyMirror({
+11 -12
View File
@@ -1,11 +1,7 @@
import { fromJS, Map } from 'immutable';
import * as ActionTypes from '../constants/ActionTypes';
type Action = {
type: string;
meta: {
pending: boolean;
};
};
export type LoadingState = boolean;
@@ -14,20 +10,23 @@ const initialState: boolean = true;
export default (state = initialState, a: Action) => {
switch (a.type) {
case 'TEST':
// case ActionTypes.RECEIVE_RAW_LISTS:
// case ActionTypes.WAIT_END:
case ActionTypes.REQUEST_HERO_DATA:
case ActionTypes.REQUEST_HEROLIST:
case ActionTypes.REQUEST_LOGIN:
case ActionTypes.REQUEST_LOGOUT:
// case ActionTypes.REGISTRATION_SUCCESS:
// case ActionTypes.RECEIVE_ACCOUNT:
// case ActionTypes.LOGOUT_SUCCESS:
// case ActionTypes.CLEAR_ACCOUNT:
// case ActionTypes.UPDATE_USERNAME:
// case ActionTypes.RECEIVE_RAW_HEROES:
// case ActionTypes.CREATE_HERO:
// case ActionTypes.RECEIVE_HERO:
// case ActionTypes.SAVE_HERO_SUCCESS:
// case ActionTypes.UPDATE_HERO_AVATAR:
return a.meta.pending;
return true;
case ActionTypes.RECEIVE_HERO_DATA:
case ActionTypes.RECEIVE_HEROLIST:
case ActionTypes.RECEIVE_LOGIN:
case ActionTypes.RECEIVE_LOGOUT:
return false;
default:
return state;
+4 -4
View File
@@ -1,8 +1,8 @@
import { LoginAction, LogoutAction } from '../actions/AuthActions';
import { ShowSectionAction, ShowTabAction } from '../actions/TabActions';
import { SetSectionAction, SetTabAction } from '../actions/LocationActions';
import * as ActionTypes from '../constants/ActionTypes';
type Action = LoginAction | LogoutAction | ShowSectionAction | ShowTabAction;
type Action = LoginAction | LogoutAction | SetSectionAction | SetTabAction;
export interface LocationState {
readonly loggedIn: boolean;
@@ -18,10 +18,10 @@ const initialState = <LocationState>{
export default (state = initialState, action: Action, loggedIn: boolean) => {
switch (action.type) {
case ActionTypes.SHOW_TAB:
case ActionTypes.SET_TAB:
return { ...state, tab: action.payload.tab }
case ActionTypes.SHOW_SECTION: {
case ActionTypes.SET_SECTION: {
const section = action.payload.section;
let tab = action.payload.tab;
if (!tab) {
+1 -1
View File
@@ -1,7 +1,7 @@
import AuthStore from '../stores/AuthStore';
import { readFile } from 'fs';
import ProfileStore from '../stores/ProfileStore';
import ServerActions from '../actions/ServerActions';
import ServerActions from '../_actions/ServerActions';
export default {
connectionError: function(e: Error): void {
+1 -1
View File
@@ -13,7 +13,7 @@ import {
RawSpecialAbility,
RawSpell,
RawTalent
} from '../actions/ServerActions';
} from '../_actions/ServerActions';
import Categories from '../constants/Categories';
import {
Advantage,
+1 -1
View File
@@ -1,4 +1,4 @@
import AccountActions from '../../actions/AccountActions';
import AccountActions from '../../_actions/AccountActions';
import AccountChangeName from './AccountChangeName';
import AccountChangePassword from './AccountChangePassword';
import BorderButton from '../../components/BorderButton';
+1 -1
View File
@@ -1,4 +1,4 @@
import AccountActions from '../../actions/AccountActions';
import AccountActions from '../../_actions/AccountActions';
import IconButton from '../../components/IconButton';
import * as React from 'react';
import { Component } from 'react';
+1 -1
View File
@@ -1,4 +1,4 @@
import AccountActions from '../../actions/AccountActions';
import AccountActions from '../../_actions/AccountActions';
import IconButton from '../../components/IconButton';
import React, { Component } from 'react';
import TextField from '../../components/TextField';
+5 -5
View File
@@ -1,4 +1,4 @@
import AccountActions from '../../actions/AccountActions';
import AccountActions from '../../_actions/AccountActions';
import createOverlay, { close } from '../../utils/createOverlay';
import Dialog from '../../components/Dialog';
import Login from './Login';
@@ -15,17 +15,17 @@ interface State {
export default class ForgotPassword extends Component<Props, State> {
static propTypes = {
static propTypes = {
node: PropTypes.any
};
state = {
email: ''
};
forgotPassword = () => AccountActions.forgotPassword(this.state.email);
back = () => createOverlay(<Login />);
_onChange = event => this.setState({ email: event.target.value });
_onEnter = event => {
if (event.charCode === 13 && this.state.email !== '') {
@@ -61,6 +61,6 @@ export default class ForgotPassword extends Component<Props, State> {
/>
</Dialog>
);
}
}
+5 -5
View File
@@ -1,4 +1,4 @@
import AccountActions from '../../actions/AccountActions';
import AccountActions from '../../_actions/AccountActions';
import createOverlay, { close } from '../../utils/createOverlay';
import Dialog from '../../components/Dialog';
import Login from './Login';
@@ -15,17 +15,17 @@ interface State {
export default class ForgotUsername extends Component<Props, State> {
static propTypes = {
static propTypes = {
node: PropTypes.any
};
state = {
email: ''
};
forgotUsername = () => AccountActions.forgotUsername(this.state.email);
back = () => createOverlay(<Login />);
_onChange = event => this.setState({ email: event.target.value });
_onEnter = event => {
if (event.charCode === 13 && this.state.email !== '') {
@@ -61,6 +61,6 @@ export default class ForgotUsername extends Component<Props, State> {
/>
</Dialog>
);
}
}
+4 -4
View File
@@ -1,4 +1,4 @@
import AccountActions from '../../actions/AccountActions';
import AccountActions from '../../_actions/AccountActions';
import Dialog from '../../components/Dialog';
import ForgotPassword from './ForgotPassword';
import ForgotUsername from './ForgotUsername';
@@ -19,7 +19,7 @@ interface State {
export default class Login extends Component<Props, State> {
static propTypes = {
static propTypes = {
node: PropTypes.any
};
@@ -27,13 +27,13 @@ export default class Login extends Component<Props, State> {
username: '',
password: ''
};
login = () => AccountActions.login(this.state.username, this.state.password);
forgotUsername = () => { createOverlay(<ForgotUsername />); close(this.props.node); };
forgotPassword = () => { createOverlay(<ForgotPassword />); close(this.props.node); };
register = () => createOverlay(<Register />);
resendActivation = () => { createOverlay(<ResendActivation />); close(this.props.node); };
_onChange = (option, event) => this.setState({ [option]: event.target.value } as State);
_onEnter = event => {
if (event.charCode === 13 && this.state.username !== '' && this.state.password !== '') {
+1 -1
View File
@@ -1,7 +1,7 @@
import createOverlay, { close } from '../../utils/createOverlay';
import { Component, PropTypes } from 'react';
import * as React from 'react';
import AccountActions from '../../actions/AccountActions';
import AccountActions from '../../_actions/AccountActions';
import Dialog from '../../components/Dialog';
import Login from './Login';
import TextField from '../../components/TextField';
+2 -2
View File
@@ -1,8 +1,8 @@
import TabActions from '../../actions/TabActions';
import TabActions from '../../_actions/TabActions';
import React, { Component } from 'react';
export default class RegistrationConfirm extends Component<any, any> {
render() {
return (
<div id="confirmregistration">
+5 -5
View File
@@ -1,5 +1,5 @@
import createOverlay, { close } from '../../utils/createOverlay';
import AccountActions from '../../actions/AccountActions';
import AccountActions from '../../_actions/AccountActions';
import Dialog from '../../components/Dialog';
import Login from './Login';
import React, { Component, PropTypes } from 'react';
@@ -15,17 +15,17 @@ interface State {
export default class ResendActivation extends Component<Props, State> {
static propTypes = {
static propTypes = {
node: PropTypes.any
};
state = {
email: ''
};
resendActivation = () => AccountActions.resendActivation(this.state.email);
back = () => createOverlay(<Login />);
_onChange = event => this.setState({ email: event.target.value });
_onEnter = event => {
if (event.charCode === 13 && this.state.email !== '') {
@@ -61,6 +61,6 @@ export default class ResendActivation extends Component<Props, State> {
/>
</Dialog>
);
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
import { SecondaryAttribute } from '../../utils/secondaryAttributes';
import AttributeActions from '../../actions/AttributeActions';
import AttributeActions from '../../_actions/AttributeActions';
import AttributeBorder from './AttributeBorder';
import IconButton from '../../components/IconButton';
import NumberBox from '../../components/NumberBox';
+1 -1
View File
@@ -1,5 +1,5 @@
import { AttributeInstance } from '../../utils/data/Attribute';
import AttributeActions from '../../actions/AttributeActions';
import AttributeActions from '../../_actions/AttributeActions';
import AttributeBorder from './AttributeBorder';
import IconButton from '../../components/IconButton';
import NumberBox from '../../components/NumberBox';
+6 -6
View File
@@ -6,7 +6,7 @@ import { Active } from './DisAdvRemoveListItem';
import { RaceInstance } from '../../utils/data/Race';
import { CultureInstance } from '../../utils/data/Culture';
import { ProfessionInstance } from '../../utils/data/Profession';
import DisAdvActions from '../../actions/DisAdvActions';
import DisAdvActions from '../../_actions/DisAdvActions';
import DisAdvList from './DisAdvList';
import DisAdvStore from '../../stores/DisAdvStore';
import ProfessionStore from '../../stores/ProfessionStore';
@@ -27,8 +27,8 @@ interface State {
}
export default class Advantages extends React.Component<any, State> {
state = {
state = {
filterText: DisAdvStore.getFilter(),
showRating: DisAdvStore.getRating(),
advActive: DisAdvStore.getActiveForView(true),
@@ -38,7 +38,7 @@ export default class Advantages extends React.Component<any, State> {
culture: CultureStore.getCurrent(),
profession: ProfessionStore.getCurrent()
};
_updateDisAdvStore = () => this.setState({
filterText: DisAdvStore.getFilter(),
showRating: DisAdvStore.getRating(),
@@ -50,11 +50,11 @@ export default class Advantages extends React.Component<any, State> {
changeRating = () => DisAdvActions.changeRating();
showAddSlidein = () => this.setState({ showAddSlidein: true } as State);
hideAddSlidein = () => this.setState({ showAddSlidein: false } as State);
componentDidMount() {
DisAdvStore.addChangeListener(this._updateDisAdvStore );
}
componentWillUnmount() {
DisAdvStore.removeChangeListener(this._updateDisAdvStore );
}
+2 -2
View File
@@ -1,5 +1,5 @@
import BorderButton from '../../components/BorderButton';
import DisAdvActions from '../../actions/DisAdvActions';
import DisAdvActions from '../../_actions/DisAdvActions';
import { get } from '../../stores/ListStore';
import Dropdown from '../../components/Dropdown';
import * as React from 'react';
@@ -119,7 +119,7 @@ export default class DisAdvAddListItem extends React.Component<Props, State> {
ap = typeof this.state.selected === 'number' ? get(disadv.id).sel[this.state.selected - 1][2] : '';
if (this.state.selected === '') disabled = true;
// ap = this.state.input2 !== '' && !Number.isNaN(parseInt(this.state.input2)) ? Math.round(parseInt(this.state.input2) / 2) : this.state.selected !== '' ? get(disadv.id).sel[this.state.selected - 1][2] : '';
// if (!((this.state.selected !== '' && this.state.input === '' && this.state.input2 === '') ||
// if (!((this.state.selected !== '' && this.state.input === '' && this.state.input2 === '') ||
// (this.state.input !== '' && this.state.input2 !== '' && !Number.isNaN(parseInt(this.state.input2)))
// )) disabled = true;
// args.input = [this.state.input, this.state.input2];
+2 -2
View File
@@ -1,5 +1,5 @@
import BorderButton from '../../components/BorderButton';
import DisAdvActions from '../../actions/DisAdvActions';
import DisAdvActions from '../../_actions/DisAdvActions';
import Dropdown from '../../components/Dropdown';
import React, { Component, PropTypes } from 'react';
@@ -35,7 +35,7 @@ export default class DisAdvRemoveListItem extends Component<Props, State> {
static propTypes = {
item: PropTypes.object
};
handleSelectTier = selected_tier => {
var disadv = this.props.item;
DisAdvActions.updateTier( disadv.id, selected_tier, (selected_tier - disadv.tier) * disadv.cost * (disadv.id.match('DIS') ? -1 : 1), disadv.sid );
+7 -7
View File
@@ -6,7 +6,7 @@ import { Active } from './DisAdvRemoveListItem';
import { RaceInstance } from '../../utils/data/Race';
import { CultureInstance } from '../../utils/data/Culture';
import { ProfessionInstance } from '../../utils/data/Profession';
import DisAdvActions from '../../actions/DisAdvActions';
import DisAdvActions from '../../_actions/DisAdvActions';
import DisAdvList from './DisAdvList';
import DisAdvStore from '../../stores/DisAdvStore';
import ProfessionStore from '../../stores/ProfessionStore';
@@ -27,8 +27,8 @@ interface State {
}
export default class Disadvantages extends Component<any, State> {
state = {
state = {
filterText: DisAdvStore.getFilter(),
showRating: DisAdvStore.getRating(),
disadvActive: DisAdvStore.getActiveForView(false),
@@ -38,7 +38,7 @@ export default class Disadvantages extends Component<any, State> {
culture: CultureStore.getCurrent(),
profession: ProfessionStore.getCurrent()
};
_updateDisAdvStore = () => this.setState({
filterText: DisAdvStore.getFilter(),
showRating: DisAdvStore.getRating(),
@@ -50,11 +50,11 @@ export default class Disadvantages extends Component<any, State> {
changeRating = () => DisAdvActions.changeRating();
showAddSlidein = () => this.setState({ showAddSlidein: true } as State);
hideAddSlidein = () => this.setState({ showAddSlidein: false } as State);
componentDidMount() {
DisAdvStore.addChangeListener(this._updateDisAdvStore );
}
componentWillUnmount() {
DisAdvStore.removeChangeListener(this._updateDisAdvStore );
}
@@ -79,7 +79,7 @@ export default class Disadvantages extends Component<any, State> {
if (profession.hasOwnProperty('untyp_dadv'))
profession.untyp_dadv.forEach(e => { rating[e] = UNTYP; });
race.imp_dadv.forEach(e => { rating[e[0]] = IMP; });
return (
<div className="page" id="advantages">
<Slidein isOpen={this.state.showAddSlidein} close={this.hideAddSlidein}>
+1 -1
View File
@@ -1,7 +1,7 @@
import BorderButton from '../../components/BorderButton';
import React, { Component } from 'react';
import Scroll from '../../components/Scroll';
import TabActions from '../../actions/TabActions';
import TabActions from '../../_actions/TabActions';
import TextField from '../../components/TextField';
export default class Grouplist extends Component<any, any> {
+5 -5
View File
@@ -1,6 +1,6 @@
import Dialog from '../../components/Dialog';
import Dropdown from '../../components/Dropdown';
import HerolistActions from '../../actions/HerolistActions';
import HerolistActions from '../../_actions/HerolistActions';
import React, { Component, PropTypes } from 'react';
import TextField from '../../components/TextField';
@@ -16,21 +16,21 @@ interface State {
export default class HeroCreation extends Component<Props, State> {
static propTypes = {
static propTypes = {
node: PropTypes.any
};
state = {
state = {
name: '',
gender: '',
el: 'EL_0'
};
changeName = event => this.setState({ name: event.target.value } as State);
changeGender = gender => this.setState({ gender } as State);
changeEL = el => this.setState({ el } as State);
create = () => HerolistActions.createNewHero(this.state);
render() {
return (
+6 -6
View File
@@ -4,7 +4,7 @@ import createOverlay from '../../utils/createOverlay';
import Dropdown from '../../components/Dropdown';
import ELStore from '../../stores/ELStore';
import HeroCreation from './HeroCreation';
import HerolistActions from '../../actions/HerolistActions';
import HerolistActions from '../../_actions/HerolistActions';
import HerolistItem from './HerolistItem';
import HerolistStore from '../../stores/HerolistStore';
import ProfileStore from '../../stores/ProfileStore';
@@ -28,8 +28,8 @@ export default class Herolist extends Component<any, State> {
view: HerolistStore.getView(),
sortOrder: HerolistStore.getSortOrder()
};
_updateHerolistStore = () => this.setState({
_updateHerolistStore = () => this.setState({
list: HerolistStore.getAllForView(),
filter: HerolistStore.getFilter(),
view: HerolistStore.getView(),
@@ -41,11 +41,11 @@ export default class Herolist extends Component<any, State> {
changeView = option => HerolistActions.changeView(option);
showHeroCreation = () => createOverlay(<HeroCreation />);
refresh = () => HerolistActions.refresh();
componentDidMount() {
HerolistStore.addChangeListener(this._updateHerolistStore );
}
componentWillUnmount() {
HerolistStore.removeChangeListener(this._updateHerolistStore );
}
@@ -91,7 +91,7 @@ export default class Herolist extends Component<any, State> {
<ul>
{
ProfileStore.getID() === null && ELStore.getStartID() !== 'EL_0' ? (
<HerolistItem
<HerolistItem
id={null}
avatar={ProfileStore.getAvatar()}
name="Ungespeicherter Held"
+2 -2
View File
@@ -1,14 +1,14 @@
import Avatar from '../../components/Avatar';
import BorderButton from '../../components/BorderButton';
import CultureStore from '../../stores/CultureStore';
import HerolistActions from '../../actions/HerolistActions';
import HerolistActions from '../../_actions/HerolistActions';
import ProfessionStore from '../../stores/ProfessionStore';
import ProfessionVariantStore from '../../stores/ProfessionVariantStore';
import ProfileStore from '../../stores/ProfileStore';
import ProgressArc from 'react-progress-arc';
import RaceStore from '../../stores/RaceStore';
import React, { PropTypes, Component } from 'react';
import TabActions from '../../actions/TabActions';
import TabActions from '../../_actions/TabActions';
import VerticalList from '../../components/VerticalList';
import classNames from 'classnames';
+1 -1
View File
@@ -1,4 +1,4 @@
// import EquipmentActions from '../../actions/EquipmentActions';
// import EquipmentActions from '../../_actions/EquipmentActions';
import React, { Component } from 'react';
export default class Equipment extends Component {
+4 -4
View File
@@ -2,7 +2,7 @@ import { ItemInstance } from '../../utils/data/Item';
import { filterAndSort } from '../../utils/ListUtils';
import BorderButton from '../../components/BorderButton';
import createOverlay from '../../utils/createOverlay';
import InventoryActions from '../../actions/InventoryActions';
import InventoryActions from '../../_actions/InventoryActions';
import InventoryListItem from './InventoryListItem';
import InventoryStore from '../../stores/InventoryStore';
import ItemEditor from './ItemEditor';
@@ -35,16 +35,16 @@ export default class Inventory extends Component<any, State> {
templates: InventoryStore.getAllTemplates(),
showAddSlidein: false
};
_updateInventoryStore = () => this.setState(getInventoryStore());
filter = event => InventoryActions.filter(event.target.value);
sort = option => InventoryActions.sort(option);
componentDidMount() {
InventoryStore.addChangeListener(this._updateInventoryStore);
}
componentWillUnmount() {
InventoryStore.removeChangeListener(this._updateInventoryStore);
}
+37 -37
View File
@@ -2,7 +2,7 @@ import { get } from '../../stores/ListStore';
import { Item } from '../../utils/DataUtils';
import createOverlay from '../../utils/createOverlay';
import IconButton from '../../components/IconButton';
import InventoryActions from '../../actions/InventoryActions';
import InventoryActions from '../../_actions/InventoryActions';
import InventoryStore from '../../stores/InventoryStore';
import ItemEditor from './ItemEditor';
import React, { Component, PropTypes } from 'react';
@@ -38,104 +38,104 @@ export default class InventoryListItem extends Component {
{ [4,5].includes(gr) ? <table className="melee">
<tbody>
<tr>
<td>Gewicht</td>
<td>{weight} Stn</td>
<td>Gewicht</td>
<td>{weight} Stn</td>
</tr>
<tr>
<td>Preis</td>
<td>{price} S</td>
<td>Preis</td>
<td>{price} S</td>
</tr>
</tbody>
</table> : null}
{ gr === 1 ? <table className="melee">
<tbody>
<tr>
<td>Kampftechnik</td>
<td>{get(combattechnique).name}</td>
<td>Kampftechnik</td>
<td>{get(combattechnique).name}</td>
</tr>
<tr>
<td>TP</td>
<td>{damageDiceNumber}W{damageDiceSides}{damageFlat > 0 ? '+' : null}{damageFlat !== 0 ? damageFlat : null}</td>
<td>TP</td>
<td>{damageDiceNumber}W{damageDiceSides}{damageFlat > 0 ? '+' : null}{damageFlat !== 0 ? damageFlat : null}</td>
</tr>
<tr>
<td>L+S</td>
<td>L+S</td>
<td>{get(combattechnique).primary.map(attr => get(attr).short).join('/')} {damageBonus}</td>
</tr>
<tr>
<td>AT/PA-Mod</td>
<td>AT/PA-Mod</td>
<td>{at > 0 ? '+' : null}{at}/{pa > 0 ? '+' : null}{pa}</td>
</tr>
<tr>
<td>RW</td>
<td>RW</td>
<td>{['Kurz','Mittel','Lang'][reach - 1]}</td>
</tr>
<tr>
<td>Gewicht</td>
<td>{weight} Stn</td>
<td>Gewicht</td>
<td>{weight} Stn</td>
</tr>
<tr>
<td>Länge</td>
<td>Länge</td>
<td>{length} HF</td>
</tr>
<tr>
<td>Preis</td>
<td>{price} S</td>
<td>Preis</td>
<td>{price} S</td>
</tr>
</tbody>
</table> : null}
{ gr === 2 ? <table className="ranged">
<tbody>
<tr>
<td>Kampftechnik</td>
<td>{get(combattechnique).name}</td>
<td>Kampftechnik</td>
<td>{get(combattechnique).name}</td>
</tr>
<tr>
<td>TP</td>
<td>{damageDiceNumber}W{damageDiceSides}{damageFlat > 0 ? '+' : null}{damageFlat !== 0 ? damageFlat : null}</td>
<td>TP</td>
<td>{damageDiceNumber}W{damageDiceSides}{damageFlat > 0 ? '+' : null}{damageFlat !== 0 ? damageFlat : null}</td>
</tr>
<tr>
<td>LZ</td>
<td>LZ</td>
<td>{reloadtime}</td>
</tr>
<tr>
<td>RW</td>
<td>RW</td>
<td>{range.join('/')}</td>
</tr>
<tr>
<td>Munitionstyp</td>
<td>Munitionstyp</td>
<td>{(InventoryStore.getTemplate(ammunition) || {}).name}</td>
</tr>
<tr>
<td>Gewicht</td>
<td>{weight} Stn</td>
<td>Gewicht</td>
<td>{weight} Stn</td>
</tr>
<tr>
<td>Länge</td>
<td>Länge</td>
<td>{length} HF</td>
</tr>
<tr>
<td>Preis</td>
<td>{price} S</td>
<td>Preis</td>
<td>{price} S</td>
</tr>
</tbody>
</table> : null}
{ gr === 3 ? <table className="armor">
<tbody>
<tr>
<td>RS</td>
<td>{pro}</td>
<td>RS</td>
<td>{pro}</td>
</tr>
<tr>
<td>BE</td>
<td>{enc}</td>
<td>BE</td>
<td>{enc}</td>
</tr>
<tr>
<td>Gewicht</td>
<td>{weight} Stn</td>
<td>Gewicht</td>
<td>{weight} Stn</td>
</tr>
<tr>
<td>Preis</td>
<td>{price} S</td>
<td>Preis</td>
<td>{price} S</td>
</tr>
</tbody>
</table> : null}
+3 -3
View File
@@ -5,7 +5,7 @@ import Dialog from '../../components/Dialog';
import Dropdown from '../../components/Dropdown';
import Hr from '../../components/Hr';
import IconButton from '../../components/IconButton';
import InventoryActions from '../../actions/InventoryActions';
import InventoryActions from '../../_actions/InventoryActions';
import InventoryStore from '../../stores/InventoryStore';
import Label from '../../components/Label';
import React, { Component, PropTypes } from 'react';
@@ -26,7 +26,7 @@ const GROUPS_SELECTION = GROUPS.map((e,i) => [ e, i + 1 ]);
export default class ItemEditor extends Component<Props, State> {
static propTypes = {
static propTypes = {
create: PropTypes.bool,
item: PropTypes.object,
node: PropTypes.any
@@ -90,7 +90,7 @@ export default class ItemEditor extends Component<Props, State> {
addItem = () => InventoryActions.addToList(this.state);
saveItem = () => InventoryActions.saveItem(this.state);
render() {
const { create, node } = this.props;
+6 -6
View File
@@ -1,5 +1,5 @@
import BorderButton from '../../components/BorderButton';
import GroupsActions from '../../actions/GroupsActions';
import GroupsActions from '../../_actions/GroupsActions';
import GroupsStore from '../../stores/GroupsStore';
import React, { Component } from 'react';
import Scroll from '../../components/Scroll';
@@ -7,21 +7,21 @@ import Slidein from '../../components/Slidein';
export default class Groups extends Component {
state = {
state = {
requestsOpen: GroupsStore.getRequestsSlideinState()
};
_updateGroupsStore = () => this.setState({
_updateGroupsStore = () => this.setState({
requestsOpen: GroupsStore.getRequestsSlideinState()
});
openRequests = () => GroupsActions.checkRequests();
closeRequests = () => GroupsActions.closeRequests();
componentDidMount() {
GroupsStore.addChangeListener(this._updateGroupsStore);
}
componentWillUnmount() {
GroupsStore.removeChangeListener(this._updateGroupsStore);
}
+10 -10
View File
@@ -2,7 +2,7 @@ import BorderButton from '../../components/BorderButton';
import createOverlay from '../../utils/createOverlay';
import Dialog from '../../components/Dialog';
import IconButton from '../../components/IconButton';
import InGameActions from '../../actions/InGameActions';
import InGameActions from '../../_actions/InGameActions';
import InGameControls from './InGameControls';
import InGameEdit from './InGameEdit';
import InGameStore from '../../stores/InGameStore';
@@ -16,8 +16,8 @@ import TextField from '../../components/TextField';
import classNames from 'classnames';
export default class InGame extends Component {
state = {
state = {
options: InGameStore.getOptions(),
fighters: InGameStore.getFighters(),
status: InGameStore.getStatus(),
@@ -29,8 +29,8 @@ export default class InGame extends Component {
editCast: InGameStore.getEditCast(),
editDuplicate: InGameStore.getEditDuplicate()
};
_updateInGameStore = () => this.setState({
_updateInGameStore = () => this.setState({
options: InGameStore.getOptions(),
fighters: InGameStore.getFighters(),
status: InGameStore.getStatus(),
@@ -42,15 +42,15 @@ export default class InGame extends Component {
editCast: InGameStore.getEditCast(),
editDuplicate: InGameStore.getEditDuplicate()
});
componentDidMount() {
InGameStore.addChangeListener(this._updateInGameStore );
}
componentWillUnmount() {
InGameStore.removeChangeListener(this._updateInGameStore );
}
load = () => InGameActions.load();
resetAll = () => createOverlay(
<Dialog
@@ -63,9 +63,9 @@ export default class InGame extends Component {
</Dialog>
);
addFighter = () => InGameActions.addFighter();
setOnline = event => InGameActions.setOnline(event.target.value);
render() {
var className = classNames('ingame-table', {
+7 -7
View File
@@ -1,18 +1,18 @@
import Checkbox from '../../components/Checkbox';
import IconButton from '../../components/IconButton';
import InGameActions from '../../actions/InGameActions';
import InGameActions from '../../_actions/InGameActions';
import React, { Component, PropTypes } from 'react';
import classNames from 'classnames';
export default class InGameControls extends Component {
static propTypes = {
maxIni: PropTypes.number.isRequired,
options: PropTypes.object.isRequired,
status: PropTypes.array.isRequired,
usedPhases: PropTypes.array.isRequired
};
resetAll = () => InGameActions.resetAll();
resetPhases = () => InGameActions.resetPhases();
resetHealth = () => InGameActions.resetHealth();
@@ -21,13 +21,13 @@ export default class InGameControls extends Component {
previousPhase = () => InGameActions.previousPhase();
nextPhase = () => InGameActions.nextPhase();
switchOption = option => InGameActions.switchOption(option);
render() {
const previousPhaseClassName = classNames( 'previous-phase', this.props.status[0] === 1 && this.props.status[1] === this.props.maxIni && 'disabled' );
const nextPhaseIcon = (this.props.status[1] == 1 || this.props.status[1] == this.props.usedPhases[this.props.usedPhases.length - 1]) ? '\uE5C8' : '\uE409';
return (
<div className="ingame-controls options">
<div className="rounds">
+3 -3
View File
@@ -1,12 +1,12 @@
import React, { Component } from 'react';
import InGameActions from '../../actions/InGameActions';
import InGameActions from '../../_actions/InGameActions';
import BorderButton from '../../components/BorderButton';
import Dropdown from '../../components/Dropdown';
import Slidein from '../../components/Slidein';
import TextField from '../../components/TextField';
export default class InGameEdit extends Component {
static propTypes = {
editCast: React.PropTypes.string.isRequired,
editDuplicate: React.PropTypes.string.isRequired,
@@ -25,7 +25,7 @@ export default class InGameEdit extends Component {
duplicateFighter = () => InGameActions.duplicateFighter();
removeFighter = () => InGameActions.removeFighter();
closeEdit = () => InGameActions.closeEdit();
render() {
return (
<Slidein isOpen={this.props.editIndex > -1} close={this.closeEdit}>
+6 -6
View File
@@ -1,4 +1,4 @@
import InGameActions from '../../actions/InGameActions';
import InGameActions from '../../_actions/InGameActions';
import React, { Component } from 'react';
import classNames from 'classnames';
@@ -8,12 +8,12 @@ export default class InGameTableRight extends Component {
fighters: React.PropTypes.array.isRequired,
options: React.PropTypes.object.isRequired
};
useEndurance = id => InGameActions.useEndurance(id);
useAction = id => InGameActions.useAction(id);
useFreeAction = id => InGameActions.useFreeAction(id);
edit = id => InGameActions.edit(id);
render() {
return (
<div className="ingame-table-right">
@@ -29,9 +29,9 @@ export default class InGameTableRight extends Component {
<tbody>
{
this.props.fighters.map((fighter) => {
const className = classNames(fighter.deac && 'deac', fighter.type == 'f' && 'enemy');
const actionsElement = fighter.cast > 0 ? (
<td className="a">
<div onClick={this.useAction.bind(null, fighter.id)}>
@@ -45,7 +45,7 @@ export default class InGameTableRight extends Component {
</div>
</td>
);
return (
<tr key={'igtr-' + fighter.id} className={className}>
<td className="au">
+6 -6
View File
@@ -16,7 +16,7 @@ import ProfessionStore from '../../stores/ProfessionStore';
import ProfessionVariantStore from '../../stores/ProfessionVariantStore';
import RaceStore from '../../stores/RaceStore';
import PhaseStore from '../../stores/PhaseStore';
import ProfileActions from '../../actions/ProfileActions';
import ProfileActions from '../../_actions/ProfileActions';
import ProfileStore from '../../stores/ProfileStore';
import * as React from 'react';
import Scroll from '../../components/Scroll';
@@ -47,7 +47,7 @@ interface ProfileOverviewState {
}
export default class ProfileOverview extends React.Component<undefined, ProfileOverviewState> {
state = {
ap: APStore.getTotal(),
advActive: DisAdvStore.getActiveForView(true),
@@ -56,19 +56,19 @@ export default class ProfileOverview extends React.Component<undefined, ProfileO
phase: PhaseStore.get(),
editName: false
};
_updateAPStore = () => this.setState({ ap: APStore.getTotal() } as ProfileOverviewState);
_updateProfileStore = () => this.setState(ProfileStore.getAll() as ProfileOverviewState);
_updatePhaseStore = () => this.setState({
phase: PhaseStore.get()
} as ProfileOverviewState);
componentDidMount() {
APStore.addChangeListener(this._updateAPStore );
PhaseStore.addChangeListener(this._updatePhaseStore );
ProfileStore.addChangeListener(this._updateProfileStore );
}
componentWillUnmount() {
APStore.removeChangeListener(this._updateAPStore );
PhaseStore.removeChangeListener(this._updatePhaseStore );
@@ -135,7 +135,7 @@ export default class ProfileOverview extends React.Component<undefined, ProfileO
<span className="profession">
{(() => {
let { name, subname } = ProfessionStore.getCurrent();
if (typeof name === 'object') {
name = name[this.state.sex];
}
+4 -4
View File
@@ -1,5 +1,5 @@
import Dialog from '../../components/Dialog';
import ProfileActions from '../../actions/ProfileActions';
import ProfileActions from '../../_actions/ProfileActions';
import React, { Component, PropTypes } from 'react';
import TextField from '../../components/TextField';
@@ -13,17 +13,17 @@ interface OverviewAddAPState {
export default class OverviewAddAP extends Component<OverviewAddAPProps, OverviewAddAPState> {
static propTypes = {
static propTypes = {
node: PropTypes.any
};
state = {
value: ''
};
onChange = e => this.setState({ value: e.target.value });
addAP = () => ProfileActions.addAP(parseInt(this.state.value));
render() {
const { value } = this.state;
+4 -4
View File
@@ -1,7 +1,7 @@
import AvatarWrapper from '../../components/Avatar';
import Dialog from '../../components/Dialog';
import Dropdown from '../../components/Dropdown';
import ProfileActions from '../../actions/ProfileActions';
import ProfileActions from '../../_actions/ProfileActions';
import React, { Component, PropTypes } from 'react';
import TextField from '../../components/TextField';
@@ -58,7 +58,7 @@ function Source({ extern, file, fileValid, filePreview, source, changeExtern, ch
export default class ProfileAvatarChange extends Component {
static props = {
static props = {
node: PropTypes.node
};
@@ -69,7 +69,7 @@ export default class ProfileAvatarChange extends Component {
filePreview: '',
fileValid: false
};
changeSource = source => this.setState({ source });
changeExtern = event => this.setState({ extern: event.target.value });
changeFile = event => {
@@ -87,7 +87,7 @@ export default class ProfileAvatarChange extends Component {
}
};
load = () => ProfileActions.changeAvatar(this.state);
render() {
const { source, extern, fileValid } = this.state;
+2 -2
View File
@@ -1,12 +1,12 @@
import Dropdown from '../../components/Dropdown';
import IconButton from '../../components/IconButton';
import InputButtonGroup from '../../components/InputButtonGroup';
import ProfileActions from '../../actions/ProfileActions';
import ProfileActions from '../../_actions/ProfileActions';
import React, { Component, PropTypes } from 'react';
import TextField from '../../components/TextField';
export default class OverviewPersonalData extends Component {
static propTypes = {
age: PropTypes.string.isRequired,
characteristics: PropTypes.string.isRequired,
+4 -4
View File
@@ -1,6 +1,6 @@
import Checkbox from '../../components/Checkbox';
import { CultureInstance } from '../../utils/data/Culture';
import CultureActions from '../../actions/CultureActions';
import CultureActions from '../../_actions/CultureActions';
import CulturesListItem from './CulturesListItem';
import CultureStore from '../../stores/CultureStore';
import Dropdown from '../../components/Dropdown';
@@ -40,18 +40,18 @@ export default class Cultures extends Component<Props, State> {
};
state = getCultureStore();
_updateCultureStore = () => this.setState(getCultureStore());
filter = event => CultureActions.filter(event.target.value);
sort = option => CultureActions.sort(option);
changeValueVisibility = () => CultureActions.changeValueVisibility();
changeView = view => CultureActions.changeView(view);
componentDidMount() {
CultureStore.addChangeListener(this._updateCultureStore);
}
componentWillUnmount() {
CultureStore.removeChangeListener(this._updateCultureStore);
}
+1 -1
View File
@@ -1,5 +1,5 @@
import BorderButton from '../../components/BorderButton';
import CultureActions from '../../actions/CultureActions';
import CultureActions from '../../_actions/CultureActions';
import Culture, { CultureInstance } from '../../utils/data/Culture';
import { get } from '../../stores/ListStore';
import React, { Component, PropTypes } from 'react';
+6 -6
View File
@@ -4,10 +4,10 @@ import Dropdown from '../../components/Dropdown';
import { filterAndSort } from '../../utils/ListUtils';
import RadioButtonGroup from '../../components/RadioButtonGroup';
import React, { Component, PropTypes } from 'react';
import ProfessionActions from '../../actions/ProfessionActions';
import ProfessionActions from '../../_actions/ProfessionActions';
import ProfessionsListItem from './ProfessionsListItem';
import ProfessionStore from '../../stores/ProfessionStore';
import ProfessionVariantActions from '../../actions/ProfessionVariantActions';
import ProfessionVariantActions from '../../_actions/ProfessionVariantActions';
import ProfessionVariantStore from '../../stores/ProfessionVariantStore';
import ProfileStore from '../../stores/ProfileStore';
import Scroll from '../../components/Scroll';
@@ -39,7 +39,7 @@ export default class Professions extends Component<any, State> {
currentVID: ProfessionVariantStore.getCurrentID(),
showAddSlidein: false
};
_updateProfessionStore = () => this.setState({
professions: ProfessionStore.getAll(),
currentID: ProfessionStore.getCurrentID(),
@@ -58,12 +58,12 @@ export default class Professions extends Component<any, State> {
hideAddSlidein = () => this.setState({ showAddSlidein: false } as State);
selectProfessionVariant = id => ProfessionVariantActions.selectProfessionVariant(id);
componentDidMount() {
ProfessionStore.addChangeListener(this._updateProfessionStore);
ProfessionVariantStore.addChangeListener(this._updateProfessionVariantStore);
}
componentWillUnmount() {
ProfessionStore.removeChangeListener(this._updateProfessionStore);
ProfessionVariantStore.removeChangeListener(this._updateProfessionVariantStore);
@@ -72,7 +72,7 @@ export default class Professions extends Component<any, State> {
render() {
const { currentID, currentVID, filterText, professions, showAddSlidein, showAllProfessions, sortOrder } = this.state;
const currentCulture = CultureStore.getCurrent();
const sex = ProfileStore.getSex();
+2 -2
View File
@@ -1,8 +1,8 @@
import BorderButton from '../../components/BorderButton';
import CultureStore from '../../stores/CultureStore';
import Profession, { ProfessionInstance } from '../../utils/data/Profession';
import ProfessionActions from '../../actions/ProfessionActions';
import ProfessionVariantActions from '../../actions/ProfessionVariantActions';
import ProfessionActions from '../../_actions/ProfessionActions';
import ProfessionVariantActions from '../../_actions/ProfessionVariantActions';
import ProfessionVariantStore from '../../stores/ProfessionVariantStore';
import ProfileStore from '../../stores/ProfileStore';
import RadioButtonGroup from '../../components/RadioButtonGroup';
+4 -4
View File
@@ -3,7 +3,7 @@ import { filterAndSort } from '../../utils/ListUtils';
import { RaceInstance } from '../../utils/data/Race';
import RadioButtonGroup from '../../components/RadioButtonGroup';
import React, { Component, PropTypes } from 'react';
import RaceActions from '../../actions/RaceActions';
import RaceActions from '../../_actions/RaceActions';
import RacesListItem from './RacesListItem';
import RaceStore from '../../stores/RaceStore';
import Scroll from '../../components/Scroll';
@@ -36,17 +36,17 @@ export default class Races extends Component<Props, State> {
};
state = getRaceStore();
_updateRaceStore = () => this.setState(getRaceStore());
filter = event => RaceActions.filter(event.target.value);
sort = option => RaceActions.sort(option);
changeValueVisibility = () => RaceActions.changeValueVisibility();
componentDidMount() {
RaceStore.addChangeListener(this._updateRaceStore);
}
componentWillUnmount() {
RaceStore.removeChangeListener(this._updateRaceStore);
}
+1 -1
View File
@@ -1,7 +1,7 @@
import BorderButton from '../../components/BorderButton';
import Race, { RaceInstance } from '../../utils/data/Race';
import React, { Component, PropTypes } from 'react';
import RaceActions from '../../actions/RaceActions';
import RaceActions from '../../_actions/RaceActions';
import VerticalList from '../../components/VerticalList';
import classNames from 'classnames';
+2 -2
View File
@@ -4,7 +4,7 @@ import CultureStore from '../../stores/CultureStore';
import Dropdown from '../../components/Dropdown';
import { get, getAllByCategory, getAllByCategoryGroup } from '../../stores/ListStore';
import React, { Component, PropTypes } from 'react';
import ProfessionActions from '../../actions/ProfessionActions';
import ProfessionActions from '../../_actions/ProfessionActions';
import ProfessionStore from '../../stores/ProfessionStore';
import ProfessionVariantStore from '../../stores/ProfessionVariantStore';
import RaceStore from '../../stores/RaceStore';
@@ -143,7 +143,7 @@ export default class Selections extends Component<Props, State> {
var langLitcElement = null;
var langLitcApLeft = 0;
if (professionSel.has('lang_lit')) {
let active = langLitc;
let params = professionSel.get('lang_lit');
+7 -7
View File
@@ -1,7 +1,7 @@
import { CombatTechniqueInstance } from '../../utils/data/CombatTechnique';
import { filterAndSort } from '../../utils/ListUtils';
import { get } from '../../stores/ListStore';
import CombatTechniquesActions from '../../actions/CombatTechniquesActions';
import CombatTechniquesActions from '../../_actions/CombatTechniquesActions';
import CombatTechniquesStore from '../../stores/CombatTechniquesStore';
import PhaseStore from '../../stores/PhaseStore';
import RadioButtonGroup from '../../components/RadioButtonGroup';
@@ -18,15 +18,15 @@ interface State {
}
export default class CombatTechniques extends Component<any, State> {
state = {
state = {
combattechniques: CombatTechniquesStore.getAll(),
filterText: CombatTechniquesStore.getFilter(),
sortOrder: CombatTechniquesStore.getSortOrder(),
phase: PhaseStore.get()
};
_updateCombatTechniquesStore = () => this.setState({
_updateCombatTechniquesStore = () => this.setState({
combattechniques: CombatTechniquesStore.getAll(),
filterText: CombatTechniquesStore.getFilter(),
sortOrder: CombatTechniquesStore.getSortOrder()
@@ -36,11 +36,11 @@ export default class CombatTechniques extends Component<any, State> {
sort = option => CombatTechniquesActions.sort(option);
addPoint = id => CombatTechniquesActions.addPoint(id);
removePoint = id => CombatTechniquesActions.removePoint(id);
componentDidMount() {
CombatTechniquesStore.addChangeListener(this._updateCombatTechniquesStore );
}
componentWillUnmount() {
CombatTechniquesStore.removeChangeListener(this._updateCombatTechniquesStore );
}
+7 -7
View File
@@ -1,4 +1,4 @@
import CombatTechniquesActions from '../../actions/CombatTechniquesActions';
import CombatTechniquesActions from '../../_actions/CombatTechniquesActions';
import CombatTechniquesStore from '../../stores/CombatTechniquesStore';
import { get } from '../../stores/ListStore';
import * as ListUtils from '../../utils/ListUtils';
@@ -12,15 +12,15 @@ import TextField from '../../components/TextField';
const GROUPS = ['Nahkampf', 'Fernkampf'];
export default class extends Component {
state = {
state = {
list: CombatTechniquesStore.getAll(),
filter: CombatTechniquesStore.getFilter(),
sortOrder: CombatTechniquesStore.getSortOrder(),
phase: PhaseStore.get()
};
_updateCombatTechniquesStore = () => this.setState({
_updateCombatTechniquesStore = () => this.setState({
list: CombatTechniquesStore.getAll(),
filter: CombatTechniquesStore.getFilter(),
sortOrder: CombatTechniquesStore.getSortOrder()
@@ -30,11 +30,11 @@ export default class extends Component {
sort = option => CombatTechniquesActions.sort(option);
addPoint = id => CombatTechniquesActions.addPoint(id);
removePoint = id => CombatTechniquesActions.removePoint(id);
componentDidMount() {
CombatTechniquesStore.addChangeListener(this._updateCombatTechniquesStore );
}
componentWillUnmount() {
CombatTechniquesStore.removeChangeListener(this._updateCombatTechniquesStore );
}
+7 -7
View File
@@ -1,7 +1,7 @@
import { filterAndSort } from '../../utils/ListUtils';
import { LiturgyInstance } from '../../utils/data/Liturgy';
import BorderButton from '../../components/BorderButton';
import LiturgiesActions from '../../actions/LiturgiesActions';
import LiturgiesActions from '../../_actions/LiturgiesActions';
import LiturgiesStore from '../../stores/LiturgiesStore';
import PhaseStore from '../../stores/PhaseStore';
import RadioButtonGroup from '../../components/RadioButtonGroup';
@@ -21,8 +21,8 @@ interface State {
}
export default class Liturgies extends Component<any, State> {
state = {
state = {
liturgies: LiturgiesStore.getAll(),
addChantsDisabled: LiturgiesStore.isActivationDisabled(),
filterText: LiturgiesStore.getFilterText(),
@@ -30,8 +30,8 @@ export default class Liturgies extends Component<any, State> {
phase: PhaseStore.get(),
showAddSlidein: false
};
_updateLiturgiesStore = () => this.setState({
_updateLiturgiesStore = () => this.setState({
liturgies: LiturgiesStore.getAll(),
addChantsDisabled: LiturgiesStore.isActivationDisabled(),
filterText: LiturgiesStore.getFilterText(),
@@ -46,11 +46,11 @@ export default class Liturgies extends Component<any, State> {
removePoint = id => LiturgiesActions.removePoint(id);
showAddSlidein = () => this.setState({ showAddSlidein: true } as State);
hideAddSlidein = () => this.setState({ showAddSlidein: false } as State);
componentDidMount() {
LiturgiesStore.addChangeListener(this._updateLiturgiesStore );
}
componentWillUnmount() {
LiturgiesStore.removeChangeListener(this._updateLiturgiesStore );
}
+7 -7
View File
@@ -6,7 +6,7 @@ import RadioButtonGroup from '../../components/RadioButtonGroup';
import React, { Component } from 'react';
import Scroll from '../../components/Scroll';
import Slidein from '../../components/Slidein';
import SpecialAbilitiesActions from '../../actions/SpecialAbilitiesActions';
import SpecialAbilitiesActions from '../../_actions/SpecialAbilitiesActions';
import SpecialAbilitiesListAddItem, { Deactive } from './SpecialAbilitiesListAddItem';
import SpecialAbilitiesListRemoveItem, { Active } from './SpecialAbilitiesListRemoveItem';
import SpecialAbilitiesStore from '../../stores/SpecialAbilitiesStore';
@@ -22,8 +22,8 @@ interface State {
}
export default class SpecialAbilities extends Component<any, State> {
state = {
state = {
saActive: SpecialAbilitiesStore.getActiveForView(),
saDeactive: SpecialAbilitiesStore.getDeactiveForView(),
filterText: SpecialAbilitiesStore.getFilter(),
@@ -31,8 +31,8 @@ export default class SpecialAbilities extends Component<any, State> {
phase: PhaseStore.get(),
showAddSlidein: false
};
_updateSpecialAbilitiesStore = () => this.setState({
_updateSpecialAbilitiesStore = () => this.setState({
saActive: SpecialAbilitiesStore.getActiveForView(),
saDeactive: SpecialAbilitiesStore.getDeactiveForView(),
filterText: SpecialAbilitiesStore.getFilter(),
@@ -46,11 +46,11 @@ export default class SpecialAbilities extends Component<any, State> {
removeFromList = id => SpecialAbilitiesActions.removeFromList(id);
showAddSlidein = () => this.setState({ showAddSlidein: true } as State);
hideAddSlidein = () => this.setState({ showAddSlidein: false } as State);
componentDidMount() {
SpecialAbilitiesStore.addChangeListener(this._updateSpecialAbilitiesStore );
}
componentWillUnmount() {
SpecialAbilitiesStore.removeChangeListener(this._updateSpecialAbilitiesStore );
}
@@ -1,5 +1,5 @@
import BorderButton from '../../components/BorderButton';
import SpecialAbilitiesActions from '../../actions/SpecialAbilitiesActions';
import SpecialAbilitiesActions from '../../_actions/SpecialAbilitiesActions';
import { get } from '../../stores/ListStore';
import Dropdown from '../../components/Dropdown';
import React, { Component, PropTypes } from 'react';
@@ -1,5 +1,5 @@
import BorderButton from '../../components/BorderButton';
import SpecialAbilitiesActions from '../../actions/SpecialAbilitiesActions';
import SpecialAbilitiesActions from '../../_actions/SpecialAbilitiesActions';
import Dropdown from '../../components/Dropdown';
import React, { Component, PropTypes } from 'react';
+8 -8
View File
@@ -7,7 +7,7 @@ import React, { Component } from 'react';
import Scroll from '../../components/Scroll';
import SkillListItem from './SkillListItem';
import Slidein from '../../components/Slidein';
import SpellsActions from '../../actions/SpellsActions';
import SpellsActions from '../../_actions/SpellsActions';
import SpellsStore from '../../stores/SpellsStore';
import TextField from '../../components/TextField';
@@ -22,8 +22,8 @@ interface State {
}
export default class Spells extends Component<any, State> {
state = {
state = {
spells: SpellsStore.getAll(),
addSpellsDisabled: SpellsStore.isActivationDisabled(),
areMaxUnfamiliar: SpellsStore.areMaxUnfamiliar(),
@@ -32,8 +32,8 @@ export default class Spells extends Component<any, State> {
phase: PhaseStore.get(),
showAddSlidein: false
};
_updateSpellsStore = () => this.setState({
_updateSpellsStore = () => this.setState({
spells: SpellsStore.getAll(),
addSpellsDisabled: SpellsStore.isActivationDisabled(),
areMaxUnfamiliar: SpellsStore.areMaxUnfamiliar(),
@@ -49,11 +49,11 @@ export default class Spells extends Component<any, State> {
removePoint = id => SpellsActions.removePoint(id);
showAddSlidein = () => this.setState({ showAddSlidein: true } as State);
hideAddSlidein = () => this.setState({ showAddSlidein: false } as State);
componentDidMount() {
SpellsStore.addChangeListener(this._updateSpellsStore );
}
componentWillUnmount() {
SpellsStore.removeChangeListener(this._updateSpellsStore );
}
@@ -91,7 +91,7 @@ export default class Spells extends Component<any, State> {
}
else {
listDeactive.push(e);
}
}
}
});
+6 -6
View File
@@ -9,7 +9,7 @@ import PhaseStore from '../../stores/PhaseStore';
import RadioButtonGroup from '../../components/RadioButtonGroup';
import Scroll from '../../components/Scroll';
import SkillListItem from './SkillListItem';
import TalentsActions from '../../actions/TalentsActions';
import TalentsActions from '../../_actions/TalentsActions';
import TalentsStore from '../../stores/TalentsStore';
import TextField from '../../components/TextField';
@@ -23,8 +23,8 @@ interface State {
}
export default class Talents extends Component<any, State> {
state = {
state = {
talents: TalentsStore.getAll(),
filterText: TalentsStore.getFilter(),
sortOrder: TalentsStore.getSortOrder(),
@@ -32,7 +32,7 @@ export default class Talents extends Component<any, State> {
currentCulture: CultureStore.getCurrent(),
phase: PhaseStore.get()
};
_updateTalentsStore = () => this.setState({
talents: TalentsStore.getAll(),
filterText: TalentsStore.getFilter(),
@@ -45,11 +45,11 @@ export default class Talents extends Component<any, State> {
changeTalentRating = () => TalentsActions.changeTalentRating();
addPoint = id => TalentsActions.addPoint(id);
removePoint = id => TalentsActions.removePoint(id);
componentDidMount() {
TalentsStore.addChangeListener(this._updateTalentsStore );
}
componentWillUnmount() {
TalentsStore.removeChangeListener(this._updateTalentsStore );
}