Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate new routes for the apps #5820

Closed
Desvelao opened this issue Aug 28, 2023 · 8 comments · Fixed by #5827
Closed

Generate new routes for the apps #5820

Desvelao opened this issue Aug 28, 2023 · 8 comments · Fixed by #5827
Assignees
Labels
level/task Task issue type/enhancement Enhancement issue

Comments

@Desvelao
Copy link
Member

Desvelao commented Aug 28, 2023

Description

The new design based on applications needs the relative redirections will be modified to application redirections.

Analyze the redirections

Application Old URL New URL Affected files Comment
{app}/heal-check /app/wazuh#/settings /app/server-api plugins/main/public/components/health-check/container/health-check.container.tsx
Overview #/agents-preview /app/endpoints-summary#/agents-preview plugins/main/public/controllers/overview/components/stats.js
Endpoints summary #/agents-preview? /app/endpoints-summary#/agents-preview? plugins/main/public/components/common/welcome/overview-welcome.js
Endpoints summary #/agents?tab=welcome&agent={agentID} /app/it-hygiene#/agents?tab=welcome&agent={agentID} plugins/main/public/controllers/agent/components/agents-table.js
IT Hygiene /app/wazuh#/manager/?tab=groups /app/endpoint-groups#/manager/?tab=groups plugins/main/public/components/common/util/agent-group-truncate/group-truncate.tsx Use share agents service
IT Hygiene #/overview?tab=mitre /app/mitre-attack plugins/main/public/components/common/welcome/agents-welcome.js
IT Hygiene #/overview/?tab=fim /app/file-integrity-monitoring plugins/main/public/components/common/welcome/agents-welcome.js
IT Hygiene #/overview?tab={module} /app/{app} plugins/main/public/components/common/welcome/agents-welcome.js
IT Hygiene #/overview?tab=sca&redirectPolicy=${lastScan.policy_id} /app/configuration-assessment#/overview/?tab=sca&redirectPolicy=${lastScan.policy_id} plugins/main/public/components/common/welcome/components/sca_scan/sca_scan.tsx
IT Hygiene #/overview?tab=sca /app/configuration-assessment plugins/main/public/components/common/welcome/components/sca_scan/sca_scan.tsx
Groups #/agents (with selected agent) /app/it-hygiene#/agents/ Use share agents service
{old_modules} #/agents?tab=welcome&agent={agentID} /app/it-hygiene#/agents?tab=welcome&agent={agentID} plugins/main/public/components/common/modules/events-enhance-discover-fields.ts agent.id enhanced cell
{old_modules} #/agents?tab=welcome&agent={agentID} /app/it-hygiene#/agents?tab=welcome&agent={agentID} plugins/main/public/components/common/modules/events-enhance-discover-fields.ts agent.name enhanced cell
{old_modules} #/manager/rules?tab=rules&redirectRule={ruleID} /app/rules#/manager/rules?tab=rules&redirectRule={ruleID} plugins/main/public/components/common/modules/events-enhance-discover-fields.ts
{old_modules} #/settings?tab=sample_data /app/server-data
IT Hygiene
Docker #/manager/rules?tab=rules&redirectRule={ruleID} /app/rules#/manager/rules?tab=rules&redirectRule={ruleID} plugins/main/public/components/common/modules/events-enhance-discover-fields.ts
Groups #/agents?_g=(filters: /app/endpoints-summary#/agents?agent=param&_g=(filters: plugins/main/public/controllers/management/components/management/groups/group-agents-table.js
Rules #/overview?tab=general&tabView=panels&addRuleFilter=param /app/threat-hunting#/overview?tab=general&tabView=panels&addRuleFilter=param plugins/main/public/controllers/management/components/management/ruleset/views/rule-info.tsx
Cluster #/agents-preview/? /app/endpoints-summary#/agents-preview/? plugins/main/public/controllers/management/monitoring.js
Statistics #/settings?tab=configuration&category=statistics /app/wazuh-plugin-settings#/settings?tab=configuration&category=statistics plugins/main/public/controllers/management/components/management/statistics/statistics-overview.js

Health check redirections

When the health check is run, it should redirect to the expected view, but it does not do.

Page is reloaded when accessing to a Wazuh application

The current monolith reloads the page when this is accessed, if the cookies service is not started or the previous history entry was pushed. We should avoid, the page will be refreshed. Removing this reload displays an error that we should research.

@Desvelao Desvelao added type/enhancement Enhancement issue level/task Task issue labels Aug 28, 2023
@JuanGarriuz JuanGarriuz self-assigned this Aug 28, 2023
@JuanGarriuz
Copy link
Member

