Compare commits
16 Commits
92b3df335a
...
91c9986be7
Author | SHA1 | Date |
---|---|---|
Florian Hartwich | 91c9986be7 | |
Florian Hartwich | 711e82e6cc | |
Florian Hartwich | b2dd827f98 | |
Florian Hartwich | 6eca7c581e | |
Florian Hartwich | 3361caaf4a | |
Florian Hartwich | 7638828645 | |
Florian Hartwich | 66244467a5 | |
Florian Hartwich | e6d1f7c5ba | |
Florian Hartwich | 6123a39e55 | |
Florian Hartwich | 51160e6455 | |
Florian Hartwich | 5bbb7e1c1f | |
Florian Hartwich | be93bc5860 | |
Florian Hartwich | 7442a7ed22 | |
Florian Hartwich | c09752d4c4 | |
Florian Hartwich | f3c1c9a92a | |
Florian Hartwich | 8bdc6713b8 |
|
@ -6,7 +6,8 @@ tmp/
|
|||
etc/
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
node_modules
|
||||
package-lock.json
|
||||
|
||||
# IDEs and editors
|
||||
/.idea
|
||||
|
@ -49,7 +50,6 @@ mongodb-data/
|
|||
backup/
|
||||
|
||||
.idea/
|
||||
node_modules
|
||||
*/nbproject*
|
||||
.npm/
|
||||
.bash_history
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 95 B |
|
@ -14,26 +14,39 @@ deleteOldest() {
|
|||
}
|
||||
|
||||
# array of available collection names
|
||||
col=(app_user awarding decoration rank squad user promotion player war)
|
||||
col=(app_user awarding decoration rank squad user promotion player war campaign)
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
DATE=$(date '+%Y-%m-%d')
|
||||
mkdir -p ${DATE}/resource
|
||||
cp -R ../api/resource/ ${DATE}/
|
||||
else
|
||||
DATE=${1}
|
||||
tar -xzf ${DATE}.tar.gz
|
||||
rm -rf ../api/resource
|
||||
cp -Rv ${DATE}/resource ../api/
|
||||
|
||||
fi
|
||||
|
||||
for i in "${col[@]}"
|
||||
do
|
||||
# provide date for restore process, if data import is needed
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
DATE=$(date '+%Y-%m-%d')
|
||||
mongoexport --db cc --collection $i --out ${DATE}/collections/${i}.json;
|
||||
cp -R ../api/resource ${DATE}/
|
||||
tar -zcf ${DATE}.tar.gz ${DATE}
|
||||
rm -R ${DATE}
|
||||
if [ $(ls -l | grep -c ^d) -gt 5 ]; then
|
||||
deleteOldest
|
||||
fi
|
||||
else
|
||||
tar -xzf ${1}.tar.gz
|
||||
mongoimport --db cc --collection $i --drop --file ${1}/collections/${i}.json
|
||||
rm -rf ../api/resource
|
||||
cp -Rv ${1}/resource ../api/
|
||||
rm -R ${1}
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
tar -zcf ${DATE}.tar.gz ${DATE}
|
||||
fi
|
||||
|
||||
rm -rf ${DATE}
|
||||
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
cd $(dirname $0)
|
||||
|
||||
# array of files to minify
|
||||
FILES=(inline main polyfills scripts styles vendor)
|
||||
FILES=(inline.bundle main.bundle polyfills.bundle scripts.bundle styles.bundle vendor.bundle 0.chunk 1.chunk 2.chunk 3.chunk 4.chunk 5.chunk 6.chunk 7.chunk)
|
||||
OPTIONS="-c toplevel,dead_code=true,unused=true"
|
||||
|
||||
for i in "${FILES[@]}"
|
||||
do
|
||||
echo "minify ${i} ..."
|
||||
$(npm bin)/uglifyjs public/${i}.bundle.js ${OPTIONS} -o public/${i}.bundle.js
|
||||
rm -f public/${i}.bundle.js.map
|
||||
$(npm bin)/uglifyjs public/${i}.js ${OPTIONS} -o public/${i}.js
|
||||
rm -f public/${i}.js.map
|
||||
done
|
||||
|
|
|
@ -1,683 +0,0 @@
|
|||
{
|
||||
"name": "opt-cc",
|
||||
"version": "1.3.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"ajv": {
|
||||
"version": "4.11.8",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz",
|
||||
"integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"co": "4.6.0",
|
||||
"json-stable-stringify": "1.0.1"
|
||||
}
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz",
|
||||
"integrity": "sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk=",
|
||||
"dev": true
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz",
|
||||
"integrity": "sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94=",
|
||||
"dev": true
|
||||
},
|
||||
"asn1": {
|
||||
"version": "0.2.3",
|
||||
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz",
|
||||
"integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=",
|
||||
"dev": true
|
||||
},
|
||||
"assert-plus": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz",
|
||||
"integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=",
|
||||
"dev": true
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
|
||||
"dev": true
|
||||
},
|
||||
"aws-sign2": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz",
|
||||
"integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=",
|
||||
"dev": true
|
||||
},
|
||||
"aws4": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz",
|
||||
"integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=",
|
||||
"dev": true
|
||||
},
|
||||
"bcrypt-pbkdf": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz",
|
||||
"integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"tweetnacl": "0.14.5"
|
||||
}
|
||||
},
|
||||
"boom": {
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz",
|
||||
"integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"hoek": "2.16.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"hoek": {
|
||||
"version": "2.16.3",
|
||||
"resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
|
||||
"integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"caseless": {
|
||||
"version": "0.12.0",
|
||||
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
|
||||
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
|
||||
"dev": true
|
||||
},
|
||||
"chalk": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz",
|
||||
"integrity": "sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "1.1.0",
|
||||
"escape-string-regexp": "1.0.5",
|
||||
"has-ansi": "0.1.0",
|
||||
"strip-ansi": "0.3.0",
|
||||
"supports-color": "0.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"supports-color": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz",
|
||||
"integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"co": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
|
||||
"integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
|
||||
"dev": true
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz",
|
||||
"integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"delayed-stream": "1.0.0"
|
||||
}
|
||||
},
|
||||
"commander": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.6.0.tgz",
|
||||
"integrity": "sha1-nfflL7Kgyw+4kFjugMMQQiXzfh0=",
|
||||
"dev": true
|
||||
},
|
||||
"concurrently": {
|
||||
"version": "3.5.0",
|
||||
"resolved": "https://registry.npmjs.org/concurrently/-/concurrently-3.5.0.tgz",
|
||||
"integrity": "sha1-jPG3cHppFqeKT/W3e7BN7FSzebI=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "0.5.1",
|
||||
"commander": "2.6.0",
|
||||
"date-fns": "1.28.5",
|
||||
"lodash": "4.17.4",
|
||||
"rx": "2.3.24",
|
||||
"spawn-command": "0.0.2-1",
|
||||
"supports-color": "3.2.3",
|
||||
"tree-kill": "1.1.0"
|
||||
}
|
||||
},
|
||||
"core-js": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz",
|
||||
"integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4=",
|
||||
"dev": true
|
||||
},
|
||||
"cryptiles": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz",
|
||||
"integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"boom": "2.10.1"
|
||||
}
|
||||
},
|
||||
"dashdash": {
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
|
||||
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"assert-plus": "1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"assert-plus": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
|
||||
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"date-fns": {
|
||||
"version": "1.28.5",
|
||||
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.28.5.tgz",
|
||||
"integrity": "sha1-JXz8RdMi30XvVlhmWWfuhBzXP68=",
|
||||
"dev": true
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
|
||||
"dev": true
|
||||
},
|
||||
"ecc-jsbn": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz",
|
||||
"integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"jsbn": "0.1.1"
|
||||
}
|
||||
},
|
||||
"escape-string-regexp": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
|
||||
"dev": true
|
||||
},
|
||||
"extend": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
|
||||
"integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=",
|
||||
"dev": true
|
||||
},
|
||||
"extsprintf": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz",
|
||||
"integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=",
|
||||
"dev": true
|
||||
},
|
||||
"forever-agent": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
|
||||
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=",
|
||||
"dev": true
|
||||
},
|
||||
"form-data": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz",
|
||||
"integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"asynckit": "0.4.0",
|
||||
"combined-stream": "1.0.5",
|
||||
"mime-types": "2.1.15"
|
||||
}
|
||||
},
|
||||
"getpass": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
|
||||
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"assert-plus": "1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"assert-plus": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
|
||||
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"har-schema": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz",
|
||||
"integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=",
|
||||
"dev": true
|
||||
},
|
||||
"har-validator": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz",
|
||||
"integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ajv": "4.11.8",
|
||||
"har-schema": "1.0.5"
|
||||
}
|
||||
},
|
||||
"has-ansi": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz",
|
||||
"integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "0.2.1"
|
||||
}
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
|
||||
"integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=",
|
||||
"dev": true
|
||||
},
|
||||
"hawk": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz",
|
||||
"integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"boom": "2.10.1",
|
||||
"cryptiles": "2.0.5",
|
||||
"hoek": "2.16.3",
|
||||
"sntp": "1.0.9"
|
||||
},
|
||||
"dependencies": {
|
||||
"hoek": {
|
||||
"version": "2.16.3",
|
||||
"resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
|
||||
"integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"hoek": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/hoek/-/hoek-4.1.1.tgz",
|
||||
"integrity": "sha1-nMVz/7ore0CPtenCoTeWvpTN3Ok=",
|
||||
"dev": true
|
||||
},
|
||||
"http-signature": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz",
|
||||
"integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"assert-plus": "0.2.0",
|
||||
"jsprim": "1.4.0",
|
||||
"sshpk": "1.13.1"
|
||||
}
|
||||
},
|
||||
"is-typedarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
|
||||
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
|
||||
"dev": true
|
||||
},
|
||||
"isemail": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/isemail/-/isemail-2.2.1.tgz",
|
||||
"integrity": "sha1-A1PT2aYpUQgMJiwqoKQrjqjp4qY=",
|
||||
"dev": true
|
||||
},
|
||||
"isstream": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
|
||||
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
|
||||
"dev": true
|
||||
},
|
||||
"items": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/items/-/items-2.1.1.tgz",
|
||||
"integrity": "sha1-i9FtnIOxlSneWuoyGsqtp4NkoZg=",
|
||||
"dev": true
|
||||
},
|
||||
"joi": {
|
||||
"version": "9.2.0",
|
||||
"resolved": "https://registry.npmjs.org/joi/-/joi-9.2.0.tgz",
|
||||
"integrity": "sha1-M4WseQGSEwy+Iw6ALsAskhW7/to=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"hoek": "4.1.1",
|
||||
"isemail": "2.2.1",
|
||||
"items": "2.1.1",
|
||||
"moment": "2.18.1",
|
||||
"topo": "2.0.2"
|
||||
}
|
||||
},
|
||||
"jsbn": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
|
||||
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"json-schema": {
|
||||
"version": "0.2.3",
|
||||
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
|
||||
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=",
|
||||
"dev": true
|
||||
},
|
||||
"json-stable-stringify": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
|
||||
"integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"jsonify": "0.0.0"
|
||||
}
|
||||
},
|
||||
"json-stringify-safe": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
|
||||
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
|
||||
"dev": true
|
||||
},
|
||||
"jsonify": {
|
||||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
|
||||
"integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=",
|
||||
"dev": true
|
||||
},
|
||||
"jsprim": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz",
|
||||
"integrity": "sha1-o7h+QCmNjDgFUtjMdiigu5WiKRg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"assert-plus": "1.0.0",
|
||||
"extsprintf": "1.0.2",
|
||||
"json-schema": "0.2.3",
|
||||
"verror": "1.3.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"assert-plus": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
|
||||
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.4",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
|
||||
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=",
|
||||
"dev": true
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.27.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz",
|
||||
"integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=",
|
||||
"dev": true
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.15",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz",
|
||||
"integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mime-db": "1.27.0"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
||||
"dev": true
|
||||
},
|
||||
"moment": {
|
||||
"version": "2.18.1",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.18.1.tgz",
|
||||
"integrity": "sha1-w2GT3Tzhwu7SrbfIAtu8d6gbHA8=",
|
||||
"dev": true
|
||||
},
|
||||
"oauth-sign": {
|
||||
"version": "0.8.2",
|
||||
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz",
|
||||
"integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=",
|
||||
"dev": true
|
||||
},
|
||||
"performance-now": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz",
|
||||
"integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=",
|
||||
"dev": true
|
||||
},
|
||||
"punycode": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
|
||||
"integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
|
||||
"dev": true
|
||||
},
|
||||
"qs": {
|
||||
"version": "6.4.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz",
|
||||
"integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=",
|
||||
"dev": true
|
||||
},
|
||||
"request": {
|
||||
"version": "2.81.0",
|
||||
"resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz",
|
||||
"integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"aws-sign2": "0.6.0",
|
||||
"aws4": "1.6.0",
|
||||
"caseless": "0.12.0",
|
||||
"combined-stream": "1.0.5",
|
||||
"extend": "3.0.1",
|
||||
"forever-agent": "0.6.1",
|
||||
"form-data": "2.1.4",
|
||||
"har-validator": "4.2.1",
|
||||
"hawk": "3.1.3",
|
||||
"http-signature": "1.1.1",
|
||||
"is-typedarray": "1.0.0",
|
||||
"isstream": "0.1.2",
|
||||
"json-stringify-safe": "5.0.1",
|
||||
"mime-types": "2.1.15",
|
||||
"oauth-sign": "0.8.2",
|
||||
"performance-now": "0.2.0",
|
||||
"qs": "6.4.0",
|
||||
"safe-buffer": "5.1.1",
|
||||
"stringstream": "0.0.5",
|
||||
"tough-cookie": "2.3.2",
|
||||
"tunnel-agent": "0.6.0",
|
||||
"uuid": "3.1.0"
|
||||
}
|
||||
},
|
||||
"rx": {
|
||||
"version": "2.3.24",
|
||||
"resolved": "https://registry.npmjs.org/rx/-/rx-2.3.24.tgz",
|
||||
"integrity": "sha1-FPlQpCF9fjXapxu8vljv9o6ksrc=",
|
||||
"dev": true
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
|
||||
"integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=",
|
||||
"dev": true
|
||||
},
|
||||
"sntp": {
|
||||
"version": "1.0.9",
|
||||
"resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz",
|
||||
"integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"hoek": "2.16.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"hoek": {
|
||||
"version": "2.16.3",
|
||||
"resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
|
||||
"integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.5.6",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz",
|
||||
"integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI="
|
||||
},
|
||||
"spawn-command": {
|
||||
"version": "0.0.2-1",
|
||||
"resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz",
|
||||
"integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=",
|
||||
"dev": true
|
||||
},
|
||||
"sshpk": {
|
||||
"version": "1.13.1",
|
||||
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz",
|
||||
"integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"asn1": "0.2.3",
|
||||
"assert-plus": "1.0.0",
|
||||
"bcrypt-pbkdf": "1.0.1",
|
||||
"dashdash": "1.14.1",
|
||||
"ecc-jsbn": "0.1.1",
|
||||
"getpass": "0.1.7",
|
||||
"jsbn": "0.1.1",
|
||||
"tweetnacl": "0.14.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"assert-plus": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
|
||||
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"stringstream": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
|
||||
"integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=",
|
||||
"dev": true
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz",
|
||||
"integrity": "sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "0.2.1"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "3.2.3",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz",
|
||||
"integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "1.0.0"
|
||||
}
|
||||
},
|
||||
"topo": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/topo/-/topo-2.0.2.tgz",
|
||||
"integrity": "sha1-zVYVdSU5BXwNwEkaYhw7xvvh0YI=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"hoek": "4.1.1"
|
||||
}
|
||||
},
|
||||
"tough-cookie": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz",
|
||||
"integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"punycode": "1.4.1"
|
||||
}
|
||||
},
|
||||
"tree-kill": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.1.0.tgz",
|
||||
"integrity": "sha1-yWPc8DciiS7FnLpWnpQLcZVNFyk=",
|
||||
"dev": true
|
||||
},
|
||||
"tunnel-agent": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
|
||||
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "5.1.1"
|
||||
}
|
||||
},
|
||||
"tweetnacl": {
|
||||
"version": "0.14.5",
|
||||
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
|
||||
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"uglify-js": {
|
||||
"version": "3.0.26",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.0.26.tgz",
|
||||
"integrity": "sha512-+D/BjzuvT1oRMSkH0fuF3M/BCvDxDywmZasd1UTPPHsdsHZqJEAZSvrojgFlS7lrM3ZZWq5h7Bb5i96X1TbOJw==",
|
||||
"requires": {
|
||||
"commander": "2.11.0",
|
||||
"source-map": "0.5.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": {
|
||||
"version": "2.11.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz",
|
||||
"integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz",
|
||||
"integrity": "sha1-PdPT55Crwk17DToDT/q6vijrvAQ=",
|
||||
"dev": true
|
||||
},
|
||||
"verror": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz",
|
||||
"integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"extsprintf": "1.0.2"
|
||||
}
|
||||
},
|
||||
"wait-on": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wait-on/-/wait-on-2.0.2.tgz",
|
||||
"integrity": "sha1-CoT9BwJMb8Joyw6r5YW+IXqvK6o=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"core-js": "2.4.1",
|
||||
"joi": "9.2.0",
|
||||
"minimist": "1.2.0",
|
||||
"request": "2.81.0",
|
||||
"rx": "4.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"rx": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz",
|
||||
"integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "opt-cc",
|
||||
"version": "1.3.1",
|
||||
"version": "1.4.0",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {browser, element, by} from 'protractor';
|
||||
import {browser, by, element} from 'protractor';
|
||||
|
||||
|
||||
describe('Main Page Access', function () {
|
||||
|
@ -7,7 +7,7 @@ describe('Main Page Access', function () {
|
|||
browser.get('/')
|
||||
});
|
||||
|
||||
it('should open army overview initially', async() => {
|
||||
it('should open army overview initially', async () => {
|
||||
let elem = element(by.css('h1'));
|
||||
let text = elem.getText();
|
||||
expect(text).toBe("Übersicht über alle Spieler, Squads und Armeen");
|
||||
|
|
|
@ -13,13 +13,13 @@ module.exports = function (config) {
|
|||
require('@angular/cli/plugins/karma')
|
||||
],
|
||||
files: [
|
||||
{ pattern: './src/test.ts', watched: false }
|
||||
{pattern: './src/test.ts', watched: false}
|
||||
],
|
||||
preprocessors: {
|
||||
'./src/test.ts': ['@angular/cli']
|
||||
},
|
||||
mime: {
|
||||
'text/x-typescript': ['ts','tsx']
|
||||
'text/x-typescript': ['ts', 'tsx']
|
||||
},
|
||||
remapIstanbulReporter: {
|
||||
reports: {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -29,23 +29,24 @@ exports.config = {
|
|||
jasmineNodeOpts: {
|
||||
showColors: true,
|
||||
defaultTimeoutInterval: 30000,
|
||||
print: function() {}
|
||||
print: function () {
|
||||
}
|
||||
},
|
||||
useAllAngular2AppRoots: true,
|
||||
beforeLaunch: function() {
|
||||
beforeLaunch: function () {
|
||||
require('ts-node').register({
|
||||
project: 'e2e'
|
||||
});
|
||||
return new Promise(function(resolve){
|
||||
return new Promise(function (resolve) {
|
||||
reporter.beforeLaunch(resolve);
|
||||
});
|
||||
},
|
||||
afterLaunch: function(exitCode) {
|
||||
return new Promise(function(resolve){
|
||||
afterLaunch: function (exitCode) {
|
||||
return new Promise(function (resolve) {
|
||||
reporter.afterLaunch(resolve.bind(this, exitCode));
|
||||
});
|
||||
},
|
||||
onPrepare: function() {
|
||||
onPrepare: function () {
|
||||
jasmine.getEnv().addReporter(reporter);
|
||||
jasmine.getEnv().addReporter(new SpecReporter());
|
||||
},
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Protractor configuration file, see link for more information
|
||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||
|
||||
const { SpecReporter } = require('jasmine-spec-reporter');
|
||||
const {SpecReporter} = require('jasmine-spec-reporter');
|
||||
|
||||
exports.config= {
|
||||
exports.config = {
|
||||
allScriptsTimeout: 11000,
|
||||
specs: [
|
||||
'./e2e/**/*.e2e-spec.ts'
|
||||
|
@ -17,14 +17,15 @@ exports.config= {
|
|||
jasmineNodeOpts: {
|
||||
showColors: true,
|
||||
defaultTimeoutInterval: 30000,
|
||||
print: function() {}
|
||||
print: function () {
|
||||
}
|
||||
},
|
||||
beforeLaunch: function() {
|
||||
beforeLaunch: function () {
|
||||
require('ts-node').register({
|
||||
project: 'e2e/tsconfig.e2e.json'
|
||||
});
|
||||
},
|
||||
onPrepare() {
|
||||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
|
||||
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -61,7 +61,7 @@ export class AdminComponent {
|
|||
/**
|
||||
* compare ngValue with ngModel to assign selected element
|
||||
*/
|
||||
equals(o1: Squad , o2: Squad) {
|
||||
equals(o1: Squad, o2: Squad) {
|
||||
if (o1 && o2) {
|
||||
return o1._id === o2._id;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import {NgModule} from "@angular/core";
|
||||
import {AdminComponent} from "./admin.component";
|
||||
import {SharedModule} from "../shared.module";
|
||||
import {AppUserStore} from "../services/stores/app-user.store";
|
||||
import {AppUserService} from "../services/app-user-service/app-user.service";
|
||||
import {CommonModule} from "@angular/common";
|
||||
import {RouterModule} from "@angular/router";
|
||||
|
||||
@NgModule({
|
||||
declarations: [AdminComponent],
|
||||
imports: [CommonModule, SharedModule, RouterModule.forChild([{path: '', component: AdminComponent}])],
|
||||
providers: [AppUserStore, AppUserService]
|
||||
})
|
||||
export class AdminModule {
|
||||
}
|
|
@ -47,11 +47,19 @@ unprocessed-child:hover {
|
|||
|
||||
/* Safari 4.0 - 8.0 */
|
||||
@-webkit-keyframes color-blink {
|
||||
from {background-color: #222222;}
|
||||
to {background-color: orange;}
|
||||
from {
|
||||
background-color: #222222;
|
||||
}
|
||||
to {
|
||||
background-color: orange;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes color-blink {
|
||||
from {background-color: #222222;}
|
||||
to {background-color: orange;}
|
||||
from {
|
||||
background-color: #222222;
|
||||
}
|
||||
to {
|
||||
background-color: orange;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,25 +45,29 @@
|
|||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a routerLink="{{config.requestPromotionPath}}">Beförderung</a>
|
||||
<a routerLink="{{config.request}}/{{config.requestPromotionPath}}">Beförderung</a>
|
||||
</li>
|
||||
<li>
|
||||
<a routerLink="{{config.requestAwardPath}}">Orden/ Auszeichnung</a>
|
||||
<a routerLink="{{config.request}}/{{config.requestAwardPath}}">Orden/ Auszeichnung</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li *ngIf="loginService.hasPermission(2) && loginService.hasSquad()" class="dropdown">
|
||||
<a href="#" [ngClass]="{'unprocessed': promotionService.hasUnprocessedPromotion || awardingService.hasUnprocessedAwards}" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
|
||||
<a href="#"
|
||||
[ngClass]="{'unprocessed': promotionService.hasUnprocessedPromotion || awardingService.hasUnprocessedAwards}"
|
||||
class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
Anträge
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a [ngClass]="{'unprocessed-child': promotionService.hasUnprocessedPromotion}" routerLink="{{config.confirmPromotionPath}}">Beförderung</a>
|
||||
<a [ngClass]="{'unprocessed-child': promotionService.hasUnprocessedPromotion}"
|
||||
routerLink="{{config.request}}/{{config.confirmPromotionPath}}">Beförderung</a>
|
||||
</li>
|
||||
<li>
|
||||
<a [ngClass]="{'unprocessed-child': awardingService.hasUnprocessedAwards}" routerLink="{{config.confirmAwardPath}}">Orden/ Auszeichnung</a>
|
||||
<a [ngClass]="{'unprocessed-child': awardingService.hasUnprocessedAwards}"
|
||||
routerLink="{{config.request}}/{{config.confirmAwardPath}}">Orden/ Auszeichnung</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
@ -73,8 +77,8 @@
|
|||
<li *ngIf="loginService.hasPermission(4)" routerLinkActive="active">
|
||||
<a routerLink='{{config.adminPanelPath}}' class="link">Admin Panel</a>
|
||||
</li>
|
||||
<li *ngIf="authEnabled" class="link" style="cursor: pointer">
|
||||
<a *ngIf="loginService.isLoggedIn()" (click)="logout()">Abmelden</a>
|
||||
<li *ngIf="loginService.isLoggedIn()" class="link" style="cursor: pointer">
|
||||
<a (click)="logout()">Abmelden</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import {Component, Inject, Optional} from '@angular/core';
|
||||
import {Component} from '@angular/core';
|
||||
import {Router} from '@angular/router';
|
||||
import {LoginService} from './services/login-service/login-service';
|
||||
import {AUTH_ENABLED} from './app.tokens';
|
||||
import {PromotionService} from "./services/promotion-service/promotion.service";
|
||||
import {AwardingService} from "./services/awarding-service/awarding.service";
|
||||
import {RouteConfig} from "./app.config";
|
||||
|
@ -15,8 +14,7 @@ export class AppComponent {
|
|||
|
||||
config = RouteConfig;
|
||||
|
||||
constructor(@Optional() @Inject(AUTH_ENABLED) public authEnabled,
|
||||
private loginService: LoginService,
|
||||
constructor(private loginService: LoginService,
|
||||
private promotionService: PromotionService,
|
||||
private awardingService: AwardingService,
|
||||
private router: Router) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
export class AppConfig {
|
||||
|
||||
public readonly apiUrl = '/api';
|
||||
|
@ -28,8 +27,9 @@ export const RouteConfig = {
|
|||
statsPath: 'stats',
|
||||
userPath: 'users',
|
||||
overviewPath: 'overview',
|
||||
requestAwardPath: 'request-award',
|
||||
requestPromotionPath: 'request-promotion',
|
||||
request: 'request',
|
||||
requestAwardPath: 'award',
|
||||
requestPromotionPath: 'promotion',
|
||||
confirmAwardPath: 'confirm-award',
|
||||
confirmPromotionPath: 'confirm-promotion'
|
||||
}
|
||||
|
|
|
@ -4,28 +4,19 @@ import {HttpModule} from '@angular/http';
|
|||
import {AppComponent} from './app.component';
|
||||
import {LoginService} from "./services/login-service/login-service";
|
||||
import {appRouting, routingComponents, routingProviders} from './app.routing';
|
||||
import {AUTH_ENABLED} from './app.tokens';
|
||||
import {SquadService} from "./services/squad-service/squad.service";
|
||||
import {SquadStore} from "./services/stores/squad.store";
|
||||
import {DecorationStore} from "./services/stores/decoration.store";
|
||||
import {DecorationService} from "./services/decoration-service/decoration.service";
|
||||
import {SquadItemComponent} from "./squads/squad-list/squad-item.component";
|
||||
import {DecorationComponent} from "./decorations/decoration.component";
|
||||
import {RankItemComponent} from "./ranks/rank-list/rank-item.component";
|
||||
import {RankStore} from "./services/stores/rank.store";
|
||||
import {RankService} from "./services/rank-service/rank.service";
|
||||
import {DecorationItemComponent} from "./decorations/decoration-list/decoration-item.component";
|
||||
import {AppConfig} from "./app.config";
|
||||
import {LoginGuardAdmin, LoginGuardHL, LoginGuardSQL} from "./login/login.guard";
|
||||
import {AwardingService} from "./services/awarding-service/awarding.service";
|
||||
import {HttpClient} from "./services/http-client";
|
||||
import {ArmyService} from "./services/army-service/army.service";
|
||||
import {ClipboardModule} from 'ngx-clipboard';
|
||||
import {AppUserService} from "./services/app-user-service/app-user.service";
|
||||
import {AppUserStore} from "./services/stores/app-user.store";
|
||||
import {PromotionService} from "./services/promotion-service/promotion.service";
|
||||
import {FilterRankPipe} from "./filter/filter.pipe";
|
||||
import {WarService} from "./services/war-service/war.service";
|
||||
import {SharedModule} from "./shared.module";
|
||||
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
|
||||
|
||||
|
@ -38,8 +29,6 @@ import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
|
|||
LoginGuardHL,
|
||||
LoginGuardAdmin,
|
||||
ArmyService,
|
||||
AppUserService,
|
||||
AppUserStore,
|
||||
SquadService,
|
||||
SquadStore,
|
||||
DecorationService,
|
||||
|
@ -50,16 +39,10 @@ import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
|
|||
PromotionService,
|
||||
AppConfig,
|
||||
routingProviders,
|
||||
{provide: AUTH_ENABLED, useValue: true}
|
||||
],
|
||||
declarations: [
|
||||
AppComponent,
|
||||
routingComponents,
|
||||
DecorationComponent,
|
||||
DecorationItemComponent,
|
||||
RankItemComponent,
|
||||
FilterRankPipe,
|
||||
SquadItemComponent],
|
||||
routingComponents],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
export class AppModule {
|
||||
|
|
|
@ -2,18 +2,9 @@ import {RouterModule, Routes} from "@angular/router";
|
|||
import {LoginComponent} from "./login/index";
|
||||
import {NotFoundComponent} from "./common/not-found/not-found.component";
|
||||
import {LoginGuardAdmin, LoginGuardHL, LoginGuardMT, LoginGuardSQL} from "./login/login.guard";
|
||||
import {squadsRoutes, squadsRoutingComponents} from "./squads/squads.routing";
|
||||
import {decorationsRoutes, decorationsRoutingComponents} from "./decorations/decoration.routing";
|
||||
import {ranksRoutes, ranksRoutingComponents} from "./ranks/ranks.routing";
|
||||
import {armyRoutes, armyRoutingComponents} from "./army/army.routing";
|
||||
import {SignupComponent} from "./login/signup.component";
|
||||
import {AdminComponent} from "./admin/admin.component";
|
||||
import {RequestAwardComponent} from "./request/award/req-award.component";
|
||||
import {RequestPromotionComponent} from "./request/promotion/req-promotion.component";
|
||||
import {ConfirmPromotionComponent} from "./request/confirm-promotion/confirm-promotion.component";
|
||||
import {ConfirmAwardComponent} from "./request/confirm-award/confirm-award.component";
|
||||
import {RouteConfig} from "./app.config";
|
||||
import {statsRoutingComponents} from "./statistic/stats.routing";
|
||||
|
||||
export const appRoutes: Routes = [
|
||||
|
||||
|
@ -25,17 +16,18 @@ export const appRoutes: Routes = [
|
|||
{path: RouteConfig.loginPath, component: LoginComponent},
|
||||
{path: RouteConfig.signUpPath, component: SignupComponent},
|
||||
|
||||
{path: RouteConfig.requestAwardPath, component: RequestAwardComponent, canActivate: [LoginGuardSQL]},
|
||||
{path: RouteConfig.requestPromotionPath, component: RequestPromotionComponent, canActivate: [LoginGuardSQL]},
|
||||
{path: RouteConfig.confirmAwardPath, component: ConfirmAwardComponent, canActivate: [LoginGuardHL]},
|
||||
{path: RouteConfig.confirmPromotionPath, component: ConfirmPromotionComponent, canActivate: [LoginGuardHL]},
|
||||
{path: RouteConfig.request, loadChildren: './request/request.module#RequestModule'},
|
||||
|
||||
{path: RouteConfig.userPath, loadChildren: './users/users.module#UsersModule', canActivate: [LoginGuardHL]},
|
||||
{path: RouteConfig.squadPath, children: squadsRoutes, canActivate: [LoginGuardHL]},
|
||||
{path: RouteConfig.decorationPath, children: decorationsRoutes, canActivate: [LoginGuardHL]},
|
||||
{path: RouteConfig.rankPath, children: ranksRoutes, canActivate: [LoginGuardHL]},
|
||||
{path: RouteConfig.squadPath, loadChildren: './squads/squads.module#SquadsModule', canActivate: [LoginGuardHL]},
|
||||
{
|
||||
path: RouteConfig.decorationPath,
|
||||
loadChildren: './decorations/decoration.module#DecorationsModule',
|
||||
canActivate: [LoginGuardHL]
|
||||
},
|
||||
{path: RouteConfig.rankPath, loadChildren: './ranks/ranks.module#RanksModule', canActivate: [LoginGuardHL]},
|
||||
|
||||
{path: RouteConfig.adminPanelPath, component: AdminComponent, canActivate: [LoginGuardAdmin]},
|
||||
{path: RouteConfig.adminPanelPath, loadChildren: './admin/admin.module#AdminModule', canActivate: [LoginGuardAdmin]},
|
||||
|
||||
/** Redirect Konfigurationen **/
|
||||
{path: '404', component: NotFoundComponent},
|
||||
|
@ -44,8 +36,6 @@ export const appRoutes: Routes = [
|
|||
|
||||
export const appRouting = RouterModule.forRoot(appRoutes);
|
||||
|
||||
export const routingComponents = [LoginComponent, SignupComponent, RequestAwardComponent, RequestPromotionComponent, ConfirmAwardComponent,
|
||||
ConfirmPromotionComponent, AdminComponent, ...armyRoutingComponents, NotFoundComponent,
|
||||
...squadsRoutingComponents, ...decorationsRoutingComponents, ...ranksRoutingComponents];
|
||||
export const routingComponents = [LoginComponent, SignupComponent, ...armyRoutingComponents, NotFoundComponent];
|
||||
|
||||
export const routingProviders = [LoginGuardSQL, LoginGuardHL, LoginGuardMT, LoginGuardAdmin];
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
import {OpaqueToken} from '@angular/core';
|
||||
|
||||
export const AUTH_ENABLED = new OpaqueToken('AUTH_ENABLED');
|
||||
|
||||
export const SOCKET_IO = new OpaqueToken('socket-io');
|
||||
|
|
@ -3,7 +3,7 @@ import {User} from "../models/model-interfaces";
|
|||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {UserService} from "../services/user-service/user.service";
|
||||
import {Subscription} from "rxjs/Subscription";
|
||||
import {AppConfig, RouteConfig} from "../app.config";
|
||||
import {RouteConfig} from "../app.config";
|
||||
|
||||
|
||||
@Component({
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
</div>
|
||||
<div class=" div-table-row" style="padding-left: 8px">
|
||||
<div *ngFor="let member of squad.members">
|
||||
<div class="member-link text-blufor" (click)="select(member._id)">{{member.rank}} {{member.username}}</div>
|
||||
<div class="member-link text-blufor" (click)="select(member._id)">{{member.rank}} {{member.username}}
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Component, Input, Optional} from '@angular/core';
|
||||
import {NgForm, FormGroup} from '@angular/forms';
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {FormGroup, NgForm} from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'show-error',
|
||||
|
|
|
@ -8,7 +8,7 @@ import {Decoration} from "../../models/model-interfaces";
|
|||
styleUrls: ['./decoration-item.component.css', '../../style/list-entry.css'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
inputs: ['decoration', 'selected'],
|
||||
outputs: ['decorationDelete','decorationSelected'],
|
||||
outputs: ['decorationDelete', 'decorationSelected'],
|
||||
})
|
||||
export class DecorationItemComponent {
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import {decorationRoutesModule, decorationsRoutingComponents} from "./decoration.routing";
|
||||
import {SharedModule} from "../shared.module";
|
||||
import {CommonModule} from "@angular/common";
|
||||
import {DecorationStore} from "../services/stores/decoration.store";
|
||||
import {DecorationService} from "../services/decoration-service/decoration.service";
|
||||
import {NgModule} from "@angular/core";
|
||||
|
||||
@NgModule({
|
||||
declarations: decorationsRoutingComponents,
|
||||
imports: [CommonModule, SharedModule, decorationRoutesModule],
|
||||
providers: [DecorationStore, DecorationService]
|
||||
})
|
||||
export class DecorationsModule {
|
||||
static routes = decorationRoutesModule;
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
import {Routes} from "@angular/router";
|
||||
import {RouterModule, Routes} from "@angular/router";
|
||||
import {DecorationComponent} from "./decoration.component";
|
||||
import {DecorationListComponent} from "./decoration-list/decoration-list.component";
|
||||
import {EditDecorationComponent} from "./edit-decoration/edit-decoration.component";
|
||||
import {ModuleWithProviders} from "@angular/core";
|
||||
import {DecorationItemComponent} from "./decoration-list/decoration-item.component";
|
||||
|
||||
export const decorationsRoutes: Routes = [{
|
||||
path: '', component: DecorationComponent,
|
||||
|
@ -23,5 +25,7 @@ export const decorationsRoutes: Routes = [{
|
|||
outlet: 'right'
|
||||
}];
|
||||
|
||||
export const decorationsRoutingComponents = [DecorationComponent, DecorationListComponent, EditDecorationComponent];
|
||||
export const decorationRoutesModule: ModuleWithProviders = RouterModule.forChild(decorationsRoutes);
|
||||
|
||||
export const decorationsRoutingComponents = [DecorationItemComponent, DecorationComponent, DecorationListComponent, EditDecorationComponent];
|
||||
|
||||
|
|
|
@ -79,6 +79,10 @@
|
|||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot} from '@angular/router';
|
||||
import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from '@angular/router';
|
||||
|
||||
@Injectable()
|
||||
export class LoginGuardSQL implements CanActivate {
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
import {Directive, forwardRef} from '@angular/core';
|
||||
import {
|
||||
FormControl,
|
||||
AbstractControl,
|
||||
NG_VALIDATORS, NG_ASYNC_VALIDATORS
|
||||
} from '@angular/forms';
|
||||
import {AbstractControl, FormControl, NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '@angular/forms';
|
||||
import {UserService} from "../services/user-service/user.service";
|
||||
import {Observable} from "rxjs";
|
||||
|
||||
export function asyncIfNotBacklogThenAssignee(control): Promise<any> {
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
|
|
|
@ -28,11 +28,13 @@ export interface Player {
|
|||
respawn?: number;
|
||||
flagTouch?: number;
|
||||
}
|
||||
|
||||
export interface Campaign {
|
||||
_id?: string;
|
||||
title?: string;
|
||||
wars?: War[];
|
||||
}
|
||||
|
||||
export interface War {
|
||||
_id?: string;
|
||||
title?: string;
|
||||
|
|
|
@ -30,7 +30,7 @@ export class EditRankComponent {
|
|||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private rankService : RankService) {
|
||||
private rankService: RankService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import {NgModule} from "@angular/core";
|
||||
import {rankRouterModule, ranksRoutingComponents} from "./ranks.routing";
|
||||
import {SharedModule} from "../shared.module";
|
||||
import {CommonModule} from "@angular/common";
|
||||
import {RankService} from "../services/rank-service/rank.service";
|
||||
import {RankStore} from "../services/stores/rank.store";
|
||||
|
||||
@NgModule({
|
||||
declarations: ranksRoutingComponents,
|
||||
imports: [CommonModule, SharedModule, rankRouterModule],
|
||||
providers: [RankStore, RankService]
|
||||
})
|
||||
export class RanksModule {
|
||||
static routes = rankRouterModule;
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
import {Routes} from "@angular/router";
|
||||
import {RouterModule, Routes} from "@angular/router";
|
||||
import {RankComponent} from "./ranks.component";
|
||||
import {RankListComponent} from "./rank-list/rank-list.component";
|
||||
import {EditRankComponent} from "./edit-rank/edit-rank.component";
|
||||
import {RankItemComponent} from "./rank-list/rank-item.component";
|
||||
import {ModuleWithProviders} from "@angular/core";
|
||||
|
||||
|
||||
export const ranksRoutes: Routes = [{
|
||||
|
@ -24,5 +26,7 @@ export const ranksRoutes: Routes = [{
|
|||
outlet: 'right'
|
||||
}];
|
||||
|
||||
export const ranksRoutingComponents = [RankComponent, RankListComponent, EditRankComponent];
|
||||
export const rankRouterModule: ModuleWithProviders = RouterModule.forChild(ranksRoutes);
|
||||
|
||||
export const ranksRoutingComponents = [RankComponent, RankItemComponent, RankListComponent, EditRankComponent];
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<div class="form-group">
|
||||
<label for="reason">Begründung</label>
|
||||
<textarea class="form-control center-block" name="reason" [(ngModel)]="reason" required
|
||||
id="reason" placeholder="Begründung eingeben..." rows="3" ></textarea>
|
||||
id="reason" placeholder="Begründung eingeben..." rows="3"></textarea>
|
||||
</div>
|
||||
|
||||
<button id="cancel"
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import {Component} from "@angular/core";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {Promotion, Rank} from "../../models/model-interfaces";
|
||||
import {RankService} from "../../services/rank-service/rank.service";
|
||||
import {PromotionService} from "../../services/promotion-service/promotion.service";
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<router-outlet></router-outlet>
|
|
@ -0,0 +1,11 @@
|
|||
import {Component} from "@angular/core";
|
||||
|
||||
@Component({
|
||||
selector: 'request',
|
||||
templateUrl: 'request.component.html',
|
||||
styleUrls: ['request.component.css']
|
||||
})
|
||||
export class RequestComponent {
|
||||
constructor() {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
import {CommonModule} from "@angular/common";
|
||||
import {SharedModule} from "../shared.module";
|
||||
import {requestRouterModule} from "./request.routing";
|
||||
import {NgModule} from "@angular/core";
|
||||
import {FilterRankPipe} from "../filter/filter.pipe";
|
||||
import {RequestComponent} from "./request.component";
|
||||
import {ConfirmAwardComponent} from "./confirm-award/confirm-award.component";
|
||||
import {ConfirmPromotionComponent} from "./confirm-promotion/confirm-promotion.component";
|
||||
import {RequestAwardComponent} from "./award/req-award.component";
|
||||
import {RequestPromotionComponent} from "./promotion/req-promotion.component";
|
||||
import {UserService} from "../services/user-service/user.service";
|
||||
import {UserStore} from "../services/stores/user.store";
|
||||
|
||||
@NgModule({
|
||||
declarations: [RequestComponent, RequestPromotionComponent, RequestAwardComponent, ConfirmPromotionComponent,
|
||||
ConfirmAwardComponent, FilterRankPipe],
|
||||
imports: [CommonModule, SharedModule, requestRouterModule],
|
||||
providers: [UserStore, UserService]
|
||||
})
|
||||
export class RequestModule {
|
||||
static routes = requestRouterModule;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
import {RouterModule, Routes} from "@angular/router";
|
||||
import {ModuleWithProviders} from "@angular/core";
|
||||
import {ConfirmAwardComponent} from "./confirm-award/confirm-award.component";
|
||||
import {ConfirmPromotionComponent} from "./confirm-promotion/confirm-promotion.component";
|
||||
import {RequestAwardComponent} from "./award/req-award.component";
|
||||
import {RequestPromotionComponent} from "./promotion/req-promotion.component";
|
||||
|
||||
import {RequestComponent} from "./request.component";
|
||||
import {RouteConfig} from "../app.config";
|
||||
import {LoginGuardHL, LoginGuardSQL} from "../login/login.guard";
|
||||
|
||||
|
||||
export const requestRoutes: Routes = [{
|
||||
path: '', component: RequestComponent
|
||||
},
|
||||
{
|
||||
path: RouteConfig.requestAwardPath,
|
||||
component: RequestAwardComponent,
|
||||
canActivate: [LoginGuardSQL]
|
||||
},
|
||||
{
|
||||
path: RouteConfig.requestPromotionPath,
|
||||
component: RequestPromotionComponent,
|
||||
canActivate: [LoginGuardSQL]
|
||||
},
|
||||
{
|
||||
path: RouteConfig.confirmAwardPath,
|
||||
component: ConfirmAwardComponent,
|
||||
canActivate: [LoginGuardHL]
|
||||
},
|
||||
{
|
||||
path: RouteConfig.confirmPromotionPath,
|
||||
component: ConfirmPromotionComponent,
|
||||
canActivate: [LoginGuardHL]
|
||||
}
|
||||
];
|
||||
|
||||
export const requestRouterModule: ModuleWithProviders = RouterModule.forChild(requestRoutes);
|
|
@ -1,8 +1,7 @@
|
|||
import {Injectable} from "@angular/core";
|
||||
import {AppUser, User} from "../../models/model-interfaces";
|
||||
import {URLSearchParams} from "@angular/http";
|
||||
import {AppUser} from "../../models/model-interfaces";
|
||||
import {Observable} from "rxjs/Observable";
|
||||
import {ADD, EDIT, LOAD, REMOVE} from "../stores/user.store";
|
||||
import {EDIT, LOAD, REMOVE} from "../stores/user.store";
|
||||
import {AppConfig} from "../../app.config";
|
||||
import {HttpClient} from "../http-client";
|
||||
import {AppUserStore} from "../stores/app-user.store";
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import {Injectable} from "@angular/core";
|
||||
import {Headers, Http, RequestMethod} from "@angular/http";
|
||||
import {Router} from "@angular/router";
|
||||
import {LoginService} from "./login-service/login-service";
|
||||
|
||||
@Injectable()
|
||||
export class HttpClient {
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
import {Inject, Injectable, Optional} from "@angular/core";
|
||||
import {Injectable} from "@angular/core";
|
||||
import {Http, Response} from "@angular/http";
|
||||
import "rxjs/add/operator/map";
|
||||
|
||||
import {AppConfig} from "../../app.config";
|
||||
import {AUTH_ENABLED} from "../../app.tokens";
|
||||
import {AppUser} from "../../models/model-interfaces";
|
||||
import {AwardingService} from "../awarding-service/awarding.service";
|
||||
import {PromotionService} from "../promotion-service/promotion.service";
|
||||
|
||||
@Injectable()
|
||||
export class LoginService {
|
||||
constructor(@Optional() @Inject(AUTH_ENABLED) public authEnabled = false,
|
||||
private http: Http,
|
||||
constructor(private http: Http,
|
||||
private config: AppConfig,
|
||||
private awardingService: AwardingService,
|
||||
private promotionService: PromotionService) {
|
||||
|
@ -47,15 +45,15 @@ export class LoginService {
|
|||
}
|
||||
|
||||
isLoggedIn() {
|
||||
return !this.authEnabled || localStorage.getItem('currentUser') != null;
|
||||
return localStorage.getItem('currentUser') != null;
|
||||
}
|
||||
|
||||
hasPermission(level : number) {
|
||||
hasPermission(level: number) {
|
||||
let currentUser = JSON.parse(localStorage.getItem('currentUser'));
|
||||
return this.isLoggedIn() && currentUser.permission >= level;
|
||||
}
|
||||
|
||||
getCurrentUser() :AppUser {
|
||||
getCurrentUser(): AppUser {
|
||||
return JSON.parse(localStorage.getItem('currentUser'));
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import {Squad} from "../../models/model-interfaces";
|
|||
import {RequestMethod, RequestOptions, URLSearchParams} from "@angular/http";
|
||||
import {Observable} from "rxjs/Observable";
|
||||
|
||||
import {SquadStore, ADD, EDIT, LOAD, REMOVE} from "../stores/squad.store";
|
||||
import {ADD, EDIT, LOAD, REMOVE, SquadStore} from "../stores/squad.store";
|
||||
import {AppConfig} from "../../app.config";
|
||||
import {HttpClient} from "../http-client";
|
||||
|
||||
|
@ -18,7 +18,7 @@ export class SquadService {
|
|||
this.squads$ = squadStore.items$;
|
||||
}
|
||||
|
||||
findSquads(query = '', fractionFilter='') {
|
||||
findSquads(query = '', fractionFilter = '') {
|
||||
const searchParams = new URLSearchParams();
|
||||
searchParams.append('q', query);
|
||||
searchParams.append('fractFilter', fractionFilter);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {BehaviorSubject} from "rxjs/BehaviorSubject";
|
||||
import {AppUser, User} from "../../models/model-interfaces";
|
||||
import {AppUser} from "../../models/model-interfaces";
|
||||
|
||||
export const LOAD = 'LOAD';
|
||||
export const ADD = 'ADD';
|
||||
|
|
|
@ -7,6 +7,7 @@ export const REMOVE = 'REMOVE';
|
|||
|
||||
|
||||
type Id = string | number;
|
||||
|
||||
interface Identifiable {
|
||||
id?: Id;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import {HttpClient} from "../http-client";
|
|||
@Injectable()
|
||||
export class WarService {
|
||||
|
||||
campaigns :Campaign[];
|
||||
campaigns: Campaign[];
|
||||
|
||||
constructor(private http: HttpClient,
|
||||
private config: AppConfig) {
|
||||
|
|
|
@ -30,7 +30,7 @@ export class EditSquadComponent {
|
|||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private squadService : SquadService) {
|
||||
private squadService: SquadService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from "@angular/common";
|
||||
import {SharedModule} from "../shared.module";
|
||||
import {squadRouterModule, squadsRoutingComponents} from "./squads.routing";
|
||||
import {SquadStore} from "../services/stores/squad.store";
|
||||
import {SquadService} from "../services/squad-service/squad.service";
|
||||
|
||||
@NgModule({
|
||||
declarations: squadsRoutingComponents,
|
||||
imports: [CommonModule, SharedModule, squadRouterModule],
|
||||
providers: [SquadStore, SquadService]
|
||||
})
|
||||
export class SquadsModule {
|
||||
static routes = squadRouterModule;
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
import {Routes} from "@angular/router";
|
||||
import {RouterModule, Routes} from "@angular/router";
|
||||
import {SquadComponent} from "./squads.component";
|
||||
import {SquadListComponent} from "./squad-list/squad-list.component";
|
||||
import {EditSquadComponent} from "./edit-squad/edit-squad.component";
|
||||
import {ModuleWithProviders} from "@angular/core";
|
||||
import {SquadItemComponent} from "./squad-list/squad-item.component";
|
||||
|
||||
export const squadsRoutes: Routes = [{
|
||||
path: '', component: SquadComponent,
|
||||
|
@ -23,5 +25,7 @@ export const squadsRoutes: Routes = [{
|
|||
outlet: 'right'
|
||||
}];
|
||||
|
||||
export const squadsRoutingComponents = [SquadComponent, SquadListComponent, EditSquadComponent];
|
||||
export const squadRouterModule: ModuleWithProviders = RouterModule.forChild(squadsRoutes);
|
||||
|
||||
export const squadsRoutingComponents = [SquadComponent, SquadItemComponent, SquadListComponent, EditSquadComponent];
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
.chart-container {
|
||||
.slide-chart-container {
|
||||
width: 1200px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
:host /deep/ .carousel-control {
|
||||
width: 5%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
|
@ -1,13 +1,23 @@
|
|||
<h2>{{title}}</h2>
|
||||
<h2 style="margin-bottom: 20px">{{title}}</h2>
|
||||
|
||||
<h3>Punkte</h3>
|
||||
|
||||
<div class="chart-container">
|
||||
<div class="btn btn-default" [style.background]="activeSlideIndex === 2 ? '#d9edf7':'white'"
|
||||
(click)="goToSlide(2)" *ngIf="id != 'all'">Gesamtpunktzahl
|
||||
</div>
|
||||
<div class="btn btn-default" [style.background]="activeSlideIndex === 0 ? '#d9edf7':'white'"
|
||||
(click)="goToSlide(0)">Punkte je Schlacht
|
||||
</div>
|
||||
<div class="btn btn-default" [style.background]="activeSlideIndex === 1 ? '#d9edf7':'white'"
|
||||
(click)="goToSlide(1)">Spielerzahlen
|
||||
</div>
|
||||
|
||||
<carousel [(activeSlide)]="activeSlideIndex">
|
||||
<slide *ngIf="id != 'all'">
|
||||
<div class="slide-chart-container">
|
||||
<h3>Gesamtpunktzahl</h3>
|
||||
<ngx-charts-line-chart
|
||||
[view]="[1050, 400]"
|
||||
[view]="[1200, 500]"
|
||||
[scheme]="colorScheme"
|
||||
[results]="playerData"
|
||||
[results]="pointSumData"
|
||||
[gradient]="false"
|
||||
[xAxis]="true"
|
||||
[yAxis]="true"
|
||||
|
@ -15,19 +25,16 @@
|
|||
[legendTitle]="''"
|
||||
[showXAxisLabel]="true"
|
||||
[showYAxisLabel]="true"
|
||||
[xAxisLabel]="'Schlachtdatum'"
|
||||
[yAxisLabel]="'Punkte'"
|
||||
[autoScale]="false">
|
||||
[yAxisLabel]="'Gesamtpunkte'"
|
||||
[autoScale]="true">
|
||||
</ngx-charts-line-chart>
|
||||
|
||||
</div>
|
||||
|
||||
<h3 style="margin-top: 370px;">Spielerzahlen</h3>
|
||||
|
||||
<div class="chart-container">
|
||||
|
||||
</div>
|
||||
</slide>
|
||||
<slide>
|
||||
<div class="slide-chart-container">
|
||||
<h3>Punkte je Schlacht</h3>
|
||||
<ngx-charts-line-chart
|
||||
[view]="[1050, 350]"
|
||||
[view]="[1200, 500]"
|
||||
[scheme]="colorScheme"
|
||||
[results]="pointData"
|
||||
[gradient]="false"
|
||||
|
@ -37,10 +44,28 @@
|
|||
[legendTitle]="''"
|
||||
[showXAxisLabel]="true"
|
||||
[showYAxisLabel]="true"
|
||||
[xAxisLabel]="'Schlachtdatum'"
|
||||
[yAxisLabel]="'Anzahl Spieler'"
|
||||
[autoScale]="true"
|
||||
(select)="onSelect($event)">
|
||||
[yAxisLabel]="'Punkte'"
|
||||
[autoScale]="false">
|
||||
</ngx-charts-line-chart>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</slide>
|
||||
<slide>
|
||||
<div class="slide-chart-container">
|
||||
<h3>Spielerzahlen</h3>
|
||||
<ngx-charts-line-chart
|
||||
[view]="[1200, 500]"
|
||||
[scheme]="colorScheme"
|
||||
[results]="playerData"
|
||||
[gradient]="false"
|
||||
[xAxis]="true"
|
||||
[yAxis]="true"
|
||||
[legend]="true"
|
||||
[legendTitle]="''"
|
||||
[showXAxisLabel]="true"
|
||||
[showYAxisLabel]="true"
|
||||
[yAxisLabel]="'Anzahl Spieler'"
|
||||
[autoScale]="true">
|
||||
</ngx-charts-line-chart>
|
||||
</div>
|
||||
</slide>
|
||||
</carousel>
|
||||
|
|
|
@ -1,21 +1,24 @@
|
|||
import {Component} from "@angular/core";
|
||||
import {WarService} from "../../services/war-service/war.service";
|
||||
import {Campaign, War} from "../../models/model-interfaces";
|
||||
import {WarListComponent} from "../war-list/war-list.component";
|
||||
import {ActivatedRoute} from "@angular/router";
|
||||
import {CarouselConfig} from "ngx-bootstrap";
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'stats-overview',
|
||||
templateUrl: './stats-overview.component.html',
|
||||
styleUrls: ['./stats-overview.component.css'],
|
||||
inputs: ['campaigns']
|
||||
inputs: ['campaigns'],
|
||||
providers: [{provide: CarouselConfig, useValue: {interval: false}}]
|
||||
})
|
||||
export class StatisticOverviewComponent {
|
||||
|
||||
id = "";
|
||||
title = "";
|
||||
activeSlideIndex: number = 0;
|
||||
|
||||
pointData: any[] = [];
|
||||
pointSumData: any[] = [];
|
||||
playerData: any[] = [];
|
||||
|
||||
colorScheme = {
|
||||
|
@ -30,26 +33,30 @@ export class StatisticOverviewComponent {
|
|||
this.route.params
|
||||
.map(params => params['id'])
|
||||
.subscribe((id) => {
|
||||
this.id = id;
|
||||
if (this.warService.campaigns) {
|
||||
this.initWars(this.warService.campaigns, id);
|
||||
this.initWars(this.warService.campaigns);
|
||||
} else {
|
||||
this.warService.getAllCampaigns().subscribe(campaigns => {
|
||||
this.initWars(campaigns, id);
|
||||
this.initWars(campaigns);
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
initWars(campaigns, id) {
|
||||
initWars(campaigns) {
|
||||
|
||||
let wars = [];
|
||||
let itemsProcessed = 0;
|
||||
campaigns = campaigns.filter(campaign => id === 'all' || campaign._id === id);
|
||||
campaigns = campaigns.filter(campaign => this.id === 'all' || campaign._id === this.id);
|
||||
campaigns.forEach(campaign => {
|
||||
if (id === 'all') {
|
||||
this.title = "Gesamtübersicht"
|
||||
if (this.id === 'all') {
|
||||
this.title = "Gesamtübersicht";
|
||||
} else {
|
||||
this.title = campaign.title
|
||||
setTimeout(() => {
|
||||
this.activeSlideIndex = 2;
|
||||
}, 10)
|
||||
}
|
||||
wars = wars.concat(campaign.wars);
|
||||
itemsProcessed++;
|
||||
|
@ -59,6 +66,10 @@ export class StatisticOverviewComponent {
|
|||
})
|
||||
}
|
||||
|
||||
goToSlide(index: number) {
|
||||
this.activeSlideIndex = index;
|
||||
}
|
||||
|
||||
initChart(wars: any[]) {
|
||||
let pointsObj = [
|
||||
{
|
||||
|
@ -69,6 +80,15 @@ export class StatisticOverviewComponent {
|
|||
"name": "CSAT",
|
||||
"series": []
|
||||
}];
|
||||
let pointsSumObj = [
|
||||
{
|
||||
"name": "NATO",
|
||||
"series": []
|
||||
},
|
||||
{
|
||||
"name": "CSAT",
|
||||
"series": []
|
||||
}];
|
||||
let playersObj = [
|
||||
{
|
||||
"name": "NATO",
|
||||
|
@ -80,37 +100,46 @@ export class StatisticOverviewComponent {
|
|||
}
|
||||
];
|
||||
for (let i = wars.length - 1; i >= 0; i--) {
|
||||
let j = wars.length - i - 1;
|
||||
const isoDate = wars[i].date.slice(0, 10);
|
||||
const dayDate = parseInt(isoDate.slice(8, 10)) + 1;
|
||||
const warDateString = (dayDate < 10 ? "0" + dayDate : dayDate) + '.'
|
||||
+ isoDate.slice(5, 7) + '.' + isoDate.slice(0, 4);
|
||||
|
||||
const bluforData = {
|
||||
pointsObj[0].series.push({
|
||||
name: warDateString,
|
||||
value: wars[i].ptBlufor
|
||||
};
|
||||
const opforData = {
|
||||
});
|
||||
pointsObj[1].series.push({
|
||||
name: warDateString,
|
||||
value: wars[i].ptOpfor
|
||||
};
|
||||
const bluforPlayers = {
|
||||
});
|
||||
pointsSumObj[0].series.push({
|
||||
name: warDateString,
|
||||
value: pointsSumObj[0].series[j - 1] ?
|
||||
pointsSumObj[0].series[j - 1].value + wars[i].ptBlufor :
|
||||
wars[i].ptBlufor
|
||||
});
|
||||
pointsSumObj[1].series.push({
|
||||
name: warDateString,
|
||||
value: pointsSumObj[1].series[j - 1]
|
||||
? pointsSumObj[1].series[j - 1].value + wars[i].ptOpfor :
|
||||
wars[i].ptOpfor
|
||||
});
|
||||
playersObj[0].series.push({
|
||||
name: warDateString,
|
||||
value: wars[i].playersBlufor
|
||||
};
|
||||
const opforPlayers = {
|
||||
});
|
||||
playersObj[1].series.push({
|
||||
name: warDateString,
|
||||
value: wars[i].playersOpfor
|
||||
};
|
||||
|
||||
playersObj[0].series.push(bluforData);
|
||||
playersObj[1].series.push(opforData);
|
||||
pointsObj[0].series.push(bluforPlayers);
|
||||
pointsObj[1].series.push(opforPlayers);
|
||||
});
|
||||
}
|
||||
|
||||
this.pointData = pointsObj;
|
||||
this.pointSumData = pointsSumObj;
|
||||
this.playerData = playersObj;
|
||||
Object.assign(this, [this.playerData, this.pointData])
|
||||
Object.assign(this, [this.pointData, this.pointSumData, this.playerData])
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,12 +4,13 @@ import {SharedModule} from "../shared.module";
|
|||
import {statsRouterModule, statsRoutingComponents} from "./stats.routing";
|
||||
import {WarService} from "../services/war-service/war.service";
|
||||
import {DataTableModule} from "angular2-datatable";
|
||||
import {NgxChartsModule} from "@swimlane/ngx-charts";
|
||||
import {AccordionModule} from "ngx-bootstrap";
|
||||
import {LineChartModule, PieChartModule} from "@swimlane/ngx-charts";
|
||||
import {AccordionModule, CarouselModule} from "ngx-bootstrap";
|
||||
|
||||
@NgModule({
|
||||
declarations: statsRoutingComponents,
|
||||
imports: [CommonModule, SharedModule, statsRouterModule, NgxChartsModule, AccordionModule.forRoot(), DataTableModule],
|
||||
imports: [CommonModule, SharedModule, statsRouterModule, LineChartModule, PieChartModule,
|
||||
AccordionModule.forRoot(), CarouselModule.forRoot(), DataTableModule],
|
||||
providers: [WarService]
|
||||
})
|
||||
export class StatsModule {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import {Component} from "@angular/core";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {ActivatedRoute} from "@angular/router";
|
||||
import {WarService} from "../../services/war-service/war.service";
|
||||
import {LoginService} from "../../services/login-service/login-service";
|
||||
import {Player, War} from "../../models/model-interfaces";
|
||||
|
||||
|
||||
|
|
|
@ -6,11 +6,12 @@
|
|||
<a>{{war.title}}</a>
|
||||
</span>
|
||||
<br>
|
||||
<small >vom {{war.date | date: 'dd.MM.yyyy'}}</small>
|
||||
<small>vom {{war.date | date: 'dd.MM.yyyy'}}</small>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3">
|
||||
<span (click)="delete(); $event.stopPropagation()" title="Löschen" class="glyphicon glyphicon-trash trash" *ngIf="loginService.hasPermission(3)"></span>
|
||||
<span (click)="delete(); $event.stopPropagation()" title="Löschen" class="glyphicon glyphicon-trash trash"
|
||||
*ngIf="loginService.hasPermission(3)"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -40,7 +40,7 @@ span {
|
|||
}
|
||||
|
||||
.trash {
|
||||
float:right;
|
||||
float: right;
|
||||
padding-top: 18px;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
</div>
|
||||
|
||||
<div class="col-sm-4">
|
||||
<span (click)="delete(); $event.stopPropagation()" title="Löschen" class="glyphicon glyphicon-trash trash pull-right"></span>
|
||||
<span (click)="delete(); $event.stopPropagation()" title="Löschen"
|
||||
class="glyphicon glyphicon-trash trash pull-right"></span>
|
||||
<span (click)="award(); $event.stopPropagation()" title="Auszeichnungen" class="icon-award pull-right"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
export const environment = {
|
||||
production: false,
|
||||
e2eMode: true
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
<app-root>Loading...</app-root>
|
||||
<app-root>Loading...</app-root>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import {enableProdMode} from '@angular/core';
|
||||
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
import { environment } from './environments/environment';
|
||||
import {AppModule} from './app/app.module';
|
||||
import {environment} from './environments/environment';
|
||||
|
||||
|
||||
import 'rxjs/add/observable/of';
|
||||
|
|
|
@ -13,11 +13,9 @@
|
|||
*
|
||||
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
|
||||
*/
|
||||
|
||||
/***************************************************************************************************
|
||||
* BROWSER POLYFILLS
|
||||
*/
|
||||
|
||||
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
|
||||
// import 'core-js/es6/symbol';
|
||||
// import 'core-js/es6/object';
|
||||
|
@ -32,31 +30,21 @@
|
|||
// import 'core-js/es6/regexp';
|
||||
// import 'core-js/es6/map';
|
||||
// import 'core-js/es6/set';
|
||||
|
||||
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
|
||||
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
||||
|
||||
/** IE10 and IE11 requires the following to support `@angular/animation`. */
|
||||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||
|
||||
|
||||
/** Evergreen browsers require these. **/
|
||||
import 'core-js/es6/reflect';
|
||||
import 'core-js/es7/reflect';
|
||||
|
||||
|
||||
/** ALL Firefox browsers require the following to support `@angular/animation`. **/
|
||||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||
|
||||
|
||||
|
||||
/***************************************************************************************************
|
||||
* Zone JS is required by Angular itself.
|
||||
*/
|
||||
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
||||
|
||||
|
||||
|
||||
/***************************************************************************************************
|
||||
* APPLICATION IMPORTS
|
||||
*/
|
||||
|
|
|
@ -47,6 +47,7 @@ form {
|
|||
padding-right: 10px;
|
||||
|
||||
}
|
||||
|
||||
#right {
|
||||
overflow: hidden;
|
||||
padding-left: 4%;
|
||||
|
|
|
@ -9,18 +9,16 @@ import 'zone.js/dist/fake-async-test';
|
|||
|
||||
import 'rxjs/Rx';
|
||||
|
||||
import { getTestBed } from '@angular/core/testing';
|
||||
import {
|
||||
BrowserDynamicTestingModule,
|
||||
platformBrowserDynamicTesting
|
||||
} from '@angular/platform-browser-dynamic/testing';
|
||||
import {getTestBed} from '@angular/core/testing';
|
||||
import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';
|
||||
|
||||
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
|
||||
declare var __karma__: any;
|
||||
declare var require: any;
|
||||
|
||||
// Prevent Karma from running prematurely.
|
||||
__karma__.loaded = function () {};
|
||||
__karma__.loaded = function () {
|
||||
};
|
||||
|
||||
// First, initialize the Angular testing environment.
|
||||
getTestBed().initTestEnvironment(
|
||||
|
|
|
@ -12,7 +12,10 @@
|
|||
"curly": true,
|
||||
"eofline": true,
|
||||
"forin": true,
|
||||
"import-blacklist": [true, "rxjs"],
|
||||
"import-blacklist": [
|
||||
true,
|
||||
"rxjs"
|
||||
],
|
||||
"import-spacing": true,
|
||||
"indent": [
|
||||
true,
|
||||
|
@ -97,9 +100,18 @@
|
|||
"check-separator",
|
||||
"check-type"
|
||||
],
|
||||
|
||||
"directive-selector": [true, "attribute", "app", "camelCase"],
|
||||
"component-selector": [true, "element", "app", "kebab-case"],
|
||||
"directive-selector": [
|
||||
true,
|
||||
"attribute",
|
||||
"app",
|
||||
"camelCase"
|
||||
],
|
||||
"component-selector": [
|
||||
true,
|
||||
"element",
|
||||
"app",
|
||||
"kebab-case"
|
||||
],
|
||||
"use-input-property-decorator": true,
|
||||
"use-output-property-decorator": true,
|
||||
"use-host-property-decorator": true,
|
||||
|
|
Loading…
Reference in New Issue