Fix comments from PR

This commit is contained in:
Lorenz Padberg 2023-08-30 14:24:12 +02:00
parent acbb8b7517
commit 020c4846c4
13 changed files with 81 additions and 96 deletions

View File

@ -24,6 +24,7 @@ const documents = {
"\n query ModuleEditModeQuery($slug: String) {\n module(slug: $slug) {\n inEditMode @client\n slug\n }\n }\n": types.ModuleEditModeQueryDocument,
"\n query ChapterQuery($id: ID!) {\n chapter(id: $id) {\n path\n }\n }\n ": types.ChapterQueryDocument,
"\n query ContentBlockQuery($id: ID!) {\n contentBlock(id: $id) {\n path\n }\n }\n ": types.ContentBlockQueryDocument,
"\n query MeLanguage {\n me {\n language @client\n }\n }\n ": types.MeLanguageDocument,
"\n query ModuleSnapshotsQuery($slug: String!) {\n module(slug: $slug) {\n id\n title\n metaTitle\n slug\n topic {\n title\n }\n snapshots {\n ...SnapshotListItem\n }\n }\n }\n ": types.ModuleSnapshotsQueryDocument,
"\n query ModuleSolutions($slug: String) {\n module(slug: $slug) {\n solutionsEnabled\n slug\n }\n }\n": types.ModuleSolutionsDocument,
};
@ -86,6 +87,10 @@ export function graphql(source: "\n query ChapterQuery($id: ID!) {\n cha
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(source: "\n query ContentBlockQuery($id: ID!) {\n contentBlock(id: $id) {\n path\n }\n }\n "): (typeof documents)["\n query ContentBlockQuery($id: ID!) {\n contentBlock(id: $id) {\n path\n }\n }\n "];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(source: "\n query MeLanguage {\n me {\n language @client\n }\n }\n "): (typeof documents)["\n query MeLanguage {\n me {\n language @client\n }\n }\n "];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/

View File

@ -616,6 +616,7 @@ export type InstrumentNode = Node & {
contents?: Maybe<Scalars['GenericStreamFieldType']['output']>;
id: Scalars['ID']['output'];
intro: Scalars['String']['output'];
language?: Maybe<Scalars['String']['output']>;
slug: Scalars['String']['output'];
title: Scalars['String']['output'];
type?: Maybe<InstrumentTypeNode>;
@ -2428,6 +2429,11 @@ export type ContentBlockQueryQueryVariables = Exact<{
export type ContentBlockQueryQuery = { __typename?: 'Query', contentBlock?: { __typename?: 'ContentBlockNode', path?: string | null } | null };
export type MeLanguageQueryVariables = Exact<{ [key: string]: never; }>;
export type MeLanguageQuery = { __typename?: 'Query', me?: { __typename?: 'PrivateUserNode', language?: string | null } | null };
export type ModuleSnapshotsQueryQueryVariables = Exact<{
slug: Scalars['String']['input'];
}>;
@ -2456,5 +2462,6 @@ export const ModuleTitleQueryDocument = {"kind":"Document","definitions":[{"kind
export const ModuleEditModeQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ModuleEditModeQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"slug"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"module"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"slug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"inEditMode"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"client"}}]},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}}]} as unknown as DocumentNode<ModuleEditModeQueryQuery, ModuleEditModeQueryQueryVariables>;
export const ChapterQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ChapterQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"chapter"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}}]}}]} as unknown as DocumentNode<ChapterQueryQuery, ChapterQueryQueryVariables>;
export const ContentBlockQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ContentBlockQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contentBlock"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}}]}}]} as unknown as DocumentNode<ContentBlockQueryQuery, ContentBlockQueryQueryVariables>;
export const MeLanguageDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"MeLanguage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"me"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"language"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"client"}}]}]}}]}}]} as unknown as DocumentNode<MeLanguageQuery, MeLanguageQueryVariables>;
export const ModuleSnapshotsQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ModuleSnapshotsQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"slug"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"module"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"slug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"metaTitle"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"topic"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"title"}}]}},{"kind":"Field","name":{"kind":"Name","value":"snapshots"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SnapshotListItem"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SnapshotListItem"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SnapshotNode"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"shared"}}]}}]} as unknown as DocumentNode<ModuleSnapshotsQueryQuery, ModuleSnapshotsQueryQueryVariables>;
export const ModuleSolutionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ModuleSolutions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"slug"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"module"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"slug"},"value":{"kind":"Variable","name":{"kind":"Name","value":"slug"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"solutionsEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}}]}}]}}]} as unknown as DocumentNode<ModuleSolutionsQuery, ModuleSolutionsQueryVariables>;

View File

@ -71,7 +71,7 @@ export default {
padding: 15px;
font-size: toRem(17px);
font-family: $sans-serif-font-family;
margin-bottom: 20px;
margin-bottom: $medium-spacing
font-weight: $font-weight-regular;
overflow-wrap: break-word;
@ -90,10 +90,10 @@ export default {
}
&__explanation-icon {
width: 40px;
height: 40px;
width: $large-icon-dimension;
height: $large-icon-dimension;
fill: $color-brand;
margin-right: 8px;
margin-right: $small-spacing;
}
&__explanation-text {

View File

@ -1,12 +1,12 @@
<template>
`<template>
<svg
data-name="shape"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100"
id="a"
>
<path
d="m82.3799,17.6201c-6.5254-6.5264-15.2012-10.1201-24.4297-10.1201s-17.9053,3.5938-24.4307,10.1201c-6.5264,6.5254-10.1201,15.2012-10.1201,24.4297,0,8.3906,2.9788,16.3176,8.4223,22.5933l-23.5893,23.5894c-.9766.9766-.9766,2.5586,0,3.5352.4883.4883,1.1279.7324,1.7676.7324s1.2793-.2441,1.7676-.7324l23.5893-23.5894c6.2757,5.4436,14.2028,8.4224,22.5933,8.4224,9.2285,0,17.9043-3.5938,24.4297-10.1201,6.5254-6.5254,10.1201-15.2021,10.1201-24.4307s-3.5938-17.9043-10.1201-24.4297Zm-3.5352,45.3252c-5.5811,5.5811-13.002,8.6553-20.8945,8.6553s-15.3145-3.0742-20.8955-8.6553-8.6553-13.002-8.6553-20.8955,3.0742-15.3135,8.6553-20.8945,13.002-8.6553,20.8955-8.6553,15.3135,3.0742,20.8945,8.6553,8.6553,13.002,8.6553,20.8945-3.0742,15.3145-8.6553,20.8955Z"
/>
</svg>
</template>
`

View File

@ -2,24 +2,23 @@
<div class="filter-bar">
<div class="filter-bar__input-wrapper">
<input
class="filter-bar__search-input"
class="filter-bar__search-input skillbox-input"
type="text"
placeholder="Suchbegriff eingeben..."
ref="searchInputRef"
v-model="searchQuery"
@input="updateSearchQuery"
/>
<SearchMagnifyingGlass class="filter-bar__search-icon"></SearchMagnifyingGlass>
<search-magnifying-glass class="filter-bar__search-icon"></search-magnifying-glass>
</div>
<language-switcher class="filter-bar__language-selection"/>
<language-switcher class="filter-bar__language-selection" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted} from 'vue';
import { ref, onMounted } from 'vue';
import SearchMagnifyingGlass from '@/components/icons/SearchMagnifyingGlass.vue';
import LanguageSwitcher from "@/components/LanguageSwitcher.vue";
import LanguageSwitcher from '@/components/LanguageSwitcher.vue';
const searchQuery = ref('');
const searchInputRef = ref(null);
@ -44,16 +43,11 @@ onMounted(() => {
&__input-wrapper {
position: relative;
width: 380px; // With from modules, has nothing to do with it but at least it is the same width
max-width: 500px;
}
&__search-input {
width: 100%;
padding: 1rem;
border-radius: $input-border-radius;
width: $medium-input-width;
border: 1px solid $color-silver;
font-size: $base-font-size-pixels;
}
&__search-icon {

View File

@ -26,7 +26,6 @@
<script>
import { defineComponent } from 'vue';
import FilterEntry from '@/components/instruments/FilterEntry.vue';
import SET_FILTER_MUTATION from 'gql/local/mutations/setInstrumentFilter.gql';
export default defineComponent({
@ -47,21 +46,6 @@ export default defineComponent({
components: {
FilterEntry,
},
// TODO: Ramon: I think this code is not needed anymore
// apollo: {
// instrumentFilter: {
// query: INSTRUMENT_FILTER_QUERY,
// },
// },
data() {
return {
instrumentFilter: {
currentFilter: '',
},
};
},
inheritAttrs: false,
methods: {

View File

@ -17,10 +17,11 @@
<language-switcher class="module-filter__language-switcher" />
</div>
<div class="module-filter__nomodules" v-if="modules.length > 1 && filteredModules.length === 0">
<info-icon class="module-filter__nomodules-icon" />
<span class="module-filter__nomodules-text">Für die ausgewählten Filtereinstellungen sind keine Module vorhanden</span>
</div>
<info-message
class="module-filter__no-modules-text"
v-if="modules.length > 1 && filteredModules.length === 0"
>Für die ausgewählten Filtereinstellungen sind keine {{ $flavor.textModules }} vorhanden
</info-message>
<div class="topic__modules">
<module-teaser
v-for="module in filteredModules"
@ -39,7 +40,7 @@ import Dropdown from '@/components/ui/Dropdown.vue';
import LanguageSwitcher from '@/components/LanguageSwitcher.vue';
import { graphql } from '@/__generated__';
import { ModuleCategoryNode, ModuleLevelNode, ModuleNode, PrivateUserNode } from '@/__generated__/graphql';
import InfoIcon from "@/components/icons/InfoIcon.vue";
import InfoMessage from '@/components/ui/InfoMessage.vue';
const props = defineProps<{
modules: ModuleNode[];
@ -118,11 +119,11 @@ const updateLevel = (level: ModuleLevelNode) => {
};
const filterByLevel = (module: ModuleNode, level: ModuleLevelNode) => {
return level.filterAttributeType === 'ALL' || module.level?.id === level.id || module.level === null;
return level.filterAttributeType === 'ALL' || module.level?.id === level.id || !module.level;
};
const filterByCategory = (module: ModuleNode, category: ModuleCategoryNode) => {
return category.filterAttributeType === 'ALL' || module.category?.id === category.id || module.category === null;
return category.filterAttributeType === 'ALL' || module.category?.id === category.id || !module.category;
};
const filterByLanguage = (module: ModuleNode, language: string) => {
@ -159,9 +160,6 @@ const updateLastModuleLevelUser = (moduleLevel: ModuleLevelNode) => {
@import 'styles/helpers';
.module-filter {
// TODO: how do I correcty set the with of the whole thig including the grid for the modules?
// TODO: Farbe des Arrows für Dropdowns muss platfrom habhängig sein MS-775
&__filter-selection {
display: flex;
justify-content: flex-start;
@ -176,25 +174,6 @@ const updateLastModuleLevelUser = (moduleLevel: ModuleLevelNode) => {
&__language-switcher {
margin-left: auto;
}
&__nomodules {
display: flex;
align-items: center;
}
&__nomodules-icon {
width: 40px;
height: 40px;
fill: $color-brand;
margin-right: 8px;
}
&__nomodules-text {
color: $color-brand;
font-family: $sans-serif-font-family;
font-weight: $font-weight-regular;
margin-right: $medium-spacing;
}
}
.topic {

View File

@ -0,0 +1,33 @@
<template>
<div class="info-message">
<info-icon class="info-message__icon" />
<span class="info-message__text"><slot></slot> </span>
</div>
</template>
<script setup lang="ts">
import InfoIcon from '@/components/icons/InfoIcon.vue';
</script>
<style scoped lang="scss">
@import 'styles/helpers';
.info-message {
display: flex;
align-items: center;
&__icon {
width: $large-icon-dimension;
height: $large-icon-dimension;
fill: $color-brand;
margin-right: $small-spacing;
}
&__text {
@include regular-text;
color: $color-brand;
margin-right: $medium-spacing;
}
}
</style>

View File

@ -59,7 +59,6 @@ export const dhaValues: FlavorValues = Object.assign({}, myKvValues, {
appLogo: 'https://skillbox-my-detailhandel-dha-prod.s3.eu-central-1.amazonaws.com/myDHA-logo.png',
textAppName: 'myDHA',
helloIllustration: 'HelloMyDHAIllustration',
showInstrumentSubCategories: false,
});
export const dhfValues: FlavorValues = Object.assign({}, myKvValues, {
@ -69,5 +68,4 @@ export const dhfValues: FlavorValues = Object.assign({}, myKvValues, {
appLogo: 'https://skillbox-my-detailhandel-dhf-prod.s3.eu-central-1.amazonaws.com/myDHF-logo.png',
textAppName: 'myDHF',
helloIllustration: 'HelloMyDHFIllustration',
showInstrumentSubCategories: false,
});

View File

@ -10,19 +10,17 @@
v-else
/>
<div class="instrument-overview__list">
<FilterBar
<filter-bar
:search-query="searchText"
@update:searchQuery="(val) => (searchText = val)"
></FilterBar>
<div
class="instrument-overview__noinstruments"
></filter-bar>
<info-message
class="instrument-overview__no-instruments"
v-if="instruments.length > 1 && filteredInstruments.length === 0"
>
<info-icon class="instrument-overview__noinstruments-icon" />
<span class="instrument-overview__noinstruments-text"
>Für die ausgewählten Filtereinstellungen sind keine Einträge vorhanden</span
>
</div>
Für die ausgewählten Filtereinstellungen sind keine Einträge vorhanden
</info-message>
<router-link
:to="{ name: 'instrument', params: { slug: instrument.slug } }"
data-cy="instrument"
@ -43,9 +41,11 @@ import INSTRUMENT_FILTER_QUERY from 'gql/local/instrumentFilter.gql';
import FilterBar from '@/components/instruments/FilterBar.vue';
import { graphql } from '@/__generated__';
import InfoIcon from '@/components/icons/InfoIcon.vue';
import InfoMessage from '@/components/ui/InfoMessage.vue';
export default {
components: {
InfoMessage,
InfoIcon,
FilterBar,
InstrumentFilter,
@ -145,28 +145,8 @@ export default {
&__list-item {
padding: $medium-spacing 0;
@include regular-text;
@include table-row($color-silver);
}
&__noinstruments {
display: flex;
align-items: center;
}
&__noinstruments-icon {
width: 40px;
height: 40px;
fill: $color-brand;
margin-right: 8px;
}
&__noinstruments-text {
color: $color-brand;
font-family: $sans-serif-font-family;
font-weight: $font-weight-regular;
margin-right: $medium-spacing;
}
}
</style>

View File

@ -83,7 +83,11 @@ $popover-default-bottom: -110px;
$footer-width: 800px;
$news-width: 550px;
$medium-input-width: 380px;
$screen-width: 1200px;
$default-icon-dimension: 25px;
$small-icon-dimension: 14px;
$default-icon-dimension: 25px;
$large-icon-dimension: 40px;

View File

@ -559,6 +559,7 @@ type InstrumentNode implements Node {
id: ID!
bookmarks: [InstrumentBookmarkNode]
type: InstrumentTypeNode
language: String
}
type InstrumentNodeConnection {

View File

@ -16,4 +16,4 @@ export OAUTH_AUTHORIZE_URL=https://hepverlag-cms.grape.novu.ch/oauth/authorize
export OAUTH_API_BASE_URL=https://hepverlag-cms.grape.novu.ch/
export OAUTH_LOCAL_REDIRECT_URI=http://localhost:8000/api/oauth/callback/
export NODE_OPTIONS=--max_old_space_size=3072
pipenv install --dev --system
#pipenv install --dev --system