JuanGarriuz commented Aug 28, 2023

Inside plugins/main/common/wazuh-modules.ts we add "appId" to fix redirection in the agents page. But some sections inside monolithic aren't found in the new menu. I link it to IT Hygiene section.

image

@JuanGarriuz
Copy link
Member

Inside plugins/main/common/wazuh-modules.ts we found "testConfiguration" section. We should research if that code is vulnerable to deletion.

image

@wazuhci wazuhci moved this to Triage in Release 4.8.0 Aug 28, 2023
@Desvelao Desvelao self-assigned this Aug 28, 2023
@wazuhci wazuhci moved this from Triage to In progress in Release 4.8.0 Aug 28, 2023
@JuanGarriuz JuanGarriuz linked a pull request Aug 29, 2023 that will close this issue
6 tasks
@Desvelao
Copy link
Member Author

Desvelao commented Aug 30, 2023

Problem

The IT Hygiene application displays data about an agent. The current view doesn't support accessing without a selected agent, so it should be enhanced.

  • Without an agent being selected, the user cannot select it.
    image
  • With a selected agent, the user should be able to change the selected agent. Currently, the view doesn't have this button.

Digging

I was researching to add a way to select the agent, and there are multiple problems to solve.

  • If access to the section and the agent is not stored in the shareAgent singleton, then a message is displayed. This view is managed by AngularJS.
  • In the current application we have a way to select the agent through a modal. This modal is done in ReactJS. This means if we want the user can use this selector, we should think of a way to render this component:
    • Remove the rendering with AngularJS and allow rendering of the existing ReactJS component that displays the agent data. Then we could wrap this component with the prompt component of no selected agent.
    • Add to the AngularJS template the rendering of the prompt component of no selected agent.

I was working on one of these approaches and I got more problems:

  • There are 2 ways for the modal to select the agent that can be opened. One of them is global and the other one is local when rendering a current module. The current agent selector component is related to the module. The agent view doesn't render this logic, so the button to open the agent modal selector doesn't cause the modal to be opened.
  • The selected agent in this section is managed for a variable in the controller scope, but selecting one in the agent selector will change the value in the Redux store, so the view doesn't know you selected an agent.

Screenshot
image

I could add the agent selector, but there are more problems to solve

@AlexRuiz7
Copy link
Member

I would not prefix every route with wz-

@AlexRuiz7 AlexRuiz7 changed the title Modify the relative redirections to app redirections Generate new routes for the apps Aug 31, 2023
@Desvelao
Copy link
Member Author

Desvelao commented Sep 1, 2023

I would not prefix every route with wz-

We will remove the wz- prefix from the application URLs.

This was initially done to minimize the conflicts with other applications.

@Desvelao
Copy link
Member Author

Desvelao commented Sep 1, 2023

I would not prefix every route with wz-

We will remove the wz- prefix from the application URLs.

This was initially done to minimize the conflicts with other applications.

I found a problem due to a conflict ID in the status application (current Management > Status). It prevents the application can be registered, so I changed the ID to server-status. This ID will be displayed in the URL.

@yenienserrano
Copy link
Member

yenienserrano commented Sep 5, 2023

Some problems have been found,
1- When you change application quickly, sometimes it gives you an error in the console and shows you the previous view to the currently selected one.

screenshot

image

2- Sometimes when you want to enter to some module it always redirects you to the Endpoints summary.

screenshot

image

3- Problems with the tabView in the url, in the views you should change the value but then returns to the previous value.

screenshot

image

image

Problem 1 and 2 may be related because it occurs when you click twice in a row on the endpoint summary and then want to go to another module, or click twice in a row on a module and navigate to the endpoint summary.

@wazuhci wazuhci moved this from On hold to In progress in Release 4.8.0 Sep 7, 2023
@Desvelao
Copy link
Member Author

Some problems have been found,
1- When you change application quickly, sometimes it gives you an error in the console and shows you the previous view to the currently selected one.

screenshot

image

2- Sometimes when you want to enter to some module it always redirects you to the Endpoints summary.

screenshot

image

3- Problems with the tabView in the url, in the views you should change the value but then returns to the previous value.

screenshot

image

image

Problem 1 and 2 may be related because it occurs when you click twice in a row on the endpoint summary and then want to go to another module, or click twice in a row on a module and navigate to the endpoint summary.

It was moved to #5900.

@wazuhci wazuhci moved this from In progress to Done in Release 4.8.0 Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue type/enhancement Enhancement issue
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants