juggle the enums in schema

see https://github.com/galaxyproject/galaxy/pull/15774 for context

update page =pdf export selenium test

update return type to reflect matches being returned

cleanup the test file

run make format
This commit is contained in:
Martin Cech
2023-06-14 13:56:29 -07:00
parent d2b1e451a4
commit 3ba401fa4a
6 changed files with 17 additions and 20 deletions
+1 -7
View File
@@ -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.
@@ -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;
+4 -1
View File
@@ -485,8 +485,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"
+2 -7
View File
@@ -1257,10 +1257,7 @@ 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):
@@ -1268,9 +1265,7 @@ class PageIndexQueryPayload(Model):
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.")
+1 -1
View File
@@ -61,7 +61,7 @@ ShowSharedQueryParam: bool = Query(default=False, title="Include pages shared wi
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",
)
+4 -1
View File
@@ -1,4 +1,5 @@
import logging
from typing import Tuple
from galaxy import exceptions
from galaxy.celery.tasks import prepare_pdf_download
@@ -56,7 +57,9 @@ class PagesService(ServiceBase):
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
@@ -16,8 +16,9 @@ class TestPagesPdfExportSeleniumIntegration(SeleniumIntegrationTestCase):
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)
@@ -26,7 +27,8 @@ class TestPagesPdfExportSeleniumIntegration(SeleniumIntegrationTestCase):
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)