Skip to content

Commit

Permalink
juggle the enums in schema
Browse files Browse the repository at this point in the history
see #15774 for context

update page =pdf export selenium test

update return type to reflect matches being returned

cleanup the test file

run make format
  • Loading branch information
martenson committed Jun 8, 2023
1 parent e0d39fd commit 18f5686
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 20 deletions.
8 changes: 1 addition & 7 deletions client/src/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6058,12 +6058,6 @@ export interface components {
*/
username: string;
};
/**
* PageSortByEnum
* @description An enumeration.
* @enum {string}
*/
PageSortByEnum: "update_time" | "title" | "username";
/**
* PageSummary
* @description Base model definition with common configuration used by all derived models.
Expand Down Expand Up @@ -13044,7 +13038,7 @@ export interface operations {
user_id?: string;
show_published?: boolean;
show_shared?: boolean;
sort_by?: components["schemas"]["PageSortByEnum"];
sort_by?: "update_time" | "title" | "username";
sort_desc?: boolean;
limit?: number;
offset?: number;
Expand Down
5 changes: 4 additions & 1 deletion client/src/utils/navigation/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,11 @@ history_import:

pages:
selectors:
create: '.manage-table-actions .action-button'
create: '#page-create'
submit: '#submit'
drop: '.page-dropdown'
edit: '.dropdown-item-edit'
view: '.dropdown-item-view'
export: '.markdown-pdf-export'
dropdown: '[data-page-dropdown*="${id}"]'
index_table: "#page-table"
Expand Down
9 changes: 2 additions & 7 deletions lib/galaxy/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,20 +1257,15 @@ class InvocationIndexQueryPayload(Model):
offset: Optional[int] = Field(default=0, description="Number of invocations to skip")


class PageSortByEnum(str, Enum):
update_time = "update_time"
title = "title"
username = "username"
PageSortByEnum = Literal["update_time", "title", "username"]


class PageIndexQueryPayload(Model):
deleted: bool = False
show_published: Optional[bool] = None
show_shared: Optional[bool] = None
user_id: Optional[DecodedDatabaseIdField] = None
sort_by: PageSortByEnum = Field(
PageSortByEnum.update_time, title="Sort By", description="Sort pages by this attribute"
)
sort_by: PageSortByEnum = Field("update_time", title="Sort By", description="Sort pages by this attribute")
sort_desc: Optional[bool] = Field(default=False, title="Sort descending", description="Sort in descending order.")
search: Optional[str] = Field(default=None, title="Filter text", description="Freetext to search.")
limit: Optional[int] = Field(default=100, lt=1000, title="Limit", description="Maximum number of pages to return.")
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/api/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@


SortByQueryParam: PageSortByEnum = Query(
default=PageSortByEnum.update_time,
default="update_time",
title="Sort attribute",
description="Sort page index by this specified attribute on the page model",
)
Expand Down
5 changes: 4 additions & 1 deletion lib/galaxy/webapps/galaxy/services/pages.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
from typing import Tuple

from galaxy import exceptions
from galaxy.celery.tasks import prepare_pdf_download
Expand Down Expand Up @@ -55,7 +56,9 @@ def __init__(
self.shareable_service = ShareableService(self.manager, self.serializer)
self.short_term_storage_allocator = short_term_storage_allocator

def index(self, trans, payload: PageIndexQueryPayload, include_total_count: bool = False) -> PageSummaryList:
def index(
self, trans, payload: PageIndexQueryPayload, include_total_count: bool = False
) -> Tuple[PageSummaryList, int]:
"""Return a list of Pages viewable by the user
:param deleted: Display deleted pages
Expand Down
8 changes: 5 additions & 3 deletions test/integration_selenium/test_pages_pdf_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ def handle_galaxy_config_kwds(cls, config):
def test_page_pdf_export(self):
self.navigate_to_pages()
self.screenshot("pages_grid")
name = self.create_page()
self.click_grid_popup_option(name, "Edit content")
self.create_page()
self.components.pages.drop.wait_for_and_click()
self.components.pages.edit.wait_for_and_click()
self.components.pages.editor.markdown_editor.wait_for_and_send_keys("moo\n\n\ncow\n\n")
self.screenshot("pages_markdown_editor")
self.sleep_for(self.wait_types.UX_RENDER)
Expand All @@ -26,7 +27,8 @@ def test_page_pdf_export(self):
self.screenshot("pages_markdown_editor_saved")
self.sleep_for(self.wait_types.UX_RENDER)
self.navigate_to_pages()
self.click_grid_popup_option(name, "View")
self.components.pages.drop.wait_for_and_click()
self.components.pages.view.wait_for_and_click()
self.screenshot("pages_view_simple")
self.components.pages.export.wait_for_and_click()
self.sleep_for(self.wait_types.UX_RENDER)

0 comments on commit 18f5686

Please sign in to comment.