diff --git a/client/src/components/Page/PageList.vue b/client/src/components/Page/PageList.vue new file mode 100644 index 000000000000..bb7e530d82ac --- /dev/null +++ b/client/src/components/Page/PageList.vue @@ -0,0 +1,194 @@ + + diff --git a/client/src/entry/analysis/router.js b/client/src/entry/analysis/router.js index 34073244c8d4..3b280d475254 100644 --- a/client/src/entry/analysis/router.js +++ b/client/src/entry/analysis/router.js @@ -22,9 +22,9 @@ import DatasetError from "components/DatasetInformation/DatasetError"; import DatasetList from "components/Dataset/DatasetList"; import DisplayStructured from "components/DisplayStructured"; import FormGeneric from "components/Form/FormGeneric"; -import Grid from "components/Grid/Grid"; import GridShared from "components/Grid/GridShared"; import GridHistory from "components/Grid/GridHistory"; +import PageList from "components/Page/PageList"; import HistoryImport from "components/HistoryImport"; import HistoryView from "components/HistoryView"; import HistoryInvocations from "components/Workflow/HistoryInvocations"; @@ -254,11 +254,9 @@ export function getRouter(Galaxy) { }, { path: "pages/:actionId", - component: GridShared, + component: PageList, props: (route) => ({ - actionId: route.params.actionId, - item: "page", - plural: "Pages", + published: route.props.actionId == "list_published" ? "shared" : "user", }), }, { diff --git a/client/src/utils/navigation/navigation.yml b/client/src/utils/navigation/navigation.yml index 08eca347648e..4eaad9d852c6 100644 --- a/client/src/utils/navigation/navigation.yml +++ b/client/src/utils/navigation/navigation.yml @@ -458,6 +458,8 @@ pages: submit: '#submit' export: '.markdown-pdf-export' dropdown: '[data-page-dropdown*="${id}"]' + index_table: "#page-table" + index_rows: "#page-table > tbody > tr:not(.b-table-empty-row, [style*='display: none'])" editor: selectors: diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 3a334e414538..774d1bdd9857 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -8877,6 +8877,8 @@ class Page(Base, Dictifiable, RepresentById): "importable", "deleted", "username", + "create_time", + "update_time", ] def to_dict(self, view="element"): diff --git a/lib/galaxy/schema/schema.py b/lib/galaxy/schema/schema.py index 8234377dd930..cc12b1e2e670 100644 --- a/lib/galaxy/schema/schema.py +++ b/lib/galaxy/schema/schema.py @@ -3120,6 +3120,8 @@ class PageSummary(PageSummaryBase): title="List of revisions", description="The history with the encoded ID of each revision of the Page.", ) + create_time: Optional[datetime] = CreateTimeField + update_time: Optional[datetime] = UpdateTimeField class PageDetails(PageSummary): diff --git a/lib/galaxy/selenium/navigates_galaxy.py b/lib/galaxy/selenium/navigates_galaxy.py index 4ac7770f9ffe..c3135569b8ea 100644 --- a/lib/galaxy/selenium/navigates_galaxy.py +++ b/lib/galaxy/selenium/navigates_galaxy.py @@ -1250,6 +1250,16 @@ def clear_tooltips(self): action_chains.move_to_element(center_element).perform() self.wait_for_selector_absent_or_hidden(".b-tooltip", wait_type=WAIT_TYPES.UX_POPUP) + def pages_index_table_elements(self): + pages = self.components.pages + pages.index_table.wait_for_visible() + return pages.index_rows.all() + + def page_index_click_option(self, option_title, page_id): + self.components.pages.dropdown(id=page_id).wait_for_and_click() + if not self.select_dropdown_item(option_title): + raise AssertionError(f"Failed to find page action option with title [{option_title}]") + def workflow_index_open(self): self.home() self.click_masthead_workflow() diff --git a/lib/galaxy_test/selenium/test_pages_index.py b/lib/galaxy_test/selenium/test_pages_index.py new file mode 100644 index 000000000000..ea71fa080a18 --- /dev/null +++ b/lib/galaxy_test/selenium/test_pages_index.py @@ -0,0 +1,34 @@ +from .framework import ( + retry_assertion_during_transitions, + selenium_test, + SeleniumTestCase, +) + + +class PagesTestCase(SeleniumTestCase): + + ensure_registered = True + + @selenium_test + def test_page_deletion(self): + page_response = self.new_page() + page_id = page_response["id"] + self.navigate_to_pages() + self._assert_showing_n_pages(1) + self.components.pages.dropdown(id=page_id).wait_for_visible() + self.page_index_click_option("Delete", page_id) + self.accept_alert() + self.components.pages.dropdown(id=page_id).wait_for_absent_or_hidden() + self._assert_showing_n_pages(0) + + def new_page(self): + slug = self._get_random_name() + response = self.dataset_populator.new_page(slug=slug) + return response + + @retry_assertion_during_transitions + def _assert_showing_n_pages(self, n): + actual_count = len(self.pages_index_table_elements()) + if actual_count != n: + message = f"Expected {n} pages to be displayed, based on DOM found {actual_count} page index rows." + raise AssertionError(message)