Fix stats type, set button properties
This commit is contained in:
parent
9721464161
commit
93b8089510
|
|
@ -39,16 +39,34 @@ function hasWidget(widget: WidgetType) {
|
||||||
return props.courseConfig?.widgets?.includes(widget) ?? false;
|
return props.courseConfig?.widgets?.includes(widget) ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function buttonLink(): string {
|
const actionButtonProps = computed<{ href: string; text: string; cyKey: string }>(
|
||||||
if (props.courseConfig?.role_key === "Member") {
|
() => {
|
||||||
return getLearningPathUrl(props.courseConfig?.course_slug);
|
if (props.courseConfig?.role_key === "Member") {
|
||||||
} else if (props.courseConfig?.role_key === "Expert") {
|
return {
|
||||||
return "linktocockpit";
|
href: getLearningPathUrl(props.courseConfig?.course_slug),
|
||||||
} else if (props.courseConfig?.role_key === "Supervisor") {
|
text: "Weiter lernen",
|
||||||
return "linktocockpit";
|
cyKey: "progress-dashboard-continue-course-link",
|
||||||
|
};
|
||||||
|
} else if (props.courseConfig?.role_key === "Expert") {
|
||||||
|
return {
|
||||||
|
href: "expertlink",
|
||||||
|
text: "Cockpit anschauen",
|
||||||
|
cyKey: "",
|
||||||
|
};
|
||||||
|
} else if (props.courseConfig?.role_key === "Supervisor") {
|
||||||
|
return {
|
||||||
|
href: "supervisorlink",
|
||||||
|
text: "Cockpit anschauen",
|
||||||
|
cyKey: "Cockpit anschauen",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
href: getLearningPathUrl(props.courseConfig?.course_slug),
|
||||||
|
text: "Weiter lernen",
|
||||||
|
cyKey: "progress-dashboard-continue-course-link",
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return getLearningPathUrl(props.courseConfig?.course_slug);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
function hasActionButton(): boolean {
|
function hasActionButton(): boolean {
|
||||||
return props.courseConfig?.role_key !== "MentorUK";
|
return props.courseConfig?.role_key !== "MentorUK";
|
||||||
|
|
@ -59,10 +77,15 @@ function hasActionButton(): boolean {
|
||||||
<div v-if="courseConfig" class="mb-14 space-y-8">
|
<div v-if="courseConfig" class="mb-14 space-y-8">
|
||||||
<div class="flex flex-col space-y-8 bg-white p-6">
|
<div class="flex flex-col space-y-8 bg-white p-6">
|
||||||
<div class="border-b border-gray-300 pb-8">
|
<div class="border-b border-gray-300 pb-8">
|
||||||
<div class="flex flex-row justify-between">
|
<div class="flex flex-row items-start justify-between">
|
||||||
<h3 class="mb-4 text-3xl">{{ courseName }}</h3>
|
<h3 class="mb-4 text-3xl">{{ courseName }}</h3>
|
||||||
<a v-if="hasActionButton()" :href="buttonLink()" class="btn btn-sm btn-blue">
|
<a
|
||||||
foo
|
v-if="hasActionButton()"
|
||||||
|
:href="actionButtonProps.href"
|
||||||
|
class="btn-blue"
|
||||||
|
:data-cy="actionButtonProps.cyKey"
|
||||||
|
>
|
||||||
|
{{ actionButtonProps.text }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ const documents = {
|
||||||
"\n query dashboardProgress($courseId: ID!) {\n course_progress(course_id: $courseId) {\n _id\n course_id\n session_to_continue_id\n competence {\n _id\n total_count\n success_count\n fail_count\n }\n assignment {\n _id\n total_count\n points_max_count\n points_achieved_count\n }\n }\n }\n": types.DashboardProgressDocument,
|
"\n query dashboardProgress($courseId: ID!) {\n course_progress(course_id: $courseId) {\n _id\n course_id\n session_to_continue_id\n competence {\n _id\n total_count\n success_count\n fail_count\n }\n assignment {\n _id\n total_count\n points_max_count\n points_achieved_count\n }\n }\n }\n": types.DashboardProgressDocument,
|
||||||
"\n query dashboardCourseData($courseId: ID!) {\n course_progress(course_id: $courseId) {\n _id\n course_id\n session_to_continue_id\n }\n }\n": types.DashboardCourseDataDocument,
|
"\n query dashboardCourseData($courseId: ID!) {\n course_progress(course_id: $courseId) {\n _id\n course_id\n session_to_continue_id\n }\n }\n": types.DashboardCourseDataDocument,
|
||||||
"\n query courseStatistics($courseId: ID!) {\n course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n course_session_selection_metrics {\n _id\n session_count\n participant_count\n expert_count\n }\n attendance_day_presences {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n due_date\n participants_present\n participants_total\n details_url\n }\n summary {\n _id\n days_completed\n participants_present\n }\n }\n feedback_responses {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n experts\n satisfaction_average\n satisfaction_max\n details_url\n }\n summary {\n _id\n satisfaction_average\n satisfaction_max\n total_responses\n }\n }\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n competences {\n _id\n summary {\n _id\n success_total\n fail_total\n }\n records {\n _id\n course_session_id\n generation\n circle_id\n title\n success_count\n fail_count\n details_url\n }\n }\n }\n }\n": types.CourseStatisticsDocument,
|
"\n query courseStatistics($courseId: ID!) {\n course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n course_session_selection_metrics {\n _id\n session_count\n participant_count\n expert_count\n }\n attendance_day_presences {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n due_date\n participants_present\n participants_total\n details_url\n }\n summary {\n _id\n days_completed\n participants_present\n }\n }\n feedback_responses {\n _id\n records {\n _id\n course_session_id\n generation\n circle_id\n experts\n satisfaction_average\n satisfaction_max\n details_url\n }\n summary {\n _id\n satisfaction_average\n satisfaction_max\n total_responses\n }\n }\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n competences {\n _id\n summary {\n _id\n success_total\n fail_total\n }\n records {\n _id\n course_session_id\n generation\n circle_id\n title\n success_count\n fail_count\n details_url\n }\n }\n }\n }\n": types.CourseStatisticsDocument,
|
||||||
"\n query mentorCourseStatistics($courseId: ID!) {\n mentor_course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n user_selection_ids\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n }\n }\n": types.MentorCourseStatisticsDocument,
|
"\n query mentorCourseStatistics($courseId: ID!) {\n mentor_course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_selection_ids\n user_selection_ids\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n }\n }\n": types.MentorCourseStatisticsDocument,
|
||||||
"\n mutation SendFeedbackMutation(\n $courseSessionId: ID!\n $learningContentId: ID!\n $learningContentType: String!\n $data: GenericScalar!\n $submitted: Boolean\n ) {\n send_feedback(\n course_session_id: $courseSessionId\n learning_content_page_id: $learningContentId\n learning_content_type: $learningContentType\n data: $data\n submitted: $submitted\n ) {\n feedback_response {\n id\n data\n submitted\n }\n errors {\n field\n messages\n }\n }\n }\n": types.SendFeedbackMutationDocument,
|
"\n mutation SendFeedbackMutation(\n $courseSessionId: ID!\n $learningContentId: ID!\n $learningContentType: String!\n $data: GenericScalar!\n $submitted: Boolean\n ) {\n send_feedback(\n course_session_id: $courseSessionId\n learning_content_page_id: $learningContentId\n learning_content_type: $learningContentType\n data: $data\n submitted: $submitted\n ) {\n feedback_response {\n id\n data\n submitted\n }\n errors {\n field\n messages\n }\n }\n }\n": types.SendFeedbackMutationDocument,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -94,7 +94,7 @@ export function graphql(source: "\n query courseStatistics($courseId: ID!) {\n
|
||||||
/**
|
/**
|
||||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
* 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 mentorCourseStatistics($courseId: ID!) {\n mentor_course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n user_selection_ids\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query mentorCourseStatistics($courseId: ID!) {\n mentor_course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_properties {\n _id\n sessions {\n id\n name\n }\n generations\n circles {\n id\n name\n }\n }\n course_session_selection_ids\n user_selection_ids\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n }\n }\n"];
|
export function graphql(source: "\n query mentorCourseStatistics($courseId: ID!) {\n mentor_course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_selection_ids\n user_selection_ids\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query mentorCourseStatistics($courseId: ID!) {\n mentor_course_statistics(course_id: $courseId) {\n _id\n course_id\n course_title\n course_slug\n course_session_selection_ids\n user_selection_ids\n assignments {\n _id\n summary {\n _id\n completed_count\n average_passed\n total_passed\n total_failed\n }\n records {\n _id\n course_session_id\n course_session_assignment_id\n circle_id\n generation\n assignment_title\n assignment_type_translation_key\n details_url\n deadline\n metrics {\n _id\n passed_count\n failed_count\n unranked_count\n ranking_completed\n average_passed\n }\n }\n }\n }\n }\n"];
|
||||||
/**
|
/**
|
||||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -31,32 +31,15 @@ type CourseStatisticsType {
|
||||||
course_title: String!
|
course_title: String!
|
||||||
course_slug: String!
|
course_slug: String!
|
||||||
course_session_selection_ids: [ID]!
|
course_session_selection_ids: [ID]!
|
||||||
course_session_properties: StatisticsCourseSessionPropertiesType!
|
|
||||||
user_selection_ids: [ID]
|
user_selection_ids: [ID]
|
||||||
assignments: AssignmentsStatisticsType!
|
assignments: AssignmentsStatisticsType!
|
||||||
|
course_session_properties: StatisticsCourseSessionPropertiesType!
|
||||||
course_session_selection_metrics: StatisticsCourseSessionsSelectionMetricType!
|
course_session_selection_metrics: StatisticsCourseSessionsSelectionMetricType!
|
||||||
attendance_day_presences: AttendanceDayPresencesStatisticsType!
|
attendance_day_presences: AttendanceDayPresencesStatisticsType!
|
||||||
feedback_responses: FeedbackStatisticsResponsesType!
|
feedback_responses: FeedbackStatisticsResponsesType!
|
||||||
competences: CompetencesStatisticsType!
|
competences: CompetencesStatisticsType!
|
||||||
}
|
}
|
||||||
|
|
||||||
type StatisticsCourseSessionPropertiesType {
|
|
||||||
_id: ID!
|
|
||||||
sessions: [StatisticsCourseSessionDataType!]!
|
|
||||||
generations: [String!]!
|
|
||||||
circles: [StatisticsCircleDataType!]!
|
|
||||||
}
|
|
||||||
|
|
||||||
type StatisticsCourseSessionDataType {
|
|
||||||
id: ID!
|
|
||||||
name: String!
|
|
||||||
}
|
|
||||||
|
|
||||||
type StatisticsCircleDataType {
|
|
||||||
id: ID!
|
|
||||||
name: String!
|
|
||||||
}
|
|
||||||
|
|
||||||
type AssignmentsStatisticsType {
|
type AssignmentsStatisticsType {
|
||||||
_id: ID!
|
_id: ID!
|
||||||
records: [AssignmentStatisticsRecordType!]!
|
records: [AssignmentStatisticsRecordType!]!
|
||||||
|
|
@ -100,6 +83,23 @@ type AssignmentStatisticsSummaryType {
|
||||||
total_failed: Int!
|
total_failed: Int!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type StatisticsCourseSessionPropertiesType {
|
||||||
|
_id: ID!
|
||||||
|
sessions: [StatisticsCourseSessionDataType!]!
|
||||||
|
generations: [String!]!
|
||||||
|
circles: [StatisticsCircleDataType!]!
|
||||||
|
}
|
||||||
|
|
||||||
|
type StatisticsCourseSessionDataType {
|
||||||
|
id: ID!
|
||||||
|
name: String!
|
||||||
|
}
|
||||||
|
|
||||||
|
type StatisticsCircleDataType {
|
||||||
|
id: ID!
|
||||||
|
name: String!
|
||||||
|
}
|
||||||
|
|
||||||
type StatisticsCourseSessionsSelectionMetricType {
|
type StatisticsCourseSessionsSelectionMetricType {
|
||||||
_id: ID!
|
_id: ID!
|
||||||
session_count: Int!
|
session_count: Int!
|
||||||
|
|
@ -183,7 +183,6 @@ type BaseStatisticsType {
|
||||||
course_title: String!
|
course_title: String!
|
||||||
course_slug: String!
|
course_slug: String!
|
||||||
course_session_selection_ids: [ID]!
|
course_session_selection_ids: [ID]!
|
||||||
course_session_properties: StatisticsCourseSessionPropertiesType!
|
|
||||||
user_selection_ids: [ID]
|
user_selection_ids: [ID]
|
||||||
assignments: AssignmentsStatisticsType!
|
assignments: AssignmentsStatisticsType!
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -464,18 +464,6 @@ export const DASHBOARD_MENTOR_COMPETENCE_SUMMARY = graphql(`
|
||||||
course_id
|
course_id
|
||||||
course_title
|
course_title
|
||||||
course_slug
|
course_slug
|
||||||
course_session_properties {
|
|
||||||
_id
|
|
||||||
sessions {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
}
|
|
||||||
generations
|
|
||||||
circles {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
course_session_selection_ids
|
course_session_selection_ids
|
||||||
user_selection_ids
|
user_selection_ids
|
||||||
assignments {
|
assignments {
|
||||||
|
|
|
||||||
|
|
@ -93,9 +93,6 @@ class BaseStatisticsType(graphene.ObjectType):
|
||||||
course_title = graphene.String(required=True)
|
course_title = graphene.String(required=True)
|
||||||
course_slug = graphene.String(required=True)
|
course_slug = graphene.String(required=True)
|
||||||
course_session_selection_ids = graphene.List(graphene.ID, required=True)
|
course_session_selection_ids = graphene.List(graphene.ID, required=True)
|
||||||
course_session_properties = graphene.Field(
|
|
||||||
StatisticsCourseSessionPropertiesType, required=True
|
|
||||||
)
|
|
||||||
user_selection_ids = graphene.List(graphene.ID, required=False)
|
user_selection_ids = graphene.List(graphene.ID, required=False)
|
||||||
assignments = graphene.Field(AssignmentsStatisticsType, required=True)
|
assignments = graphene.Field(AssignmentsStatisticsType, required=True)
|
||||||
|
|
||||||
|
|
@ -113,6 +110,9 @@ class BaseStatisticsType(graphene.ObjectType):
|
||||||
|
|
||||||
|
|
||||||
class CourseStatisticsType(BaseStatisticsType):
|
class CourseStatisticsType(BaseStatisticsType):
|
||||||
|
course_session_properties = graphene.Field(
|
||||||
|
StatisticsCourseSessionPropertiesType, required=True
|
||||||
|
)
|
||||||
course_session_selection_metrics = graphene.Field(
|
course_session_selection_metrics = graphene.Field(
|
||||||
StatisticsCourseSessionsSelectionMetricType, required=True
|
StatisticsCourseSessionsSelectionMetricType, required=True
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue