From 2973edb34e960d5c1f77432eabf275fd0d7ece0f Mon Sep 17 00:00:00 2001 From: Lucas Kikkawa <45891312+lucaskikkawa@users.noreply.github.com> Date: Tue, 31 Oct 2023 00:15:38 -0300 Subject: [PATCH] feat: performance page (#130) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: performance card * fix: history * feat: performance view * feat: performance view * feat: adding chart.js in performance-page * feat: include highcharts and example * feat: type performance requests * fix: api path in performance service * feat: highcharts type and some styles * feat: perfromance card and cr history chart * feat: best quad card and cr distribution fetch * feat: histories cp route * feat(wip): cp history by course * refactor(wip): chart area component * feat: cards adicionados a página de matricula * feat: finalize styling and logic * fix: imports * fix: stats orderby label * refactor: settings tanstack * refactor: graphs and style * feat: stats cards * feat: stats page loading * ci: tsc --------- Co-authored-by: Carlos Alencar Co-authored-by: Mateus Braga <71946082+mateusbrg@users.noreply.github.com> Co-authored-by: Mateus Braga Co-authored-by: FusiDaniel --- .github/workflows/ci.yml | 2 +- apps/container/package.json | 9 +- apps/container/src/bootstrap.ts | 10 +- .../components/PendingReviewEnrollment.vue | 2 +- .../src/components/PerformanceCard.vue | 57 ++++ .../src/components/SingleComment.vue | 4 +- .../src/components/SubjectReview.vue | 9 +- .../src/components/TeacherReview.vue | 2 +- apps/container/src/layouts/AppBar.vue | 7 - apps/container/src/router/index.ts | 10 - .../src/views/History/HistoryView.vue | 2 +- .../src/views/Performance/PerformanceView.vue | 318 +++++++++++++++++- .../src/views/Settings/SettingsView.vue | 2 +- apps/container/src/views/Stats/StatsView.vue | 304 ++++++++++++----- apps/react/package.json | 5 +- package.json | 3 +- packages/services/package.json | 3 +- packages/services/src/api.ts | 4 +- packages/services/src/comments.ts | 2 +- packages/services/src/enrollments.ts | 2 +- packages/services/src/index.ts | 3 +- packages/services/src/performance.ts | 67 ++++ packages/services/src/reviews.ts | 2 +- packages/services/src/stats.ts | 8 +- packages/services/src/users.ts | 2 +- packages/stores/package.json | 3 +- packages/types/package.json | 3 +- packages/types/src/stats.ts | 17 + packages/utils/package.json | 3 +- packages/utils/src/index.ts | 1 - packages/utils/src/season.ts | 79 +++-- packages/utils/src/seasonFormatting.ts | 16 - turbo.json | 1 + yarn.lock | 178 +++++++--- 34 files changed, 912 insertions(+), 228 deletions(-) create mode 100644 apps/container/src/components/PerformanceCard.vue create mode 100644 packages/services/src/performance.ts delete mode 100644 packages/utils/src/seasonFormatting.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8541526f..96b3a342 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - command: ['test', 'lint'] + command: ['test', 'lint', 'tsc'] steps: - uses: actions/checkout@v3 diff --git a/apps/container/package.json b/apps/container/package.json index bd1b5dfd..70ce3d2b 100644 --- a/apps/container/package.json +++ b/apps/container/package.json @@ -10,13 +10,14 @@ "test": "vitest run --coverage", "test:watch": "vitest --coverage", "lint": "vue-cli-service lint", - "lint:fix": "vue-cli-service lint --fix" + "lint:fix": "vue-cli-service lint --fix", + "tsc": "tsc --noEmit" }, "dependencies": { "@amcharts/amcharts5": "^5.5.2", "@mdi/font": "^7.3.67", - "@tanstack/query-core": "^5.0.5", - "@tanstack/vue-query": "5.4.1", + "@tanstack/query-core": "5.4.3", + "@tanstack/vue-query": "5.4.3", "axios": "^1.6.0", "core-js": "3.33.1", "element-plus": "2.4.1", @@ -75,4 +76,4 @@ "lint-staged": { "*.{js,jsx,vue,ts,tsx}": "vue-cli-service lint" } -} +} \ No newline at end of file diff --git a/apps/container/src/bootstrap.ts b/apps/container/src/bootstrap.ts index a585d19a..44d6364c 100644 --- a/apps/container/src/bootstrap.ts +++ b/apps/container/src/bootstrap.ts @@ -21,8 +21,12 @@ import 'element-plus/dist/index.css'; import '@mdi/font/css/materialdesignicons.css'; import HighchartsVue from 'highcharts-vue' +import Highcharts from "highcharts"; +import annotationsInit from "highcharts/modules/annotations"; -const theme: ThemeDefinition = { +annotationsInit(Highcharts); + +export const theme: ThemeDefinition = { dark: false, colors: { navigation: '#215096', @@ -31,6 +35,8 @@ const theme: ThemeDefinition = { 'ufabcnext-green': '#56cdb7', 'next-gray': '#404040', 'next-light-gray': '#848687', + 'ufabcnext-yellow': '#FFCB17', + 'ufabcnext-red': '#E17472', error: '#f45576', background: '#ffffff', }, @@ -76,4 +82,4 @@ createApp(App) }) // eslint-disable-next-line @typescript-eslint/no-explicit-any .use(HighchartsVue as any) - .mount('#app'); + .mount('#app'); \ No newline at end of file diff --git a/apps/container/src/components/PendingReviewEnrollment.vue b/apps/container/src/components/PendingReviewEnrollment.vue index 2a395f9a..1d276679 100644 --- a/apps/container/src/components/PendingReviewEnrollment.vue +++ b/apps/container/src/components/PendingReviewEnrollment.vue @@ -90,7 +90,7 @@ const subjectType = computed(() => const tags = computed(() => { const tags = [ subjectType.value, - formatSeason(props.enrollment.year, props.enrollment.quad), + formatSeason(props.enrollment.year + ":" + props.enrollment.quad), ]; isEAD.value && tags.push('EAD'); return tags; diff --git a/apps/container/src/components/PerformanceCard.vue b/apps/container/src/components/PerformanceCard.vue new file mode 100644 index 00000000..436a88b5 --- /dev/null +++ b/apps/container/src/components/PerformanceCard.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/apps/container/src/components/SingleComment.vue b/apps/container/src/components/SingleComment.vue index f732aaa8..fbd4b38d 100644 --- a/apps/container/src/components/SingleComment.vue +++ b/apps/container/src/components/SingleComment.vue @@ -183,8 +183,8 @@ const season = computed(() => { const [year, quad] = props.comment.enrollment.season?.split(':') ?? []; return formatSeason( - quad ?? props.comment.enrollment.quad, - year ?? props.comment.enrollment.year, + (year ?? props.comment.enrollment.year) + ':' + + (quad ?? props.comment.enrollment.quad) ); }); diff --git a/apps/container/src/components/SubjectReview.vue b/apps/container/src/components/SubjectReview.vue index 05a66017..120a234f 100644 --- a/apps/container/src/components/SubjectReview.vue +++ b/apps/container/src/components/SubjectReview.vue @@ -1,5 +1,5 @@