From 1cfedc67ae2981a8683b7b15d2c76740eadb99d1 Mon Sep 17 00:00:00 2001 From: tphvu-axonivy Date: Mon, 25 Nov 2024 11:51:30 +0700 Subject: [PATCH 1/3] IVYPORTAL-17571-Remove-unused-function-in-document-screenshot.js-MASTER - remove unused functions --- .../resources/js/document-screenshot.js | 235 +----------------- 1 file changed, 1 insertion(+), 234 deletions(-) diff --git a/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js b/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js index 8e9b4caacee..a1f7109ed04 100644 --- a/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js +++ b/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js @@ -1,53 +1,4 @@ -/***UTILITY FUNCTIONS FOR ANNOTATION AND HIGHLIGHT****/ -function appendStepAnnotation($element, number, top, left) { - var $marker = $("", {"class": "marker"}).text(number); - var markerTop = $element.offset().top; - var markerLeft = $element.offset().left; - if(top !== undefined) { - $marker.css('top', markerTop + top); - } - if(left !== undefined) { - $marker.css('left', markerLeft + left); - } - $('body').append($marker); -} - -function createRedThickOutline($element) { - $element.addClass("red-thick-outline"); -} - -function createRedMediumOutline($element) { - $element.addClass("red-medium-outline"); -} - -function clearRedMediumOutline($element) { - $element.removeClass("red-medium-outline"); -} - -function createRedMediumBorder($element) { - $element.addClass("red-medium-border"); -} - -function createRedThickOutlineWithOffset($element) { - $element.addClass("red-thick-outline"); - $element.addClass("red-outline-thick-offset"); -} - /***IMPLEMENTATION TO DECORATE PAGES - WHICH ARE CALLED IN SELENIUM****/ -function highlightDashboardWidget() { - createRedMediumOutline($("#task-widget")); - createRedMediumOutline($("#process-widget")); -} - -function highlightAndNumberingDashboardSections() { - var processWidget = $("#process-widget"); - createRedMediumOutline(processWidget); - appendStepAnnotation(processWidget, "1", 0 , processWidget.width()/2); - var taskWidget = $("#task-widget"); - createRedMediumOutline(taskWidget); - appendStepAnnotation(taskWidget, "2", 0, taskWidget.width()/2); -} - function numberingTaskFilter() { var taskOrder = jQuery("#task-widget\\:compact-task-widget-sort-menu"); appendStepAnnotation(taskOrder, 2, -15,100) @@ -82,31 +33,6 @@ function highlightLogo() { createRedMediumOutline($(".portal-home-logo.portal-home-logo-small")); } -function numberingTaskItem() { - var taskPriorityFirstRow = jQuery(".priority-cell:eq(0)"); - appendStepAnnotation(taskPriorityFirstRow, "1", -35, 0); - - var taskNameFirstRow = jQuery(".task-start-info-task-name:eq(0)"); - appendStepAnnotation(taskNameFirstRow, "2", -10, 160); - - var taskIdSecondRow = jQuery(".task-start-info-task-name:eq(1)"); - appendStepAnnotation(taskIdSecondRow, "3", -10, 170); - - var taskDatesThirddRow = jQuery(".task-start-info-content:eq(2)"); - appendStepAnnotation(taskDatesThirddRow, "4", -10, -45); - appendStepAnnotation(taskDatesThirddRow, "5", -10, 120); - - var taskDescriptionFourthRow = jQuery(".task-start-info-task-description:eq(3)"); - appendStepAnnotation(taskDescriptionFourthRow, "6", -10, 175); -} - -function numberingTaskFilterAndSort() { - var taskFilter = $("#task-widget\\:filter-form\\:filter-container"); - appendStepAnnotation(taskFilter, 1, -15, taskFilter.width()/2); - var taskSort = $("#task-widget\\:sort-task-form\\:sort-task-menu"); - appendStepAnnotation(taskSort, 2, -15, taskSort.width()/2); -} - function highlightProcessNavigation() { createRedThickOutlineWithOffset($('.layout-menu .PROCESS')); } @@ -202,72 +128,6 @@ function highlightShowMoreNoteLink() { createRedMediumOutline($('a.js-note-show-more-link')); } -function highlightCustomCaseList() { - var caseHeader = $("[id$='case-widget:widget-column-header']"); - createRedMediumOutline(caseHeader); - appendStepAnnotation(caseHeader, "1", -15, caseHeader.width()/2); - - var action = $(".case-header-container.case-header-data:eq(1)"); - createRedMediumOutline(action); - appendStepAnnotation(action, "2", -15, caseHeader.width()/2); -} - -function highlightCustomColumnsConfigOnCaseList() { - var customColumnHeader = $(".ui-commandlink.customized-case-header-column:eq(0)"); - createRedMediumOutline(customColumnHeader) - appendStepAnnotation(customColumnHeader, "1", -30, -20); - - var columnsCheckbox = $("[id$=':select-columns-form:columns-checkbox']"); - var customCheckbox = columnsCheckbox.find("td:eq(5)"); - createRedMediumOutline(customCheckbox); - appendStepAnnotation(customCheckbox, "2", -20, customCheckbox.width() - 10); - - var caseHeader = $(".case-info-row.js-case-start-link:eq(6)"); - var customCaseItemCell = caseHeader.find("span.customized-case-header-column:eq(0)"); - createRedMediumOutline(customCaseItemCell); - appendStepAnnotation(customCaseItemCell, "3", -20, - 20); -} - -function highlightCaseCreatorFilter() { - var filterLabel = $("[id$=':creator-filter:filter-open-form:advanced-filter-command']"); - createRedMediumOutline(filterLabel); - appendStepAnnotation(filterLabel, "1", -25, -30); - - var removeFilterCommand = $("[id$=':creator-filter:filter-open-form:advanced-filter-remove-command']"); - createRedMediumOutline(removeFilterCommand); - appendStepAnnotation(removeFilterCommand, "2", -25, removeFilterCommand.width()); - - var updateCommand = $("[id$=':creator-filter:filter-input-form:update-command']"); - createRedMediumOutline(updateCommand); - appendStepAnnotation(updateCommand, "3", -2, -40) -} - -function highlightEditSwitchProcessButton() { - var editSwitchCommand = $("[id$='process-widget:user-process-action-form:editing-switch-command']"); - createRedMediumOutline(editSwitchCommand); - appendStepAnnotation(editSwitchCommand, "1", -45, editSwitchCommand.width()/2); -} - -function highlightEditStepUserProcess(isDeleteProcess) { - var userProcessList = $("[id$='process-widget:edit-process-item-form:order-list-items']"); - var userProcessItem = userProcessList.find("li.ui-orderlist-item.ui-sortable-handle:eq(0)"); - if (isDeleteProcess) { - var processDeleteLink = userProcessItem.find("[id$=':process-delete-link']"); - createRedMediumOutline(processDeleteLink); - appendStepAnnotation(processDeleteLink, "2", -40, processDeleteLink.width()/2); - } else { - appendStepAnnotation(userProcessItem, "2", 4, userProcessItem.width()/2); - } - - var processSaveLink = $("[id$='process-widget:user-process-action-form:save-process-command']"); - createRedMediumOutline(processSaveLink); - appendStepAnnotation(processSaveLink, "3", -40, -20); -} - -function highlightSortUserProcess() { - createRedMediumOutline($("[id$=':user-process-action-form:name-sort-command']")); -} - function highlightProcessMoreInformationLink() { var displayingProcessItem = $(".js-process-start-list-item").filter(function() { if($(this).css('display') != 'none') @@ -280,47 +140,6 @@ function highlightProcessMoreInformationLink() { } // Task -function highlightCustomTaskList() { - var caseHeader = $("[id$='task-widget:task-widget-sub-header']"); - createRedMediumOutline(caseHeader); - appendStepAnnotation(caseHeader, "1", -15, caseHeader.width()/2); - - var action = $(".full-mode.task-start-list-item.js-task-start-list-item:eq(2)"); - createRedMediumOutline(action); - appendStepAnnotation(action, "2", -15, caseHeader.width()/2); -} - -function highlightCustomColumnsConfigOnTaskList() { - var customColumnHeader = $("[id$=':task-custom']")[0]; - createRedMediumOutline($(customColumnHeader)) - appendStepAnnotation($(customColumnHeader), "1", -30, -20); - - var columnsCheckbox = $("[id$='task-columns-configuration:select-columns-form:columns-checkbox']"); - var customCheckbox = columnsCheckbox.find("td:eq(7)"); - createRedMediumOutline(customCheckbox); - appendStepAnnotation(customCheckbox, "2", -20, customCheckbox.width() - 10); - - var taskHeader = $(".task-start-link.js-task-start-link:eq(4)"); - var customTaskItemCell = taskHeader.find(".task-custom-field-cell"); - createRedMediumOutline(customTaskItemCell); - appendStepAnnotation(customTaskItemCell, "3", -20, - 20); -} - - -function highlightTaskStateFilter() { - var filterLabel = $("[id$=':state-filter:filter-open-form:advanced-filter-command']"); - createRedMediumOutline(filterLabel); - appendStepAnnotation(filterLabel, "1", -25, -30); - - var removeFilterCommand = $("[id$=':state-filter:filter-open-form:advanced-filter-remove-command']"); - createRedMediumOutline(removeFilterCommand); - appendStepAnnotation(removeFilterCommand, "2", -25, removeFilterCommand.width()); - - var updateCommand = $("[id$=':state-filter:filter-input-form:update-command']"); - createRedMediumOutline(updateCommand); - appendStepAnnotation(updateCommand, "3", -2, -40) -} - function highlightJoinGroupChatOption() { createRedMediumOutline($('#horizontal-task-action-form\\:chat-group').parent()); } @@ -349,36 +168,10 @@ function scrollToMiddleOfLayoutContent() { window.scrollTo(0, document.body.scrollHeight/2); } -function scrollToMiddleOfLayoutContent2() { - window.scrollTo(0, document.body.scrollHeight/4); -} - function scrollToBottomOfLayoutContent() { window.scrollTo(0, document.body.scrollHeight); } -function highlightCustomTaskDetail() { - var customTop = $('.custom-task-details-panel-top'); - appendStepAnnotation(customTop, 1, -45, customTop.width()/2); - - var customBottom = $('.custom-task-details-panel-bottom'); - appendStepAnnotation(customBottom, 2, -45, customBottom.width()/2); -} - -function highlightCustomTaskDetailWithNewStyle() { - var customPanel1 = $('.custom-task-panel-1'); - appendStepAnnotation(customPanel1, 1, -10, customPanel1.width()/2); - - var customPanel2 = $('.custom-task-panel-2'); - appendStepAnnotation(customPanel2, 2, -10, customPanel2.width()/2); - - var customPanel3 = $('.custom-task-panel-3'); - appendStepAnnotation(customPanel3, 3, -10, customPanel3.width()/2); - - var customPanel4 = $('.custom-task-panel-4'); - appendStepAnnotation(customPanel4, 4, -10, customPanel4.width()/2); -} - function highlightCaseDetailComponents() { var general = $('#case-details-information-panel'); appendStepAnnotation(general, 1, 0, general.width()/2); @@ -423,14 +216,6 @@ function highlightTaskActionItem(taskIndex, actionIndex) { createRedMediumOutline(actionItem); } -function highlightShowAllProcesses() { - createRedThickOutlineWithOffset($('.layout-menu .PROCESS')); -} - -function highlightTaskExportToExcelButton() { - createRedMediumOutline($("[id$=':task-export-to-excel-form']")); -} - function highlightCaseExportToExcelButton() { createRedMediumOutline($("a[id$=':case-export-to-excel']")); } @@ -456,16 +241,6 @@ function highlightCustomWidgetInCaseDetails() { createRedMediumOutline($(".custom-widget-card")); } -function addStepToCustomWidgetTopTaskDetails() { - var topWidget = $(".custom-task-details-panel-top"); - appendStepAnnotation(topWidget, 1, -30, topWidget.width()/2) -} - -function addStepTCustomWidgetTopTaskDetails() { - var bottomWidget = $(".custom-task-details-panel-bottom"); - appendStepAnnotation(bottomWidget, 2, -30, bottomWidget.width()/2) -} - function highlightIFrameWidgetTaskDetails() { createRedMediumOutline($(".custom-widget-card.task-detail-card")); } @@ -482,10 +257,6 @@ function clearHighlightUserName() { clearRedMediumOutline($('#user-settings-menu')); } -function highlightServerInfo() { - createRedMediumOutline($("#server-infor")); -} - function highlightUserExampleNavigation() { createRedThickOutlineWithOffset($('.layout-menu .CUSTOM')); } @@ -558,8 +329,4 @@ function createBlackThinOutline($element) { function createBlackMediumOutline($element) { $element.addClass("black-medium-outline"); -} - -function highlightElement(elementSelector) { - createRedMediumOutline($(elementSelector)); -} +} \ No newline at end of file From 704decff676f0ffa0f842dee04eea4fe312a8f7f Mon Sep 17 00:00:00 2001 From: tphvu-axonivy Date: Tue, 26 Nov 2024 16:03:47 +0700 Subject: [PATCH 2/3] Revert "IVYPORTAL-17571-Remove-unused-function-in-document-screenshot.js-MASTER" This reverts commit 1cfedc67ae2981a8683b7b15d2c76740eadb99d1. --- .../resources/js/document-screenshot.js | 235 +++++++++++++++++- 1 file changed, 234 insertions(+), 1 deletion(-) diff --git a/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js b/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js index a1f7109ed04..8e9b4caacee 100644 --- a/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js +++ b/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js @@ -1,4 +1,53 @@ +/***UTILITY FUNCTIONS FOR ANNOTATION AND HIGHLIGHT****/ +function appendStepAnnotation($element, number, top, left) { + var $marker = $("", {"class": "marker"}).text(number); + var markerTop = $element.offset().top; + var markerLeft = $element.offset().left; + if(top !== undefined) { + $marker.css('top', markerTop + top); + } + if(left !== undefined) { + $marker.css('left', markerLeft + left); + } + $('body').append($marker); +} + +function createRedThickOutline($element) { + $element.addClass("red-thick-outline"); +} + +function createRedMediumOutline($element) { + $element.addClass("red-medium-outline"); +} + +function clearRedMediumOutline($element) { + $element.removeClass("red-medium-outline"); +} + +function createRedMediumBorder($element) { + $element.addClass("red-medium-border"); +} + +function createRedThickOutlineWithOffset($element) { + $element.addClass("red-thick-outline"); + $element.addClass("red-outline-thick-offset"); +} + /***IMPLEMENTATION TO DECORATE PAGES - WHICH ARE CALLED IN SELENIUM****/ +function highlightDashboardWidget() { + createRedMediumOutline($("#task-widget")); + createRedMediumOutline($("#process-widget")); +} + +function highlightAndNumberingDashboardSections() { + var processWidget = $("#process-widget"); + createRedMediumOutline(processWidget); + appendStepAnnotation(processWidget, "1", 0 , processWidget.width()/2); + var taskWidget = $("#task-widget"); + createRedMediumOutline(taskWidget); + appendStepAnnotation(taskWidget, "2", 0, taskWidget.width()/2); +} + function numberingTaskFilter() { var taskOrder = jQuery("#task-widget\\:compact-task-widget-sort-menu"); appendStepAnnotation(taskOrder, 2, -15,100) @@ -33,6 +82,31 @@ function highlightLogo() { createRedMediumOutline($(".portal-home-logo.portal-home-logo-small")); } +function numberingTaskItem() { + var taskPriorityFirstRow = jQuery(".priority-cell:eq(0)"); + appendStepAnnotation(taskPriorityFirstRow, "1", -35, 0); + + var taskNameFirstRow = jQuery(".task-start-info-task-name:eq(0)"); + appendStepAnnotation(taskNameFirstRow, "2", -10, 160); + + var taskIdSecondRow = jQuery(".task-start-info-task-name:eq(1)"); + appendStepAnnotation(taskIdSecondRow, "3", -10, 170); + + var taskDatesThirddRow = jQuery(".task-start-info-content:eq(2)"); + appendStepAnnotation(taskDatesThirddRow, "4", -10, -45); + appendStepAnnotation(taskDatesThirddRow, "5", -10, 120); + + var taskDescriptionFourthRow = jQuery(".task-start-info-task-description:eq(3)"); + appendStepAnnotation(taskDescriptionFourthRow, "6", -10, 175); +} + +function numberingTaskFilterAndSort() { + var taskFilter = $("#task-widget\\:filter-form\\:filter-container"); + appendStepAnnotation(taskFilter, 1, -15, taskFilter.width()/2); + var taskSort = $("#task-widget\\:sort-task-form\\:sort-task-menu"); + appendStepAnnotation(taskSort, 2, -15, taskSort.width()/2); +} + function highlightProcessNavigation() { createRedThickOutlineWithOffset($('.layout-menu .PROCESS')); } @@ -128,6 +202,72 @@ function highlightShowMoreNoteLink() { createRedMediumOutline($('a.js-note-show-more-link')); } +function highlightCustomCaseList() { + var caseHeader = $("[id$='case-widget:widget-column-header']"); + createRedMediumOutline(caseHeader); + appendStepAnnotation(caseHeader, "1", -15, caseHeader.width()/2); + + var action = $(".case-header-container.case-header-data:eq(1)"); + createRedMediumOutline(action); + appendStepAnnotation(action, "2", -15, caseHeader.width()/2); +} + +function highlightCustomColumnsConfigOnCaseList() { + var customColumnHeader = $(".ui-commandlink.customized-case-header-column:eq(0)"); + createRedMediumOutline(customColumnHeader) + appendStepAnnotation(customColumnHeader, "1", -30, -20); + + var columnsCheckbox = $("[id$=':select-columns-form:columns-checkbox']"); + var customCheckbox = columnsCheckbox.find("td:eq(5)"); + createRedMediumOutline(customCheckbox); + appendStepAnnotation(customCheckbox, "2", -20, customCheckbox.width() - 10); + + var caseHeader = $(".case-info-row.js-case-start-link:eq(6)"); + var customCaseItemCell = caseHeader.find("span.customized-case-header-column:eq(0)"); + createRedMediumOutline(customCaseItemCell); + appendStepAnnotation(customCaseItemCell, "3", -20, - 20); +} + +function highlightCaseCreatorFilter() { + var filterLabel = $("[id$=':creator-filter:filter-open-form:advanced-filter-command']"); + createRedMediumOutline(filterLabel); + appendStepAnnotation(filterLabel, "1", -25, -30); + + var removeFilterCommand = $("[id$=':creator-filter:filter-open-form:advanced-filter-remove-command']"); + createRedMediumOutline(removeFilterCommand); + appendStepAnnotation(removeFilterCommand, "2", -25, removeFilterCommand.width()); + + var updateCommand = $("[id$=':creator-filter:filter-input-form:update-command']"); + createRedMediumOutline(updateCommand); + appendStepAnnotation(updateCommand, "3", -2, -40) +} + +function highlightEditSwitchProcessButton() { + var editSwitchCommand = $("[id$='process-widget:user-process-action-form:editing-switch-command']"); + createRedMediumOutline(editSwitchCommand); + appendStepAnnotation(editSwitchCommand, "1", -45, editSwitchCommand.width()/2); +} + +function highlightEditStepUserProcess(isDeleteProcess) { + var userProcessList = $("[id$='process-widget:edit-process-item-form:order-list-items']"); + var userProcessItem = userProcessList.find("li.ui-orderlist-item.ui-sortable-handle:eq(0)"); + if (isDeleteProcess) { + var processDeleteLink = userProcessItem.find("[id$=':process-delete-link']"); + createRedMediumOutline(processDeleteLink); + appendStepAnnotation(processDeleteLink, "2", -40, processDeleteLink.width()/2); + } else { + appendStepAnnotation(userProcessItem, "2", 4, userProcessItem.width()/2); + } + + var processSaveLink = $("[id$='process-widget:user-process-action-form:save-process-command']"); + createRedMediumOutline(processSaveLink); + appendStepAnnotation(processSaveLink, "3", -40, -20); +} + +function highlightSortUserProcess() { + createRedMediumOutline($("[id$=':user-process-action-form:name-sort-command']")); +} + function highlightProcessMoreInformationLink() { var displayingProcessItem = $(".js-process-start-list-item").filter(function() { if($(this).css('display') != 'none') @@ -140,6 +280,47 @@ function highlightProcessMoreInformationLink() { } // Task +function highlightCustomTaskList() { + var caseHeader = $("[id$='task-widget:task-widget-sub-header']"); + createRedMediumOutline(caseHeader); + appendStepAnnotation(caseHeader, "1", -15, caseHeader.width()/2); + + var action = $(".full-mode.task-start-list-item.js-task-start-list-item:eq(2)"); + createRedMediumOutline(action); + appendStepAnnotation(action, "2", -15, caseHeader.width()/2); +} + +function highlightCustomColumnsConfigOnTaskList() { + var customColumnHeader = $("[id$=':task-custom']")[0]; + createRedMediumOutline($(customColumnHeader)) + appendStepAnnotation($(customColumnHeader), "1", -30, -20); + + var columnsCheckbox = $("[id$='task-columns-configuration:select-columns-form:columns-checkbox']"); + var customCheckbox = columnsCheckbox.find("td:eq(7)"); + createRedMediumOutline(customCheckbox); + appendStepAnnotation(customCheckbox, "2", -20, customCheckbox.width() - 10); + + var taskHeader = $(".task-start-link.js-task-start-link:eq(4)"); + var customTaskItemCell = taskHeader.find(".task-custom-field-cell"); + createRedMediumOutline(customTaskItemCell); + appendStepAnnotation(customTaskItemCell, "3", -20, - 20); +} + + +function highlightTaskStateFilter() { + var filterLabel = $("[id$=':state-filter:filter-open-form:advanced-filter-command']"); + createRedMediumOutline(filterLabel); + appendStepAnnotation(filterLabel, "1", -25, -30); + + var removeFilterCommand = $("[id$=':state-filter:filter-open-form:advanced-filter-remove-command']"); + createRedMediumOutline(removeFilterCommand); + appendStepAnnotation(removeFilterCommand, "2", -25, removeFilterCommand.width()); + + var updateCommand = $("[id$=':state-filter:filter-input-form:update-command']"); + createRedMediumOutline(updateCommand); + appendStepAnnotation(updateCommand, "3", -2, -40) +} + function highlightJoinGroupChatOption() { createRedMediumOutline($('#horizontal-task-action-form\\:chat-group').parent()); } @@ -168,10 +349,36 @@ function scrollToMiddleOfLayoutContent() { window.scrollTo(0, document.body.scrollHeight/2); } +function scrollToMiddleOfLayoutContent2() { + window.scrollTo(0, document.body.scrollHeight/4); +} + function scrollToBottomOfLayoutContent() { window.scrollTo(0, document.body.scrollHeight); } +function highlightCustomTaskDetail() { + var customTop = $('.custom-task-details-panel-top'); + appendStepAnnotation(customTop, 1, -45, customTop.width()/2); + + var customBottom = $('.custom-task-details-panel-bottom'); + appendStepAnnotation(customBottom, 2, -45, customBottom.width()/2); +} + +function highlightCustomTaskDetailWithNewStyle() { + var customPanel1 = $('.custom-task-panel-1'); + appendStepAnnotation(customPanel1, 1, -10, customPanel1.width()/2); + + var customPanel2 = $('.custom-task-panel-2'); + appendStepAnnotation(customPanel2, 2, -10, customPanel2.width()/2); + + var customPanel3 = $('.custom-task-panel-3'); + appendStepAnnotation(customPanel3, 3, -10, customPanel3.width()/2); + + var customPanel4 = $('.custom-task-panel-4'); + appendStepAnnotation(customPanel4, 4, -10, customPanel4.width()/2); +} + function highlightCaseDetailComponents() { var general = $('#case-details-information-panel'); appendStepAnnotation(general, 1, 0, general.width()/2); @@ -216,6 +423,14 @@ function highlightTaskActionItem(taskIndex, actionIndex) { createRedMediumOutline(actionItem); } +function highlightShowAllProcesses() { + createRedThickOutlineWithOffset($('.layout-menu .PROCESS')); +} + +function highlightTaskExportToExcelButton() { + createRedMediumOutline($("[id$=':task-export-to-excel-form']")); +} + function highlightCaseExportToExcelButton() { createRedMediumOutline($("a[id$=':case-export-to-excel']")); } @@ -241,6 +456,16 @@ function highlightCustomWidgetInCaseDetails() { createRedMediumOutline($(".custom-widget-card")); } +function addStepToCustomWidgetTopTaskDetails() { + var topWidget = $(".custom-task-details-panel-top"); + appendStepAnnotation(topWidget, 1, -30, topWidget.width()/2) +} + +function addStepTCustomWidgetTopTaskDetails() { + var bottomWidget = $(".custom-task-details-panel-bottom"); + appendStepAnnotation(bottomWidget, 2, -30, bottomWidget.width()/2) +} + function highlightIFrameWidgetTaskDetails() { createRedMediumOutline($(".custom-widget-card.task-detail-card")); } @@ -257,6 +482,10 @@ function clearHighlightUserName() { clearRedMediumOutline($('#user-settings-menu')); } +function highlightServerInfo() { + createRedMediumOutline($("#server-infor")); +} + function highlightUserExampleNavigation() { createRedThickOutlineWithOffset($('.layout-menu .CUSTOM')); } @@ -329,4 +558,8 @@ function createBlackThinOutline($element) { function createBlackMediumOutline($element) { $element.addClass("black-medium-outline"); -} \ No newline at end of file +} + +function highlightElement(elementSelector) { + createRedMediumOutline($(elementSelector)); +} From d6ddf55fa111479beaa1b1ec24ad6c77bcf59839 Mon Sep 17 00:00:00 2001 From: tphvu-axonivy Date: Wed, 27 Nov 2024 22:34:15 +0700 Subject: [PATCH 3/3] IVYPORTAL-17571-Remove-unused-function-in-document-screenshot.js-MASTER - delete unused functions --- .../resources/js/document-screenshot.js | 205 +----------------- 1 file changed, 1 insertion(+), 204 deletions(-) diff --git a/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js b/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js index 8e9b4caacee..dca9849fadd 100644 --- a/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js +++ b/AxonIvyPortal/portal-selenium-test/resources/js/document-screenshot.js @@ -34,25 +34,6 @@ function createRedThickOutlineWithOffset($element) { } /***IMPLEMENTATION TO DECORATE PAGES - WHICH ARE CALLED IN SELENIUM****/ -function highlightDashboardWidget() { - createRedMediumOutline($("#task-widget")); - createRedMediumOutline($("#process-widget")); -} - -function highlightAndNumberingDashboardSections() { - var processWidget = $("#process-widget"); - createRedMediumOutline(processWidget); - appendStepAnnotation(processWidget, "1", 0 , processWidget.width()/2); - var taskWidget = $("#task-widget"); - createRedMediumOutline(taskWidget); - appendStepAnnotation(taskWidget, "2", 0, taskWidget.width()/2); -} - -function numberingTaskFilter() { - var taskOrder = jQuery("#task-widget\\:compact-task-widget-sort-menu"); - appendStepAnnotation(taskOrder, 2, -15,100) -} - function highlightTopBar() { var topMenu = $("#top-menu"); var searchIcon = topMenu.find("li.topbar-item.search-item"); @@ -82,31 +63,6 @@ function highlightLogo() { createRedMediumOutline($(".portal-home-logo.portal-home-logo-small")); } -function numberingTaskItem() { - var taskPriorityFirstRow = jQuery(".priority-cell:eq(0)"); - appendStepAnnotation(taskPriorityFirstRow, "1", -35, 0); - - var taskNameFirstRow = jQuery(".task-start-info-task-name:eq(0)"); - appendStepAnnotation(taskNameFirstRow, "2", -10, 160); - - var taskIdSecondRow = jQuery(".task-start-info-task-name:eq(1)"); - appendStepAnnotation(taskIdSecondRow, "3", -10, 170); - - var taskDatesThirddRow = jQuery(".task-start-info-content:eq(2)"); - appendStepAnnotation(taskDatesThirddRow, "4", -10, -45); - appendStepAnnotation(taskDatesThirddRow, "5", -10, 120); - - var taskDescriptionFourthRow = jQuery(".task-start-info-task-description:eq(3)"); - appendStepAnnotation(taskDescriptionFourthRow, "6", -10, 175); -} - -function numberingTaskFilterAndSort() { - var taskFilter = $("#task-widget\\:filter-form\\:filter-container"); - appendStepAnnotation(taskFilter, 1, -15, taskFilter.width()/2); - var taskSort = $("#task-widget\\:sort-task-form\\:sort-task-menu"); - appendStepAnnotation(taskSort, 2, -15, taskSort.width()/2); -} - function highlightProcessNavigation() { createRedThickOutlineWithOffset($('.layout-menu .PROCESS')); } @@ -202,72 +158,6 @@ function highlightShowMoreNoteLink() { createRedMediumOutline($('a.js-note-show-more-link')); } -function highlightCustomCaseList() { - var caseHeader = $("[id$='case-widget:widget-column-header']"); - createRedMediumOutline(caseHeader); - appendStepAnnotation(caseHeader, "1", -15, caseHeader.width()/2); - - var action = $(".case-header-container.case-header-data:eq(1)"); - createRedMediumOutline(action); - appendStepAnnotation(action, "2", -15, caseHeader.width()/2); -} - -function highlightCustomColumnsConfigOnCaseList() { - var customColumnHeader = $(".ui-commandlink.customized-case-header-column:eq(0)"); - createRedMediumOutline(customColumnHeader) - appendStepAnnotation(customColumnHeader, "1", -30, -20); - - var columnsCheckbox = $("[id$=':select-columns-form:columns-checkbox']"); - var customCheckbox = columnsCheckbox.find("td:eq(5)"); - createRedMediumOutline(customCheckbox); - appendStepAnnotation(customCheckbox, "2", -20, customCheckbox.width() - 10); - - var caseHeader = $(".case-info-row.js-case-start-link:eq(6)"); - var customCaseItemCell = caseHeader.find("span.customized-case-header-column:eq(0)"); - createRedMediumOutline(customCaseItemCell); - appendStepAnnotation(customCaseItemCell, "3", -20, - 20); -} - -function highlightCaseCreatorFilter() { - var filterLabel = $("[id$=':creator-filter:filter-open-form:advanced-filter-command']"); - createRedMediumOutline(filterLabel); - appendStepAnnotation(filterLabel, "1", -25, -30); - - var removeFilterCommand = $("[id$=':creator-filter:filter-open-form:advanced-filter-remove-command']"); - createRedMediumOutline(removeFilterCommand); - appendStepAnnotation(removeFilterCommand, "2", -25, removeFilterCommand.width()); - - var updateCommand = $("[id$=':creator-filter:filter-input-form:update-command']"); - createRedMediumOutline(updateCommand); - appendStepAnnotation(updateCommand, "3", -2, -40) -} - -function highlightEditSwitchProcessButton() { - var editSwitchCommand = $("[id$='process-widget:user-process-action-form:editing-switch-command']"); - createRedMediumOutline(editSwitchCommand); - appendStepAnnotation(editSwitchCommand, "1", -45, editSwitchCommand.width()/2); -} - -function highlightEditStepUserProcess(isDeleteProcess) { - var userProcessList = $("[id$='process-widget:edit-process-item-form:order-list-items']"); - var userProcessItem = userProcessList.find("li.ui-orderlist-item.ui-sortable-handle:eq(0)"); - if (isDeleteProcess) { - var processDeleteLink = userProcessItem.find("[id$=':process-delete-link']"); - createRedMediumOutline(processDeleteLink); - appendStepAnnotation(processDeleteLink, "2", -40, processDeleteLink.width()/2); - } else { - appendStepAnnotation(userProcessItem, "2", 4, userProcessItem.width()/2); - } - - var processSaveLink = $("[id$='process-widget:user-process-action-form:save-process-command']"); - createRedMediumOutline(processSaveLink); - appendStepAnnotation(processSaveLink, "3", -40, -20); -} - -function highlightSortUserProcess() { - createRedMediumOutline($("[id$=':user-process-action-form:name-sort-command']")); -} - function highlightProcessMoreInformationLink() { var displayingProcessItem = $(".js-process-start-list-item").filter(function() { if($(this).css('display') != 'none') @@ -280,47 +170,6 @@ function highlightProcessMoreInformationLink() { } // Task -function highlightCustomTaskList() { - var caseHeader = $("[id$='task-widget:task-widget-sub-header']"); - createRedMediumOutline(caseHeader); - appendStepAnnotation(caseHeader, "1", -15, caseHeader.width()/2); - - var action = $(".full-mode.task-start-list-item.js-task-start-list-item:eq(2)"); - createRedMediumOutline(action); - appendStepAnnotation(action, "2", -15, caseHeader.width()/2); -} - -function highlightCustomColumnsConfigOnTaskList() { - var customColumnHeader = $("[id$=':task-custom']")[0]; - createRedMediumOutline($(customColumnHeader)) - appendStepAnnotation($(customColumnHeader), "1", -30, -20); - - var columnsCheckbox = $("[id$='task-columns-configuration:select-columns-form:columns-checkbox']"); - var customCheckbox = columnsCheckbox.find("td:eq(7)"); - createRedMediumOutline(customCheckbox); - appendStepAnnotation(customCheckbox, "2", -20, customCheckbox.width() - 10); - - var taskHeader = $(".task-start-link.js-task-start-link:eq(4)"); - var customTaskItemCell = taskHeader.find(".task-custom-field-cell"); - createRedMediumOutline(customTaskItemCell); - appendStepAnnotation(customTaskItemCell, "3", -20, - 20); -} - - -function highlightTaskStateFilter() { - var filterLabel = $("[id$=':state-filter:filter-open-form:advanced-filter-command']"); - createRedMediumOutline(filterLabel); - appendStepAnnotation(filterLabel, "1", -25, -30); - - var removeFilterCommand = $("[id$=':state-filter:filter-open-form:advanced-filter-remove-command']"); - createRedMediumOutline(removeFilterCommand); - appendStepAnnotation(removeFilterCommand, "2", -25, removeFilterCommand.width()); - - var updateCommand = $("[id$=':state-filter:filter-input-form:update-command']"); - createRedMediumOutline(updateCommand); - appendStepAnnotation(updateCommand, "3", -2, -40) -} - function highlightJoinGroupChatOption() { createRedMediumOutline($('#horizontal-task-action-form\\:chat-group').parent()); } @@ -349,36 +198,10 @@ function scrollToMiddleOfLayoutContent() { window.scrollTo(0, document.body.scrollHeight/2); } -function scrollToMiddleOfLayoutContent2() { - window.scrollTo(0, document.body.scrollHeight/4); -} - function scrollToBottomOfLayoutContent() { window.scrollTo(0, document.body.scrollHeight); } -function highlightCustomTaskDetail() { - var customTop = $('.custom-task-details-panel-top'); - appendStepAnnotation(customTop, 1, -45, customTop.width()/2); - - var customBottom = $('.custom-task-details-panel-bottom'); - appendStepAnnotation(customBottom, 2, -45, customBottom.width()/2); -} - -function highlightCustomTaskDetailWithNewStyle() { - var customPanel1 = $('.custom-task-panel-1'); - appendStepAnnotation(customPanel1, 1, -10, customPanel1.width()/2); - - var customPanel2 = $('.custom-task-panel-2'); - appendStepAnnotation(customPanel2, 2, -10, customPanel2.width()/2); - - var customPanel3 = $('.custom-task-panel-3'); - appendStepAnnotation(customPanel3, 3, -10, customPanel3.width()/2); - - var customPanel4 = $('.custom-task-panel-4'); - appendStepAnnotation(customPanel4, 4, -10, customPanel4.width()/2); -} - function highlightCaseDetailComponents() { var general = $('#case-details-information-panel'); appendStepAnnotation(general, 1, 0, general.width()/2); @@ -423,14 +246,6 @@ function highlightTaskActionItem(taskIndex, actionIndex) { createRedMediumOutline(actionItem); } -function highlightShowAllProcesses() { - createRedThickOutlineWithOffset($('.layout-menu .PROCESS')); -} - -function highlightTaskExportToExcelButton() { - createRedMediumOutline($("[id$=':task-export-to-excel-form']")); -} - function highlightCaseExportToExcelButton() { createRedMediumOutline($("a[id$=':case-export-to-excel']")); } @@ -456,16 +271,6 @@ function highlightCustomWidgetInCaseDetails() { createRedMediumOutline($(".custom-widget-card")); } -function addStepToCustomWidgetTopTaskDetails() { - var topWidget = $(".custom-task-details-panel-top"); - appendStepAnnotation(topWidget, 1, -30, topWidget.width()/2) -} - -function addStepTCustomWidgetTopTaskDetails() { - var bottomWidget = $(".custom-task-details-panel-bottom"); - appendStepAnnotation(bottomWidget, 2, -30, bottomWidget.width()/2) -} - function highlightIFrameWidgetTaskDetails() { createRedMediumOutline($(".custom-widget-card.task-detail-card")); } @@ -482,10 +287,6 @@ function clearHighlightUserName() { clearRedMediumOutline($('#user-settings-menu')); } -function highlightServerInfo() { - createRedMediumOutline($("#server-infor")); -} - function highlightUserExampleNavigation() { createRedThickOutlineWithOffset($('.layout-menu .CUSTOM')); } @@ -558,8 +359,4 @@ function createBlackThinOutline($element) { function createBlackMediumOutline($element) { $element.addClass("black-medium-outline"); -} - -function highlightElement(elementSelector) { - createRedMediumOutline($(elementSelector)); -} +} \ No newline at end of file