diff --git a/client/build/webpack.base.conf.js b/client/build/webpack.base.conf.js index 3e770a5a..b978cf7b 100644 --- a/client/build/webpack.base.conf.js +++ b/client/build/webpack.base.conf.js @@ -42,6 +42,7 @@ module.exports = { alias: { '@': resolve('src'), styles: resolve('src/styles'), + gql: resolve('src/graphql/gql') }, }, module: { diff --git a/client/src/components/modules/SnapshotHeader.vue b/client/src/components/modules/SnapshotHeader.vue new file mode 100644 index 00000000..82ed2531 --- /dev/null +++ b/client/src/components/modules/SnapshotHeader.vue @@ -0,0 +1,176 @@ + + + + + diff --git a/client/src/components/modules/SnapshotListItem.vue b/client/src/components/modules/SnapshotListItem.vue index 4bf3179e..2fa902cd 100644 --- a/client/src/components/modules/SnapshotListItem.vue +++ b/client/src/components/modules/SnapshotListItem.vue @@ -59,6 +59,7 @@ &__link { @include default-link; + color: $color-brand; margin-left: auto; } } diff --git a/client/src/graphql/gql/queries/moduleByIdQuery.gql b/client/src/graphql/gql/queries/moduleByIdQuery.gql deleted file mode 100644 index f2db8fbe..00000000 --- a/client/src/graphql/gql/queries/moduleByIdQuery.gql +++ /dev/null @@ -1,24 +0,0 @@ -#import "../fragments/moduleParts.gql" -query ModuleQuery($id: ID!) { - module(id: $id) { - ...ModuleParts - chapters { - edges { - node { - id - contentBlocks { - edges { - node { - id - slug - title - type - contents - } - } - } - } - } - } - } -} diff --git a/client/src/graphql/gql/queries/modules/details.gql b/client/src/graphql/gql/queries/modules/details.gql new file mode 100644 index 00000000..20dabd39 --- /dev/null +++ b/client/src/graphql/gql/queries/modules/details.gql @@ -0,0 +1,16 @@ +#import "../fragments/moduleParts.gql" +query ModuleQuery($id: ID, $slug: String) { + module(id: $id, slug:$slug) { + ...ModuleParts + chapters { + id + contentBlocks { + id + slug + title + type + contents + } + } + } +} diff --git a/client/src/graphql/gql/queries/modules/moduleDetailsQuery.gql b/client/src/graphql/gql/queries/modules/moduleDetailsQuery.gql index 5dece44a..e9598934 100644 --- a/client/src/graphql/gql/queries/modules/moduleDetailsQuery.gql +++ b/client/src/graphql/gql/queries/modules/moduleDetailsQuery.gql @@ -1,12 +1,12 @@ -#import "../../fragments/chapterParts.gql" -#import "../../fragments/assignmentParts.gql" -#import "../../fragments/objectiveGroupParts.gql" -#import "../../fragments/objectiveParts.gql" -#import "../../fragments/moduleParts.gql" -#import "../../fragments/contentBlockInterfaceParts.gql" -#import "../../fragments/contentBlockParts.gql" -query ModuleDetailsQuery($slug: String!) { - module(slug: $slug) { +#import "gql/fragments/chapterParts.gql" +#import "gql/fragments/assignmentParts.gql" +#import "gql/fragments/objectiveGroupParts.gql" +#import "gql/fragments/objectiveParts.gql" +#import "gql/fragments/moduleParts.gql" +#import "gql/fragments/contentBlockInterfaceParts.gql" +#import "gql/fragments/contentBlockParts.gql" +query ModuleDetailsQuery($slug: String, $id: ID) { + module(slug: $slug, id: $id) { ...ModuleParts assignments { edges { @@ -16,28 +16,16 @@ query ModuleDetailsQuery($slug: String!) { } } objectiveGroups { - edges { - node { - ...ObjectiveGroupParts - objectives { - edges { - node { - ...ObjectiveParts - } - } - } - } + ...ObjectiveGroupParts + objectives { + ...ObjectiveParts } } chapters { - edges { - node { - ...ChapterParts - contentBlocks { - ...ContentBlockInterfaceParts - ...ContentBlockParts - } - } + ...ChapterParts + contentBlocks { + ...ContentBlockInterfaceParts + ...ContentBlockParts } } } diff --git a/client/src/helpers/new-note-mutation.js b/client/src/helpers/new-note-mutation.js index bb061458..39499d89 100644 --- a/client/src/helpers/new-note-mutation.js +++ b/client/src/helpers/new-note-mutation.js @@ -1,7 +1,7 @@ import ADD_NOTE_MUTATION from '@/graphql/gql/mutations/addNote.gql'; import CONTENT_BLOCK_QUERY from '@/graphql/gql/queries/contentBlockQuery.gql'; import CHAPTER_QUERY from '@/graphql/gql/queries/chapterQuery.gql'; -import MODULE_QUERY from '@/graphql/gql/queries/moduleByIdQuery.gql'; +import MODULE_QUERY from '@/graphql/gql/queries/modules/moduleDetailsQuery.gql'; import INSTRUMENT_FRAGMENT from '@/graphql/gql/fragments/instrumentParts.gql'; const getBlockType = id => atob(id).split(':')[0]; diff --git a/client/src/layouts/DefaultLayout.vue b/client/src/layouts/DefaultLayout.vue index 5a02d3d4..50d33ed8 100644 --- a/client/src/layouts/DefaultLayout.vue +++ b/client/src/layouts/DefaultLayout.vue @@ -45,9 +45,3 @@ } }; - - diff --git a/client/src/layouts/SimpleLayout.vue b/client/src/layouts/SimpleLayout.vue index 1fefdb80..36c3e896 100644 --- a/client/src/layouts/SimpleLayout.vue +++ b/client/src/layouts/SimpleLayout.vue @@ -1,11 +1,13 @@