From 0a5b7317df6310cf50fcd4d306283ca1beedae62 Mon Sep 17 00:00:00 2001 From: lior sagy Date: Tue, 16 Nov 2021 18:22:36 +0200 Subject: [PATCH 1/2] Added Auto TBA key create with script --- package.json | 3 ++- scripts/TBAkey.js | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 scripts/TBAkey.js diff --git a/package.json b/package.json index dbacbdc..cd7c3c0 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "deploy": "ng build --configuration production && firebase deploy --only hosting,firestore:rules", "test": "ng test", "firebase:environment": "node scripts/firebase.js", - "create": "node scripts/create.js && npm run firebase:environment && npm run deploy" + "create": "node scripts/create.js && npm run firebase:environment && npm run deploy", + "TBA:key": "node scripts/TBAkey.js" }, "private": true, "dependencies": { diff --git a/scripts/TBAkey.js b/scripts/TBAkey.js new file mode 100644 index 0000000..35f8792 --- /dev/null +++ b/scripts/TBAkey.js @@ -0,0 +1,23 @@ +const { writeFileSync } = require("fs") +const { join } = require("path") +const { exit } = require("process") +const { createInterface } = require("readline") + +const rl = createInterface({ + input: process.stdin, + output: process.stdout, +}) + +const prompt = (query) => new Promise((resolve) => rl.question(query, resolve)) + +const main = async () => { + const output = await prompt( + "Please create a TBA key and enter it here (If you paste the key from somwhere please press delete one time before press enter): " + ) + const configuration = '{ "TBAKey" :' + '"' + output + '"' + "}" + writeFileSync(join("src", "environments", "secrets.json"), configuration) + + exit(0) +} + +main() From 940bfa0b1a9b6930d9cafcef501d3d93365404ee Mon Sep 17 00:00:00 2001 From: Noam Zaks Date: Fri, 26 Nov 2021 13:12:34 +0200 Subject: [PATCH 2/2] Added username name when send scout --- package-lock.json | 41 +++++++++++++++++++++-- src/app/components/form/form.component.ts | 7 ++-- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index c574965..4a7a02c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,6 @@ "requires": true, "packages": { "": { - "name": "scouting", "version": "0.0.0", "dependencies": { "@angular/animations": "~12.2.0", @@ -103,6 +102,7 @@ "critters": "0.0.10", "css-loader": "6.2.0", "css-minimizer-webpack-plugin": "3.0.2", + "esbuild": "0.13.4", "esbuild-wasm": "0.13.4", "find-cache-dir": "3.3.1", "glob": "7.1.7", @@ -298,6 +298,7 @@ "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-12.2.9.tgz", "integrity": "sha512-9Wgj69iGAZ4teQqW/zPbVg2RGna+m9i3v0zkWGx/+Uo95rikJCUZBQM4bfeOe+bSJrS77jV5EisBWG7ayNUSzQ==", "dependencies": { + "parse5": "^5.0.0", "tslib": "^2.2.0" }, "optionalDependencies": { @@ -4972,6 +4973,7 @@ "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", + "fsevents": "~2.3.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", @@ -7196,6 +7198,24 @@ "dev": true, "hasInstallScript": true, "optional": true, + "dependencies": { + "esbuild-android-arm64": "0.13.4", + "esbuild-darwin-64": "0.13.4", + "esbuild-darwin-arm64": "0.13.4", + "esbuild-freebsd-64": "0.13.4", + "esbuild-freebsd-arm64": "0.13.4", + "esbuild-linux-32": "0.13.4", + "esbuild-linux-64": "0.13.4", + "esbuild-linux-arm": "0.13.4", + "esbuild-linux-arm64": "0.13.4", + "esbuild-linux-mips64le": "0.13.4", + "esbuild-linux-ppc64le": "0.13.4", + "esbuild-openbsd-64": "0.13.4", + "esbuild-sunos-64": "0.13.4", + "esbuild-windows-32": "0.13.4", + "esbuild-windows-64": "0.13.4", + "esbuild-windows-arm64": "0.13.4" + }, "bin": { "esbuild": "bin/esbuild" }, @@ -7478,7 +7498,8 @@ "esprima": "^4.0.1", "estraverse": "^4.2.0", "esutils": "^2.0.2", - "optionator": "^0.8.1" + "optionator": "^0.8.1", + "source-map": "~0.6.1" }, "bin": { "escodegen": "bin/escodegen.js", @@ -11280,6 +11301,9 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dependencies": { + "graceful-fs": "^4.1.6" + }, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -11660,7 +11684,14 @@ "dev": true, "dependencies": { "copy-anything": "^2.0.1", + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "make-dir": "^2.1.0", + "mime": "^1.4.1", + "needle": "^2.5.2", "parse-node-version": "^1.0.1", + "source-map": "~0.6.0", "tslib": "^1.10.0" }, "bin": { @@ -12637,6 +12668,7 @@ "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", "dev": true, "dependencies": { + "encoding": "^0.1.12", "minipass": "^3.1.0", "minipass-sized": "^1.0.3", "minizlib": "^2.0.0" @@ -14047,7 +14079,8 @@ "dependencies": { "eventemitter-asyncresource": "^1.0.0", "hdr-histogram-js": "^2.0.1", - "hdr-histogram-percentiles-obj": "^3.0.0" + "hdr-histogram-percentiles-obj": "^3.0.0", + "nice-napi": "^1.0.2" }, "optionalDependencies": { "nice-napi": "^1.0.2" @@ -18285,6 +18318,7 @@ "on-finished": "^2.2.0", "on-headers": "^1.0.0", "path-to-regexp": "^1.8.0", + "re2": "^1.15.8", "router": "^1.3.1", "rsvp": "^4.8.5", "string-length": "^1.0.0", @@ -19984,6 +20018,7 @@ "anymatch": "^2.0.0", "async-each": "^1.0.1", "braces": "^2.3.2", + "fsevents": "^1.2.7", "glob-parent": "^3.1.0", "inherits": "^2.0.3", "is-binary-path": "^1.0.0", diff --git a/src/app/components/form/form.component.ts b/src/app/components/form/form.component.ts index 27a759c..d075520 100644 --- a/src/app/components/form/form.component.ts +++ b/src/app/components/form/form.component.ts @@ -93,6 +93,8 @@ export class FormComponent implements OnInit { get scout(): Scout { const result: Scout = {} + result["Scouter"] = {} + result["Scouter"]["Name"] = this.authentication.user?.displayName for (let i = 0; i < localStorage.length; i++) { let fullKey = localStorage.key(i) if (!fullKey?.startsWith(storagePrefix)) { @@ -109,10 +111,9 @@ export class FormComponent implements OnInit { } const key = fullKey.substring(prefix.length + 1) - + console.log(result) result[prefix][key] = value } - return result } @@ -193,6 +194,7 @@ export class FormComponent implements OnInit { } showTeams() { + console.log("i search teams from tba") this.redTeams = [] this.blueTeams = [] if ( @@ -211,6 +213,7 @@ export class FormComponent implements OnInit { this.redTeams = redTeams this.blueTeams = blueTeams + console.log("this is the teams i find", redTeams, blueTeams) } async fetchScout(): Promise {