From 56624997dab329e384e23be4da7df5a75adbaa44 Mon Sep 17 00:00:00 2001 From: Lorenz Padberg Date: Mon, 29 Apr 2024 11:11:17 +0200 Subject: [PATCH 1/7] Reduce Query load on intruments query --- client/src/graphql/gql/queries/instrumentsQuery.gql | 1 - server/basicknowledge/queries.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/graphql/gql/queries/instrumentsQuery.gql b/client/src/graphql/gql/queries/instrumentsQuery.gql index 09744164..80b94edb 100644 --- a/client/src/graphql/gql/queries/instrumentsQuery.gql +++ b/client/src/graphql/gql/queries/instrumentsQuery.gql @@ -2,7 +2,6 @@ query InstrumentsQuery { instruments { id title - contents slug language type { diff --git a/server/basicknowledge/queries.py b/server/basicknowledge/queries.py index 56287e71..63d6e620 100644 --- a/server/basicknowledge/queries.py +++ b/server/basicknowledge/queries.py @@ -100,8 +100,9 @@ class InstrumentQuery(object): return None def resolve_instruments(self, info, **kwargs): - return BasicKnowledge.objects.all().order_by("title").live() - + return BasicKnowledge.objects.all().order_by("title").live().select_related("new_type", + "locale", + "new_type__category") def resolve_instrument_types(self, info, **kwargs): return ( InstrumentType.objects.filter(instruments__isnull=False) From 830ca5edcad648a2cadfb135458e2d2545e2fc45 Mon Sep 17 00:00:00 2001 From: Lorenz Padberg Date: Mon, 29 Apr 2024 12:20:34 +0200 Subject: [PATCH 2/7] Remove Legacy Objectives from ModuleDetailsQuery --- client/src/components/modules/Module.vue | 4 ++-- .../graphql/gql/queries/modules/moduleDetailsQuery.gql | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/client/src/components/modules/Module.vue b/client/src/components/modules/Module.vue index 4222df2d..1d08c249 100644 --- a/client/src/components/modules/Module.vue +++ b/client/src/components/modules/Module.vue @@ -61,7 +61,7 @@

Lernziele @@ -69,7 +69,7 @@
Date: Wed, 1 May 2024 10:44:44 +0200 Subject: [PATCH 3/7] Remove Objectives Code from Module Component --- client/src/components/modules/Module.vue | 48 ------------------------ 1 file changed, 48 deletions(-) diff --git a/client/src/components/modules/Module.vue b/client/src/components/modules/Module.vue index 1d08c249..69979c9f 100644 --- a/client/src/components/modules/Module.vue +++ b/client/src/components/modules/Module.vue @@ -60,33 +60,6 @@ />
-

- Lernziele -

- -
- - - - - -
- From 6703c4a2113518618c6506eb17f2e9fdfa094140 Mon Sep 17 00:00:00 2001 From: Lorenz Padberg Date: Wed, 1 May 2024 10:45:16 +0200 Subject: [PATCH 4/7] Remove Objectives From Cypress Tests --- .../cypress/e2e/frontend/modules/videos.cy.ts | 1 - .../objectives/objectives-visibility.spec.js | 87 ------------------- .../frontend/objectives/objectives.spec.js | 0 client/cypress/fixtures/module-geld.json | 4 - 4 files changed, 92 deletions(-) delete mode 100644 client/cypress/e2e/frontend/objectives/objectives-visibility.spec.js delete mode 100644 client/cypress/e2e/frontend/objectives/objectives.spec.js diff --git a/client/cypress/e2e/frontend/modules/videos.cy.ts b/client/cypress/e2e/frontend/modules/videos.cy.ts index 76dd6a2a..5a53a5f7 100644 --- a/client/cypress/e2e/frontend/modules/videos.cy.ts +++ b/client/cypress/e2e/frontend/modules/videos.cy.ts @@ -33,7 +33,6 @@ const videoModule = { }, bookmark: null, __typename: 'ModuleNode', - objectiveGroups: [], chapters: [ { id: 'Q2hhcHRlck5vZGU6Nzc2', diff --git a/client/cypress/e2e/frontend/objectives/objectives-visibility.spec.js b/client/cypress/e2e/frontend/objectives/objectives-visibility.spec.js deleted file mode 100644 index 49ef4546..00000000 --- a/client/cypress/e2e/frontend/objectives/objectives-visibility.spec.js +++ /dev/null @@ -1,87 +0,0 @@ -import { getMe } from '../../../support/helpers'; -import mocks from '../../../fixtures/mocks'; - -const modules = { - 'lohn-und-budget': { - objectiveGroups: { - edges: [ - { - node: { - title: 'LANGUAGE_COMMUNICATION', - objectives: { - edges: [ - { - node: { - text: 'i-am-an-objective', - hiddenFor: { - edges: [], - }, - }, - }, - ], - }, - }, - }, - ], - }, - }, -}; - -const operations = { - MeQuery() { - return getMe({ - schoolClasses: ['FLID2018a'], - teacher: false, - }); - }, - ModulesQuery: modules, - MySchoolClassQuery: { - me: {}, - }, - UpdateLastModule: { - updateLastModule: { - success: true, - }, - }, - SyncModuleVisibility: { - syncModuleVisibility: { - success: true, - }, - }, -}; - -// const mocks = { -// UUID: () => 'Whatever', -// GenericStreamFieldType: () => [], -// ObjectiveGroup: () => ({}), -// Module: () => ({ -// title: 'title', -// slug: 'slug', -// metaTitle: 'metaTitle', -// teaser: 'teaser', -// intro: 'intro', -// assignments: {edges: []}, -// objectiveGroups: {edges: []}, -// id: 'ID', -// }), -// }; - -describe('Objective Visibility', () => { - beforeEach(() => { - cy.task('getSchema').then((schema) => { - cy.mockGraphql({ - schema, - // endpoint: '/api/graphql' - mocks, - operations, - }); - }); - }); - - //todo: finish writing this test, this does nothing - it.skip('should display the correct objectives', () => { - cy.fakeLogin('rachel.green', 'test'); - - cy.visit('/module/lohn-und-budget'); - }); -}); diff --git a/client/cypress/e2e/frontend/objectives/objectives.spec.js b/client/cypress/e2e/frontend/objectives/objectives.spec.js deleted file mode 100644 index e69de29b..00000000 diff --git a/client/cypress/fixtures/module-geld.json b/client/cypress/fixtures/module-geld.json index 37f0e55e..78b45aa7 100644 --- a/client/cypress/fixtures/module-geld.json +++ b/client/cypress/fixtures/module-geld.json @@ -13,10 +13,6 @@ "edges": [], "__typename": "AssignmentNodeConnection" }, - "objectiveGroups": { - "edges": [], - "__typename": "ObjectiveGroupNodeConnection" - }, "chapters": { "edges": [ { From 85d526cbef9579d87b63a1cd0bb1be12b6fe5582 Mon Sep 17 00:00:00 2001 From: Lorenz Padberg Date: Wed, 1 May 2024 10:51:07 +0200 Subject: [PATCH 5/7] Remove Objectives from cypress fixures --- .../e2e/frontend/portfolio/new-project.spec.js | 1 - client/cypress/fixtures/full-modules.json | 16 ---------------- client/cypress/fixtures/mocks.ts | 1 - client/cypress/fixtures/module.json | 4 ---- client/cypress/fixtures/module.minimal.js | 1 - client/cypress/support/helpers.ts | 16 ---------------- 6 files changed, 39 deletions(-) diff --git a/client/cypress/e2e/frontend/portfolio/new-project.spec.js b/client/cypress/e2e/frontend/portfolio/new-project.spec.js index c4bdec3e..cd5c015f 100644 --- a/client/cypress/e2e/frontend/portfolio/new-project.spec.js +++ b/client/cypress/e2e/frontend/portfolio/new-project.spec.js @@ -13,7 +13,6 @@ describe('New project', () => { appearance: 'blue', description: 'This description rocks', slug: 'some-random-title', - objectives: 'Git gud', final: false, schoolClass, student: { diff --git a/client/cypress/fixtures/full-modules.json b/client/cypress/fixtures/full-modules.json index c7235f62..4936cb77 100644 --- a/client/cypress/fixtures/full-modules.json +++ b/client/cypress/fixtures/full-modules.json @@ -45,10 +45,6 @@ ], "__typename": "AssignmentNodeConnection" }, - "objectiveGroups": { - "edges": [], - "__typename": "ObjectiveGroupNodeConnection" - }, "chapters": { "edges": [ { @@ -117,10 +113,6 @@ "edges": [], "__typename": "AssignmentNodeConnection" }, - "objectiveGroups": { - "edges": [], - "__typename": "ObjectiveGroupNodeConnection" - }, "chapters": { "edges": [ { @@ -192,10 +184,6 @@ "edges": [], "__typename": "AssignmentNodeConnection" }, - "objectiveGroups": { - "edges": [], - "__typename": "ObjectiveGroupNodeConnection" - }, "chapters": { "edges": [ { @@ -234,10 +222,6 @@ "edges": [], "__typename": "AssignmentNodeConnection" }, - "objectiveGroups": { - "edges": [], - "__typename": "ObjectiveGroupNodeConnection" - }, "chapters": { "edges": [ { diff --git a/client/cypress/fixtures/mocks.ts b/client/cypress/fixtures/mocks.ts index 73d23171..2400af33 100644 --- a/client/cypress/fixtures/mocks.ts +++ b/client/cypress/fixtures/mocks.ts @@ -95,7 +95,6 @@ export default { intro: '', assignments: [], highlights: [], - objectiveGroups: [], id: getModuleId(), bookmark: null, }), diff --git a/client/cypress/fixtures/module.json b/client/cypress/fixtures/module.json index c41e0bf7..3e433aaf 100644 --- a/client/cypress/fixtures/module.json +++ b/client/cypress/fixtures/module.json @@ -44,10 +44,6 @@ ], "__typename": "AssignmentNodeConnection" }, - "objectiveGroups": { - "edges": [], - "__typename": "ObjectiveGroupNodeConnection" - }, "chapters": { "edges": [ { diff --git a/client/cypress/fixtures/module.minimal.js b/client/cypress/fixtures/module.minimal.js index 0f174f4f..f9157827 100644 --- a/client/cypress/fixtures/module.minimal.js +++ b/client/cypress/fixtures/module.minimal.js @@ -6,7 +6,6 @@ export default { intro: 'intro', assignments: [], highlights: [], - objectiveGroups: [], id: 'TW9kdWxlTm9kZToxMjM=', chapters: [], topic: { diff --git a/client/cypress/support/helpers.ts b/client/cypress/support/helpers.ts index 5f65bcfe..3e377d1f 100644 --- a/client/cypress/support/helpers.ts +++ b/client/cypress/support/helpers.ts @@ -133,10 +133,6 @@ export const getModules = () => { ], __typename: 'AssignmentNodeConnection', }, - objectiveGroups: { - edges: [], - __typename: 'ObjectiveGroupNodeConnection', - }, chapters: { edges: [ { @@ -207,10 +203,6 @@ export const getModules = () => { edges: [], __typename: 'AssignmentNodeConnection', }, - objectiveGroups: { - edges: [], - __typename: 'ObjectiveGroupNodeConnection', - }, chapters: { edges: [ { @@ -284,10 +276,6 @@ export const getModules = () => { edges: [], __typename: 'AssignmentNodeConnection', }, - objectiveGroups: { - edges: [], - __typename: 'ObjectiveGroupNodeConnection', - }, chapters: { edges: [ { @@ -328,10 +316,6 @@ export const getModules = () => { edges: [], __typename: 'AssignmentNodeConnection', }, - objectiveGroups: { - edges: [], - __typename: 'ObjectiveGroupNodeConnection', - }, chapters: { edges: [ { From e5c14400435b4a8324f92ec9e2e981f4d9625325 Mon Sep 17 00:00:00 2001 From: Lorenz Padberg Date: Wed, 1 May 2024 10:53:29 +0200 Subject: [PATCH 6/7] Fix linter errors --- client/cypress/e2e/frontend/portfolio/project-page.spec.js | 2 -- client/src/components/modules/Module.vue | 2 -- 2 files changed, 4 deletions(-) diff --git a/client/cypress/e2e/frontend/portfolio/project-page.spec.js b/client/cypress/e2e/frontend/portfolio/project-page.spec.js index c2ced384..ee99ef69 100644 --- a/client/cypress/e2e/frontend/portfolio/project-page.spec.js +++ b/client/cypress/e2e/frontend/portfolio/project-page.spec.js @@ -22,7 +22,6 @@ describe('Project Page', () => { appearance: 'yellow', description: 'I am Groot', slug: 'groot', - objectives: 'Be Groot\nBe awesome', final: false, student: { firstName: 'Rachel', @@ -49,7 +48,6 @@ describe('Project Page', () => { appearance: 'red', description: 'I am Groot', slug: 'groot', - objectives: 'Be Groot\nBe awesome', final: false, student: { firstName: 'Rachel', diff --git a/client/src/components/modules/Module.vue b/client/src/components/modules/Module.vue index 69979c9f..d736be5a 100644 --- a/client/src/components/modules/Module.vue +++ b/client/src/components/modules/Module.vue @@ -87,12 +87,10 @@ import { graphql } from '@/__generated__'; import highlightSidebar from '@/helpers/highlight-sidebar'; import { doUpdateHighlight } from '@/graphql/mutations'; import Mark from 'mark.js'; -import { useRoute } from 'vue-router'; export interface Props { module: ModuleNode; } -const route = useRoute(); const props = defineProps(); let selectionHandler: SelectionHandlerType; From 0ca2a00e761f3ae60d2bb4d06ad4eb9597bf64ae Mon Sep 17 00:00:00 2001 From: Lorenz Padberg Date: Thu, 2 May 2024 09:16:10 +0200 Subject: [PATCH 7/7] Remove Objective Components --- client/src/App.vue | 2 - .../objective-groups/NewObjectiveWizard.vue | 120 ----------------- .../components/objective-groups/Objective.vue | 127 ------------------ .../objective-groups/ObjectiveForm.vue | 45 ------- .../objective-groups/ObjectiveGroup.vue | 92 ------------- .../objective-groups/ObjectiveGroups.vue | 75 ----------- 6 files changed, 461 deletions(-) delete mode 100644 client/src/components/objective-groups/NewObjectiveWizard.vue delete mode 100644 client/src/components/objective-groups/Objective.vue delete mode 100644 client/src/components/objective-groups/ObjectiveForm.vue delete mode 100644 client/src/components/objective-groups/ObjectiveGroup.vue delete mode 100644 client/src/components/objective-groups/ObjectiveGroups.vue diff --git a/client/src/App.vue b/client/src/App.vue index 954e7533..464ac1b3 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -37,7 +37,6 @@ const EditRoomEntryWizard = defineAsyncComponent(() => ); const NewProjectEntryWizard = defineAsyncComponent(() => import('@/components/portfolio/NewProjectEntryWizard.vue')); const EditProjectEntryWizard = defineAsyncComponent(() => import('@/components/portfolio/EditProjectEntryWizard.vue')); -const NewObjectiveWizard = defineAsyncComponent(() => import('@/components/objective-groups/NewObjectiveWizard.vue')); const NewNoteWizard = defineAsyncComponent(() => import('@/components/notes/NewNoteWizard.vue')); const EditNoteWizard = defineAsyncComponent(() => import('@/components/notes/EditNoteWizard.vue')); const EditClassNameWizard = defineAsyncComponent(() => import('@/components/school-class/EditClassNameWizard.vue')); @@ -69,7 +68,6 @@ export default { EditRoomEntryWizard, NewProjectEntryWizard, EditProjectEntryWizard, - NewObjectiveWizard, NewNoteWizard, EditNoteWizard, EditClassNameWizard, diff --git a/client/src/components/objective-groups/NewObjectiveWizard.vue b/client/src/components/objective-groups/NewObjectiveWizard.vue deleted file mode 100644 index e160fcc4..00000000 --- a/client/src/components/objective-groups/NewObjectiveWizard.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - diff --git a/client/src/components/objective-groups/Objective.vue b/client/src/components/objective-groups/Objective.vue deleted file mode 100644 index b3e53987..00000000 --- a/client/src/components/objective-groups/Objective.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - diff --git a/client/src/components/objective-groups/ObjectiveForm.vue b/client/src/components/objective-groups/ObjectiveForm.vue deleted file mode 100644 index 61a600ea..00000000 --- a/client/src/components/objective-groups/ObjectiveForm.vue +++ /dev/null @@ -1,45 +0,0 @@ - - - - - diff --git a/client/src/components/objective-groups/ObjectiveGroup.vue b/client/src/components/objective-groups/ObjectiveGroup.vue deleted file mode 100644 index 8d1b4e19..00000000 --- a/client/src/components/objective-groups/ObjectiveGroup.vue +++ /dev/null @@ -1,92 +0,0 @@ - - - - - diff --git a/client/src/components/objective-groups/ObjectiveGroups.vue b/client/src/components/objective-groups/ObjectiveGroups.vue deleted file mode 100644 index 2131fed3..00000000 --- a/client/src/components/objective-groups/ObjectiveGroups.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - - -