From 20ef392d75734993acce969f910a4ea72c3c7826 Mon Sep 17 00:00:00 2001 From: Solomon Cammack Date: Sun, 26 Dec 2021 15:30:40 +0000 Subject: [PATCH] Add team composition for locked SRs using event blocks --- website/src/router/shared-routes.js | 4 +- website/src/views/Team.vue | 12 +++ .../src/views/sub-views/TeamComposition.vue | 81 +++++++++++++++++++ 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 website/src/views/sub-views/TeamComposition.vue diff --git a/website/src/router/shared-routes.js b/website/src/router/shared-routes.js index d760836d..e0165e75 100644 --- a/website/src/router/shared-routes.js +++ b/website/src/router/shared-routes.js @@ -16,6 +16,7 @@ import News from "@/views/News"; import DetailedMatch from "@/views/DetailedMatch"; import MatchVOD from "@/views/sub-views/MatchVOD"; import MatchHistory from "@/views/sub-views/MatchHistory"; +import TeamComposition from "@/views/sub-views/TeamComposition"; export default [ { @@ -27,7 +28,8 @@ export default [ { path: "", component: TeamMain }, { path: "matches", component: TeamMatches }, { path: "theme", component: TeamTheme }, - { path: "details", component: TeamDetails } + { path: "details", component: TeamDetails }, + { path: "composition", component: TeamComposition } ] }, { diff --git a/website/src/views/Team.vue b/website/src/views/Team.vue index 6a5e8da3..0d4938b9 100644 --- a/website/src/views/Team.vue +++ b/website/src/views/Team.vue @@ -4,6 +4,7 @@ + @@ -81,6 +82,17 @@ export default { }) }) }); + }, + eventSettings() { + if (!this.team?.event?.blocks) return null; + try { + return JSON.parse(this.team?.event.blocks); + } catch (e) { + return null; + } + }, + useTeamCompositions() { + return this.eventSettings?.composition?.use && (this.team?.players || []).some(p => p.composition_tank_sr || p.composition_dps_sr || p.composition_support_sr); } } }; diff --git a/website/src/views/sub-views/TeamComposition.vue b/website/src/views/sub-views/TeamComposition.vue new file mode 100644 index 00000000..30692bb7 --- /dev/null +++ b/website/src/views/sub-views/TeamComposition.vue @@ -0,0 +1,81 @@ + + + + +