Skip to content

Commit

Permalink
Merge pull request #16798 from ElectronicBlueberry/galaxy-help-forum-…
Browse files Browse the repository at this point in the history
…integration

[EGD 2023 Cofest] Galaxy help forum integration
  • Loading branch information
dannon authored Nov 28, 2023
2 parents 315a127 + d5b491e commit f2034f6
Show file tree
Hide file tree
Showing 12 changed files with 685 additions and 9 deletions.
260 changes: 260 additions & 0 deletions client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,15 @@ export interface paths {
*/
delete: operations["delete_api_groups__group_id__users__user_id__delete"];
};
"/api/help/forum/search": {
/**
* Search the Galaxy Help forum.
* @description Search the Galaxy Help forum using the Discourse API.
*
* **Note**: This endpoint is for **INTERNAL USE ONLY** and is not part of the public Galaxy API.
*/
get: operations["search_forum_api_help_forum_search_get"];
};
"/api/histories": {
/** Returns histories for the current user. */
get: operations["index_api_histories_get"];
Expand Down Expand Up @@ -5646,6 +5655,229 @@ export interface components {
*/
type: "hdca";
};
/**
* HelpForumCategory
* @description Model for a category in the help forum.
*/
HelpForumCategory: Record<string, never>;
/**
* HelpForumGroup
* @description Model for a group in the help forum.
*/
HelpForumGroup: Record<string, never>;
/**
* HelpForumGroupedSearchResult
* @description Model for a grouped search result.
*/
HelpForumGroupedSearchResult: Record<string, never>;
/**
* HelpForumPost
* @description Model for a post in the help forum.
*/
HelpForumPost: {
/**
* Avatar Template
* @description The avatar template of the user.
*/
avatar_template: string;
/**
* Blurb
* @description The blurb of the post.
*/
blurb: string;
/**
* Created At
* @description The creation date of the post.
*/
created_at: string;
/**
* Id
* @description The ID of the post.
*/
id: number;
/**
* Like Count
* @description The number of likes of the post.
*/
like_count: number;
/**
* Name
* @description The name of the post.
*/
name: string;
/**
* Post Number
* @description The post number of the post.
*/
post_number: number;
/**
* Topic Id
* @description The ID of the topic of the post.
*/
topic_id: number;
/**
* Username
* @description The username of the post author.
*/
username: string;
};
/**
* HelpForumSearchResponse
* @description Response model for the help search API endpoint.
*
* This model is based on the Discourse API response for the search endpoint.
*/
HelpForumSearchResponse: {
/** Categories */
categories?: components["schemas"]["HelpForumCategory"][];
grouped_search_result?: components["schemas"]["HelpForumGroupedSearchResult"];
/** Groups */
groups?: components["schemas"]["HelpForumGroup"][];
/** Posts */
posts?: components["schemas"]["HelpForumPost"][];
/** Tags */
tags?: components["schemas"]["HelpForumTag"][];
/** Topics */
topics?: components["schemas"]["HelpForumTopic"][];
/** Users */
users?: components["schemas"]["HelpForumUser"][];
};
/**
* HelpForumTag
* @description Model for a tag in the help forum.
*/
HelpForumTag: Record<string, never>;
/**
* HelpForumTopic
* @description Model for a topic in the help forum compatible with Discourse API.
*/
HelpForumTopic: {
/**
* Archetype
* @description The archetype of the topic.
*/
archetype?: Record<string, never>;
/**
* Archived
* @description Whether the topic is archived.
*/
archived: boolean;
/**
* Bookmarked
* @description Whether the topic is bookmarked.
*/
bookmarked?: boolean;
/**
* Bumped
* @description Whether the topic was bumped.
*/
bumped: boolean;
/**
* Bumped At
* @description The date of the last bump of the topic.
*/
bumped_at: string;
/**
* Category Id
* @description The ID of the category of the topic.
*/
category_id: number;
/**
* Closed
* @description Whether the topic is closed.
*/
closed: boolean;
/**
* Created At
* @description The creation date of the topic.
*/
created_at: string;
/**
* Fancy Title
* @description The fancy title of the topic.
*/
fancy_title: string;
/**
* Has Accepted Answer
* @description Whether the topic has an accepted answer.
*/
has_accepted_answer: boolean;
/**
* Highest Post Number
* @description The highest post number in the topic.
*/
highest_post_number: number;
/**
* Id
* @description The ID of the topic.
*/
id: number;
/**
* Last Posted At
* @description The date of the last post in the topic.
*/
last_posted_at: string;
/**
* Liked
* @description Whether the topic is liked.
*/
liked?: boolean;
/**
* Pinned
* @description Whether the topic is pinned.
*/
pinned: boolean;
/**
* Posts Count
* @description The number of posts in the topic.
*/
posts_count: number;
/**
* Reply Count
* @description The number of replies in the topic.
*/
reply_count: number;
/**
* Slug
* @description The slug of the topic.
*/
slug: string;
/**
* Tags
* @description The tags of the topic.
*/
tags: string[];
/**
* Tags Descriptions
* @description The descriptions of the tags of the topic.
*/
tags_descriptions?: Record<string, never>;
/**
* Title
* @description The title of the topic.
*/
title: string;
/**
* Unpinned
* @description Whether the topic is unpinned.
*/
unpinned?: boolean;
/**
* Unseen
* @description Whether the topic is unseen.
*/
unseen: boolean;
/**
* Visible
* @description Whether the topic is visible.
*/
visible: boolean;
};
/**
* HelpForumUser
* @description Model for a user in the help forum.
*/
HelpForumUser: Record<string, never>;
/** HistoryContentBulkOperationPayload */
HistoryContentBulkOperationPayload: {
/** Items */
Expand Down Expand Up @@ -12120,6 +12352,34 @@ export interface operations {
};
};
};
search_forum_api_help_forum_search_get: {
/**
* Search the Galaxy Help forum.
* @description Search the Galaxy Help forum using the Discourse API.
*
* **Note**: This endpoint is for **INTERNAL USE ONLY** and is not part of the public Galaxy API.
*/
parameters: {
/** @description Search query to use for searching the Galaxy Help forum. */
query: {
query: string;
};
};
responses: {
/** @description Successful Response */
200: {
content: {
"application/json": components["schemas"]["HelpForumSearchResponse"];
};
};
/** @description Validation Error */
422: {
content: {
"application/json": components["schemas"]["HTTPValidationError"];
};
};
};
};
index_api_histories_get: {
/** Returns histories for the current user. */
parameters?: {
Expand Down
7 changes: 7 additions & 0 deletions client/src/components/Tool/ToolCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import { getAppRoot } from "onload/loadConfig";
import { storeToRefs } from "pinia";
import { computed, ref, watch } from "vue";
import { useConfigStore } from "@/stores/configurationStore";
import { useUserStore } from "@/stores/userStore";
import ToolSelectPreferredObjectStore from "./ToolSelectPreferredObjectStore";
import ToolTargetPreferredObjectStorePopover from "./ToolTargetPreferredObjectStorePopover";
import ToolHelpForum from "./ToolHelpForum.vue";
import ToolTutorialRecommendations from "./ToolTutorialRecommendations.vue";
import ToolFavoriteButton from "components/Tool/Buttons/ToolFavoriteButton.vue";
import ToolOptionsButton from "components/Tool/Buttons/ToolOptionsButton.vue";
Expand Down Expand Up @@ -82,6 +84,7 @@ function onSetError(e) {
}
const { currentUser, isAnonymous } = storeToRefs(useUserStore());
const { isLoaded: isConfigLoaded, config } = storeToRefs(useConfigStore());
const hasUser = computed(() => !isAnonymous.value);
const versions = computed(() => props.options.versions);
const showVersions = computed(() => props.options.versions?.length > 1);
Expand All @@ -99,6 +102,8 @@ function onUpdatePreferredObjectStoreId(selectedToolPreferredObjectStoreId) {
toolPreferredObjectStoreId.value = selectedToolPreferredObjectStoreId;
emit("updatePreferredObjectStoreId", selectedToolPreferredObjectStoreId);
}
const showHelpForum = computed(() => isConfigLoaded.value && config.value.enable_help_forum_tool_panel_integration);
</script>
<template>
Expand Down Expand Up @@ -180,6 +185,8 @@ function onUpdatePreferredObjectStoreId(selectedToolPreferredObjectStoreId) {
:version="props.options.version"
:owner="props.options.tool_shed_repository?.owner" />
<ToolHelpForum v-if="showHelpForum" :tool-id="props.id" :tool-name="props.title" />
<ToolFooter
:id="props.id"
:has-citations="props.options.citations"
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Tool/ToolForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ import FormDisplay from "components/Form/FormDisplay";
import FormElement from "components/Form/FormElement";
import LoadingSpan from "components/LoadingSpan";
import ToolEntryPoints from "components/ToolEntryPoints/ToolEntryPoints";
import { mapActions, mapState } from "pinia";
import { mapActions, mapState, storeToRefs } from "pinia";
import { useHistoryItemsStore } from "stores/historyItemsStore";
import { useJobStore } from "stores/jobStore";
import { refreshContentsWrapper } from "utils/data";
import { useConfig } from "@/composables/config";
import { useConfigStore } from "@/stores/configurationStore";
import { useHistoryStore } from "@/stores/historyStore";
import { useUserStore } from "@/stores/userStore";
Expand Down Expand Up @@ -150,7 +150,7 @@ export default {
},
},
setup() {
const { config, isConfigLoaded } = useConfig(true);
const { config, isLoaded: isConfigLoaded } = storeToRefs(useConfigStore());
return { config, isConfigLoaded };
},
data() {
Expand Down
Loading

0 comments on commit f2034f6

Please sign in to comment.