From 2ef8d7de9cd0817fe6961a0ebfbf46d52ae25a64 Mon Sep 17 00:00:00 2001 From: MigBash <20924663+migbash@users.noreply.github.com> Date: Tue, 17 Oct 2023 08:26:53 +0100 Subject: [PATCH] patch (#1760) * test :: heroku build using build-2; * test :: heroku build using build-2; * add :: check for players with null links; * add :: correct page data variable property name; * .gitignore update; * core :: Makefile update; * ci :: disable sentry and hertzer deploy jobs; * [STASH] :: #1718 * [STASH] :: #1738 --- .github/workflows/pr-main-tag.yml | 65 ++++++++++--------- .gitignore | 7 +- Makefile | 2 +- package.json | 4 +- .../Widget-Comp-Hist-Row.svelte | 14 ++-- src/lib/store/user-settings.ts | 46 ++++++------- src/lib/utils/platform-functions.ts | 2 + .../[sport]/[fixture=fixture]/+page.ts | 4 +- 8 files changed, 76 insertions(+), 68 deletions(-) diff --git a/.github/workflows/pr-main-tag.yml b/.github/workflows/pr-main-tag.yml index ec3c31895..efa5b136e 100644 --- a/.github/workflows/pr-main-tag.yml +++ b/.github/workflows/pr-main-tag.yml @@ -295,15 +295,16 @@ jobs: prerelease: false # ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ - # ▓▓ NOTE: ▓▓ + # ▓▓ NOTE: ▓▓ SKIP ▓▓ # ▓▓ ➤ deploys target MAIN ▓▓ # ▓▓ ➤ after successfull "bump" & "release"; ▓▓ # ▓▓ ➤ dependent on "create-release" ▓▓ # ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ sentry-sourcemap-deploy: - name: Sentry Sourcemap (Artifacts) Upload + name: 🟣 Sentry sourcemap (artifacts) upload needs: create-release + if: false runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -312,40 +313,44 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16.17.0 - - name: '🏗️ Set npm version' + - name: 'setup npm' run: | npm install -g npm@8.19.1 - name: 'create .env' run: | echo ${{ secrets.ENV_FILE }} | base64 -d > .env - - name: '🟩 Build npm' + - name: 'build' + env: + NODE_OPTIONS: "--max_old_space_size=4096" run: | npm install npm run build-2 - # ----------------------- - # NOTE: [STASHED] - # -> deploys target MAIN - # -> after successfull "bump" & "release"; - # -> dependent on "create-release" - # ----------------------- - # deploy: - # name: 🚀 Deployment - # needs: create-release - # runs-on: ubuntu-22.04 - # steps: - # - name: executing remote ssh commands using password - # uses: appleboy/ssh-action@v0.1.7 - # # [ℹ] declaring ENV variables to be used in the project-CI/CD - # with: - # host: ${{secrets.WEB_SERVER_HOST}} - # username: ${{secrets.WEB_SERVER_USERNAME}} - # key: ${{secrets.WEB_SERVER_KEY}} - # port: ${{secrets.WEB_SERVER_PORT}} - # script: | - # # [ℹ] Navigate to target project directory - # cd web/scores - # # [ℹ] Update the directory with latests changes - # git pull origin main - # # [ℹ] Run target makefile command - # make update-scores-web + # ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ + # ▓▓ NOTE: ▓▓ SKIP ▓▓ + # ▓▓ ➤ deploys target MAIN ▓▓ + # ▓▓ ➤ after successfull "bump" & "release"; ▓▓ + # ▓▓ ➤ dependent on "create-release" ▓▓ + # ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ + + deploy: + name: 🚀 Deployment + if: false + needs: create-release + runs-on: ubuntu-22.04 + steps: + - name: executing remote ssh commands using password + uses: appleboy/ssh-action@v0.1.7 + # [ℹ] declaring ENV variables to be used in the project-CI/CD + with: + host: ${{secrets.WEB_SERVER_HOST}} + username: ${{secrets.WEB_SERVER_USERNAME}} + key: ${{secrets.WEB_SERVER_KEY}} + port: ${{secrets.WEB_SERVER_PORT}} + script: | + # [ℹ] Navigate to target project directory + cd web/scores + # [ℹ] Update the directory with latests changes + git pull origin main + # [ℹ] Run target makefile command + make update-scores-web diff --git a/.gitignore b/.gitignore index 29f572397..ca4bfeffe 100644 --- a/.gitignore +++ b/.gitignore @@ -10,9 +10,8 @@ certs/* # ▓▓ never uncomment .env .env.* +.sentryclirc +# ▓▓ 💠 MISC WEBSITE-DEV-README.md -datalog/ - -# [PERSONAL] -# .vscode/ \ No newline at end of file +datalog/ \ No newline at end of file diff --git a/Makefile b/Makefile index a8b648087..d18ce105f 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,7 @@ heroku-production-deploy-branch-current: @echo \ "$(COLOUR_R)\ \n◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️\ - \n◼️ 🚀 Pushing current branch to Heroku-Prod ◼️\ + \n◼️ 🚀 Pushing current branch to Heroku-Prod ◼️\ \n◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️\ $(END_COLOUR)\n" @git push heroku-prod $$(git branch --show-current):main -f diff --git a/package.json b/package.json index e117688d0..22cb47b80 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ }, "scripts": { "start": "node build/index.js", - "build": "VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") vite build", - "build-2": "VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") VITE_SENTRY_UPLOAD_SOURCEMAPS=true vite build", + "build": "cross-env NODE_OPTIONS=--max_old_space_size=4096 VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") VITE_SENTRY_UPLOAD_SOURCEMAPS=true vite build", + "build-2": "cross-env NODE_OPTIONS=--max_old_space_size=4096 VITE_SCORES_PKG_VERSION=v.$(npm pkg get version --workspaces=false | tr -d \\\") VITE_SCORES_LIB_PKG_VERSION=v.$(npm info @betarena/scores-lib version | tr -d \\\") VITE_SENTRY_UPLOAD_SOURCEMAPS=true vite build", "test": "npm run test:integration && npm run test:unit", "svelte-check": "svelte-check --tsconfig ./tsconfig.json", "svelte-check::watch": "svelte-check --tsconfig ./tsconfig.json --watch", diff --git a/src/lib/components/page/profile/competitions-history/Widget-Comp-Hist-Row.svelte b/src/lib/components/page/profile/competitions-history/Widget-Comp-Hist-Row.svelte index 1d89fe287..e635622e0 100644 --- a/src/lib/components/page/profile/competitions-history/Widget-Comp-Hist-Row.svelte +++ b/src/lib/components/page/profile/competitions-history/Widget-Comp-Hist-Row.svelte @@ -267,7 +267,7 @@ -->

- ${competitionObject?.data?.entry_fee ?? '-'} + {competitionObject?.data?.entry_fee ?? '-'} BTA

@@ -283,7 +283,7 @@ -->

- ${toDecimalFix((competitionObject?.data?.total_prize - competitionObject?.data?.betarena_commission), 2, true) ?? ''} + {toDecimalFix((competitionObject?.data?.total_prize - competitionObject?.data?.betarena_commission), 2, true) ?? ''} BTA

@@ -292,7 +292,7 @@ -->

- ${toDecimalFix(competitionPotentialUserWin, 2, true) ?? '-'} + {toDecimalFix(competitionPotentialUserWin, 2, true) ?? '-'} BTA

@@ -367,7 +367,7 @@ -->

- ${toDecimalFix(competitionPotentialUserWin, 2, true) ?? '-'} + {toDecimalFix(competitionPotentialUserWin, 2, true) ?? '-'} BTA

{ - const existing: string = localStorage.getItem(key); - const exisitng_data: User_Setting = existing - ? - JSON.parse(existing) - : - { - lang: 'en', - theme: 'Light', - country_bookmaker: undefined, - geoJs: undefined, - user: undefined, - voted_fixtures: [], - userguide_id_opt_out: [], - } - ; + let localStore: User_Setting = methods.parseLocalStorage(); + + // ◼️◼️◼️ CHECK + // ◼️◼️◼️ absent localstorage object. + if (localStore == null) + { + localStore = + { + lang: 'en', + theme: 'Dark', + country_bookmaker: undefined, + geoJs: undefined, + user: undefined, + voted_fixtures: [], + userguide_id_opt_out: [], + } + } - if (exisitng_data.userguide_id_opt_out == null) - exisitng_data.userguide_id_opt_out = []; + // ◼️◼️◼️ NOTE: + // ◼️◼️◼️ force users to have '_this_' object data property. + if (localStore.userguide_id_opt_out == null) + localStore.userguide_id_opt_out = []; ; - localStorage.setItem + methods.setLocalStorage ( - key, - JSON.stringify(exisitng_data) - ); - set(exisitng_data); + localStore + ); }, /** diff --git a/src/lib/utils/platform-functions.ts b/src/lib/utils/platform-functions.ts index 2935ac178..dea1c2108 100644 --- a/src/lib/utils/platform-functions.ts +++ b/src/lib/utils/platform-functions.ts @@ -1188,6 +1188,8 @@ export function cleanUrl url: string ): string { + if (url == null) return ''; + url = url.replace ( 'https://scores.betarena.com', diff --git a/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts b/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts index 9d0f4aa98..a7ddc799a 100644 --- a/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts +++ b/src/routes/[[lang=lang]]/[sport]/[fixture=fixture]/+page.ts @@ -210,7 +210,7 @@ export async function load FIXTURE_LINEUPS_TRANSLATION, FIXTURE_INCIDENTS, FXITURE_INCIDENTS_TRANSLATION, - FEATURED_BETTING_SITES_WIDGET_DATA_SEO, + B_FEATB_T, FIXTURE_STATISTICS, FIXTURE_STATISTICS_TRANSLATION, FIXTURE_CONTENT, @@ -322,7 +322,7 @@ export async function load FIXTURE_LINEUPS_TRANSLATION, FIXTURE_INCIDENTS, FXITURE_INCIDENTS_TRANSLATION, - FEATURED_BETTING_SITES_WIDGET_DATA_SEO, + B_FEATB_T, FIXTURE_STATISTICS, FIXTURE_STATISTICS_TRANSLATION, FIXTURE_CONTENT,