mirror of
https://github.com/bringout/oca-ocb-project.git
synced 2026-04-22 11:42:09 +02:00
19.0 vanilla
This commit is contained in:
parent
a2f74aefd8
commit
4a4d12c333
844 changed files with 212348 additions and 270090 deletions
|
|
@ -1,115 +1,256 @@
|
|||
/** @odoo-module **/
|
||||
import { delay } from "@web/core/utils/concurrency";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_utils";
|
||||
|
||||
import tour from 'web_tour.tour';
|
||||
|
||||
const projectSharingSteps = [...tour.stepUtils.goToAppSteps("project.menu_main_pm", 'Go to the Project App.'), {
|
||||
trigger: '.oe_kanban_global_click :contains("Project Sharing") button.o_dropdown_kanban',
|
||||
content: 'Open the project dropdown.'
|
||||
const projectSharingSteps = [...stepUtils.goToAppSteps("project.menu_main_pm", 'Go to the Project App.'), {
|
||||
trigger: ".o_kanban_record:contains(Project Sharing)",
|
||||
content: 'Open the project dropdown.',
|
||||
run: "hover && click .o_kanban_record:contains(Project Sharing) .o_dropdown_kanban .dropdown-toggle",
|
||||
}, {
|
||||
trigger: '.o_kanban_record:contains("Project Sharing") .dropdown-menu a:contains("Share")',
|
||||
trigger: '.dropdown-menu a:contains("Share")',
|
||||
content: 'Start editing the project.',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: 'div.o_field_radio[name="access_mode"] div.o_radio_item > input[data-value="edit"]',
|
||||
content: 'Select "Edit" as Access mode in the "Share Project" wizard.',
|
||||
trigger: '.modal div[name="collaborator_ids"] .o_field_x2many_list_row_add > a',
|
||||
content: 'Add a collaborator to the project.',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: '.o_field_many2many_tags_email[name=partner_ids]',
|
||||
trigger: '.modal div[name="collaborator_ids"] div[name="partner_id"] input',
|
||||
content: 'Select the user portal as collaborator to the "Project Sharing" project.',
|
||||
run: function (actions) {
|
||||
actions.text('Georges', this.$anchor.find('input'));
|
||||
},
|
||||
run: "edit Georges",
|
||||
}, {
|
||||
trigger: '.ui-autocomplete a.dropdown-item:contains("Georges")',
|
||||
in_modal: false,
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: 'footer > button[name="action_send_mail"]',
|
||||
trigger: '.modal div[name="collaborator_ids"] div[name="access_mode"] input',
|
||||
content: 'Open Access mode selection dropdown.',
|
||||
run: 'click',
|
||||
},{
|
||||
trigger: '.o_select_menu_item:contains(Edit)',
|
||||
run: 'click',
|
||||
}, {
|
||||
trigger: '.modal footer > button[name="action_share_record"]',
|
||||
content: 'Confirm the project sharing with this portal user.',
|
||||
}, {
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: "body:not(:has(.modal))",
|
||||
},
|
||||
{
|
||||
trigger: '.o_web_client',
|
||||
content: 'Go to project portal view to select the "Project Sharing" project',
|
||||
run: function () {
|
||||
window.location.href = window.location.origin + '/my/projects';
|
||||
},
|
||||
expectUnloadPage: true,
|
||||
}, {
|
||||
id: 'project_sharing_feature',
|
||||
trigger: 'table > tbody > tr a:has(span:contains(Project Sharing))',
|
||||
content: 'Select "Project Sharing" project to go to project sharing feature for this project.',
|
||||
run: "click",
|
||||
expectUnloadPage: true,
|
||||
}, {
|
||||
trigger: '.o_project_sharing',
|
||||
trigger: '.o_project_sharing .o_kanban_renderer',
|
||||
content: 'Wait the project sharing feature be loaded',
|
||||
run: function () {},
|
||||
}, {
|
||||
trigger: 'button.o-kanban-button-new',
|
||||
content: 'Click "Create" button',
|
||||
run: 'click',
|
||||
}, {
|
||||
trigger: '.o_kanban_quick_create .o_field_widget[name="name"] input',
|
||||
trigger: '.o_kanban_quick_create .o_field_widget[name=name] input',
|
||||
content: 'Create Task',
|
||||
run: 'text Test Create Task',
|
||||
run: "edit Test Create Task",
|
||||
}, {
|
||||
content: "Check that task stages cannot be drag and dropped",
|
||||
trigger: '.o_kanban_group:not(.o_group_draggable)',
|
||||
}, {
|
||||
trigger: '.o_kanban_quick_create .o_kanban_edit',
|
||||
content: 'Go to the form view of this new task',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: 'div[name="stage_id"] div.o_statusbar_status button[aria-checked="false"]:contains(Done)',
|
||||
content: 'Change the stage of the task.',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: '.o_portal_chatter_composer_input .o_portal_chatter_composer_body textarea',
|
||||
trigger: '.o-mail-Composer-input',
|
||||
content: 'Write a message in the chatter of the task',
|
||||
run: 'text I create a new task for testing purpose.',
|
||||
run: "edit I create a new task for testing purpose.",
|
||||
}, {
|
||||
trigger: '.o_portal_chatter_composer_input .o_portal_chatter_composer_body button[name="send_message"]',
|
||||
trigger: '.o-mail-Composer-send:enabled',
|
||||
content: 'Send the message',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: 'ol.breadcrumb > li.o_back_button > a:contains(Project Sharing)',
|
||||
content: 'Go back to the kanban view',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: '.o_filter_menu > button',
|
||||
content: 'click on filter menu in the search view',
|
||||
trigger: '.o_searchview_dropdown_toggler',
|
||||
content: 'open the search panel menu',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: '.o_filter_menu > .dropdown-menu > .dropdown-item:first-child',
|
||||
trigger: '.o_filter_menu .dropdown-item:first-child',
|
||||
content: 'click on the first item in the filter menu',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: '.o_group_by_menu > button',
|
||||
content: 'click on group by menu in the search view',
|
||||
}, {
|
||||
trigger: '.o_group_by_menu > .dropdown-menu > .dropdown-item:first-child',
|
||||
trigger: '.o_group_by_menu .dropdown-item:first-child',
|
||||
content: 'click on the first item in the group by menu',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: '.o_favorite_menu > button',
|
||||
content: 'click on the favorite menu in the search view',
|
||||
trigger: '.o_favorite_menu .o_add_favorite',
|
||||
content: 'open accordion "save current search" in favorite menu',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: '.o_favorite_menu .o_add_favorite > button',
|
||||
content: 'click to "save current search" button in favorite menu',
|
||||
trigger: '.o_favorite_menu .o_accordion_values .o_save_favorite',
|
||||
content: 'click to "save" button in favorite menu',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: '.o_filter_menu > button',
|
||||
content: 'click on filter menu in the search view',
|
||||
}, {
|
||||
trigger: '.o_filter_menu > .dropdown-menu > .dropdown-item:first-child',
|
||||
trigger: '.o_filter_menu .dropdown-item:first-child',
|
||||
content: 'click on the first item in the filter menu',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: '.o_group_by_menu > button',
|
||||
content: 'click on group by menu in the search view',
|
||||
}, {
|
||||
trigger: '.o_group_by_menu > .dropdown-menu > .dropdown-item:first-child',
|
||||
trigger: '.o_group_by_menu .dropdown-item:first-child',
|
||||
content: 'click on the first item in the group by menu',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: '.o_favorite_menu > button',
|
||||
content: 'click on the favorite menu in the search view',
|
||||
}, {
|
||||
trigger: '.o_favorite_menu .o_add_favorite > button',
|
||||
content: 'click to "save current search" button in favorite menu',
|
||||
trigger: '.o_favorite_menu .o_accordion_values .o_save_favorite',
|
||||
content: 'click to "save" button in favorite menu',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: 'button.o_switch_view.o_list',
|
||||
content: 'Go to the list view',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: '.o_list_view',
|
||||
}, {
|
||||
trigger: '.o_optional_columns_dropdown_toggle',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: '.dropdown-item:contains("Milestone")',
|
||||
}, {
|
||||
trigger: '.o_list_view',
|
||||
content: 'Check the list view',
|
||||
}];
|
||||
|
||||
tour.register('project_sharing_tour', {
|
||||
test: true,
|
||||
url: '/web',
|
||||
}, projectSharingSteps);
|
||||
registry.category("web_tour.tours").add('project_sharing_tour', {
|
||||
url: '/odoo',
|
||||
steps: () => {
|
||||
return projectSharingSteps;
|
||||
}
|
||||
});
|
||||
|
||||
// The begining of the project sharing feature
|
||||
const projectSharingStepIndex = projectSharingSteps.findIndex(s => s.id && s.id === 'project_sharing_feature');
|
||||
tour.register('portal_project_sharing_tour', {
|
||||
test: true,
|
||||
url: '/my/projects',
|
||||
}, projectSharingSteps.slice(projectSharingStepIndex, projectSharingSteps.length));
|
||||
registry.category("web_tour.tours").add("portal_project_sharing_tour", {
|
||||
url: "/my/projects",
|
||||
steps: () => {
|
||||
// The begining of the project sharing feature
|
||||
const projectSharingStepIndex = projectSharingSteps.findIndex(s => s?.id === 'project_sharing_feature');
|
||||
return projectSharingSteps.slice(projectSharingStepIndex, projectSharingSteps.length);
|
||||
}
|
||||
});
|
||||
|
||||
registry.category("web_tour.tours").add("project_sharing_with_blocked_task_tour", {
|
||||
url: "/my/projects",
|
||||
steps: () => [{
|
||||
trigger: 'table > tbody > tr a:has(span:contains("Project Sharing"))',
|
||||
content: 'Click on the portal project.',
|
||||
run: "click",
|
||||
expectUnloadPage: true,
|
||||
}, {
|
||||
trigger: 'article.o_kanban_record',
|
||||
content: 'Click on the task',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: 'a:contains("Blocked By")',
|
||||
content: 'Go to the Block by task tab',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: 'i:contains("This task is currently blocked by")',
|
||||
content: 'Check that the blocked task is not visible',
|
||||
},
|
||||
]});
|
||||
|
||||
registry.category("web_tour.tours").add("portal_project_sharing_tour_with_disallowed_milestones", {
|
||||
url: "/my/projects",
|
||||
steps: () => [
|
||||
{
|
||||
id: "project_sharing_feature",
|
||||
trigger: "table > tbody > tr a:has(span:contains(Project Sharing))",
|
||||
content:
|
||||
'Select "Project Sharing" project to go to project sharing feature for this project.',
|
||||
run: "click",
|
||||
expectUnloadPage: true,
|
||||
},
|
||||
{
|
||||
trigger: ".o_project_sharing",
|
||||
content: "Wait the project sharing feature be loaded",
|
||||
},
|
||||
{
|
||||
trigger: "button.o_switch_view.o_list",
|
||||
content: "Go to the list view",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: ".o_list_view",
|
||||
},
|
||||
{
|
||||
trigger: ".o_optional_columns_dropdown_toggle",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: ".dropdown-item",
|
||||
},
|
||||
{
|
||||
trigger: ".dropdown-menu",
|
||||
run: function () {
|
||||
const optionalFields = Array.from(
|
||||
this.anchor.ownerDocument.querySelectorAll(".dropdown-item")
|
||||
).map((e) => e.textContent);
|
||||
|
||||
if (optionalFields.includes("Milestone")) {
|
||||
throw new Error(
|
||||
"the Milestone field should be absent as allow_milestones is set to False"
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
registry.category("web_tour.tours").add("test_04_project_sharing_chatter_message_reactions", {
|
||||
url: "/my/projects",
|
||||
steps: () => [
|
||||
{
|
||||
trigger: "table > tbody > tr a:has(span:contains(Project Sharing))",
|
||||
run: "click",
|
||||
expectUnloadPage: true,
|
||||
},
|
||||
{ trigger: ".o_project_sharing" },
|
||||
{ trigger: ".o_kanban_record:contains('Test Task with messages')", run: "click" },
|
||||
{ trigger: ".o-mail-Message" },
|
||||
{ trigger: ".o-mail-Message .o-mail-MessageReaction:contains('👀')" },
|
||||
],
|
||||
});
|
||||
|
||||
registry.category("web_tour.tours").add("portal_project_sharing_chatter_mention_users", {
|
||||
url: "/my/projects",
|
||||
steps: () => [
|
||||
{
|
||||
trigger: "table > tbody > tr a:has(span:contains(Project Sharing))",
|
||||
run: "click",
|
||||
expectUnloadPage: true,
|
||||
},
|
||||
{ trigger: ".o_project_sharing" },
|
||||
{ trigger: ".o_kanban_record:contains('Test Task')", run: "click" },
|
||||
{ trigger: ".o-mail-Composer-input", run: "edit @xxx" },
|
||||
{
|
||||
trigger: "body:not(:has(.o-mail-Composer-suggestion))",
|
||||
run: async () => {
|
||||
const delay_fetch = odoo.loader.modules.get(
|
||||
"@mail/core/common/suggestion_hook"
|
||||
).DELAY_FETCH;
|
||||
await delay(delay_fetch);
|
||||
},
|
||||
},
|
||||
{ trigger: ".o-mail-Composer-input", run: "edit @Georges" },
|
||||
{ trigger: ".o-mail-Composer-suggestion:contains('Georges')" },
|
||||
],
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue