Skip to content

Commit

Permalink
Merge branch '4.9.0' into feat/6536-remove-angularjs-controller-blank…
Browse files Browse the repository at this point in the history
…-screen
  • Loading branch information
asteriscos committed Apr 3, 2024
2 parents 0c8371d + 1da123b commit e6b1ba5
Show file tree
Hide file tree
Showing 26 changed files with 252 additions and 1,220 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Expand Up @@ -25,13 +25,20 @@ All notable changes to the Wazuh app project will be documented in this file.
- Changed the usage of the endpoint GET /groups/{group_id}/files/{file_name} [#6385](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6385)
- Refactoring and redesign endpoints summary visualizations [#6268](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6268)
- Move the AngularJS controller and template of blank screen to ReactJS component [#6538](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6538)
- Moved the registry data to in-memory cache [#6481](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6481)
- Remove AngularJS controller for manage groups [#6543](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6543)
- Remove some branding references across the application. [#6155](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6155)

### Fixed

- Fixed the scripted fields disappear when the fields of the events index pattern was refreshed [#6237](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6237)

### Removed

- Removed API endpoint GET /api/timestamp [#6481](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6481)
- Removed API endpoint PUT /api/update-hostname/{id} [#6481](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6481)
- Removed API endpoint DELETE /hosts/remove-orphan-entries [#6481](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6481)

## Wazuh v4.8.2 - OpenSearch Dashboards 2.10.0 - Revision 00

### Added
Expand Down
Expand Up @@ -20,7 +20,8 @@ exports[`SettingsAboutAppInfo component should render version, revision, install
<div
class="euiText euiText--medium"
>
App version:
App version:
<b>
4.8.0
</b>
Expand All @@ -32,22 +33,10 @@ exports[`SettingsAboutAppInfo component should render version, revision, install
<div
class="euiText euiText--medium"
>
App revision:
<b>
01
</b>
</div>
</div>
<div
class="euiFlexItem"
>
<div
class="euiText euiText--medium"
>
Install date:
App revision:
<b>
Sep 25, 2023 @ 14:03:40.816
01
</b>
</div>
</div>
Expand Down
Expand Up @@ -14,9 +14,8 @@ describe('SettingsAboutAppInfo component', () => {
appInfo={{
'app-version': '4.8.0',
revision: '01',
installationDate: 'Sep 25, 2023 @ 14:03:40.816',
}}
/>
/>,
);

expect(container).toMatchSnapshot();
Expand All @@ -25,7 +24,5 @@ describe('SettingsAboutAppInfo component', () => {
expect(getByText('4.8.0')).toBeInTheDocument();
expect(getByText('App revision:')).toBeInTheDocument();
expect(getByText('01')).toBeInTheDocument();
expect(getByText('Install date:')).toBeInTheDocument();
expect(getByText('Sep 25, 2023 @ 14:03:40.816')).toBeInTheDocument();
});
});
24 changes: 12 additions & 12 deletions plugins/main/public/components/settings/about/appInfo.tsx
@@ -1,33 +1,33 @@
import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui';
import React from 'react';
import { formatUIDate } from '../../../react-services/time-service';

interface SettingsAboutAppInfoProps {
appInfo?: {
'app-version': string;
installationDate: string;
revision: string;
};
}

export const SettingsAboutAppInfo = ({ appInfo }: SettingsAboutAppInfoProps) => {
export const SettingsAboutAppInfo = ({
appInfo,
}: SettingsAboutAppInfoProps) => {
return (
<EuiCallOut>
<EuiFlexGroup alignItems="center" justifyContent="flexStart" gutterSize="none">
<EuiFlexGroup
alignItems='center'
justifyContent='flexStart'
gutterSize='none'
>
<EuiFlexItem>
<EuiText>
App version: <b>{appInfo?.['app-version'] ? appInfo['app-version'] : ''}</b>
App version:{' '}
<b>{appInfo?.['app-version'] ? appInfo['app-version'] : ''}</b>
</EuiText>
</EuiFlexItem>
<EuiFlexItem>
<EuiText>
App revision: <b>{appInfo?.['revision'] ? appInfo['revision'] : ''}</b>
</EuiText>
</EuiFlexItem>
<EuiFlexItem>
<EuiText>
Install date:{' '}
<b>{appInfo?.['installationDate'] ? formatUIDate(appInfo['installationDate']) : ''}</b>
App revision:{' '}
<b>{appInfo?.['revision'] ? appInfo['revision'] : ''}</b>
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Expand Up @@ -18,7 +18,6 @@ describe('SettingsAbout component', () => {
appInfo={{
'app-version': '4.8.0',
revision: '01',
installationDate: 'Sep 25, 2023 @ 14:03:40.816',
}}
pluginAppName='Dashboard'
/>,
Expand Down
5 changes: 2 additions & 3 deletions plugins/main/public/components/settings/about/index.tsx
Expand Up @@ -6,7 +6,6 @@ import { SettingsAboutGeneralInfo } from './generalInfo';
interface SettingsAboutProps {
appInfo?: {
'app-version': string;
installationDate: string;
revision: string;
};
pluginAppName: string;
Expand All @@ -16,10 +15,10 @@ export const SettingsAbout = (props: SettingsAboutProps) => {
const { appInfo, pluginAppName } = props;

return (
<EuiPage paddingSize="m">
<EuiPage paddingSize='m'>
<EuiPageBody>
<SettingsAboutAppInfo appInfo={appInfo} />
<EuiSpacer size="l" />
<EuiSpacer size='l' />
<SettingsAboutGeneralInfo pluginAppName={pluginAppName} />
</EuiPageBody>
</EuiPage>
Expand Down
13 changes: 1 addition & 12 deletions plugins/main/public/components/settings/api/api-table.js
Expand Up @@ -147,10 +147,6 @@ export const ApiTable = compose(
true,
);
APIConnection.cluster_info = response.data;
// Updates the cluster-information in the registry
await GenericRequest.request('PUT', `/hosts/update-hostname/${id}`, {
cluster_info: APIConnection.cluster_info,
});
APIConnection.status = 'online';
APIConnection.allow_run_as = response.data.allow_run_as;
!silent && ErrorHandler.info('Connection success', 'Settings');
Expand Down Expand Up @@ -218,14 +214,7 @@ export const ApiTable = compose(
const clusterInfo = data.data || {};
APIconnection.status = 'online';
APIconnection.cluster_info = clusterInfo;
//Updates the cluster info in the registry
await GenericRequest.request(
'PUT',
`/hosts/update-hostname/${APIconnection.id}`,
{
cluster_info: clusterInfo,
},
);
APIconnection.allow_run_as = clusterInfo.allow_run_as;
if (options?.selectAPIHostOnAvailable) {
this.setDefault(entry);
}
Expand Down
17 changes: 0 additions & 17 deletions plugins/main/public/components/wz-menu/wz-menu.js
Expand Up @@ -354,22 +354,6 @@ export const WzMenu = withWindowSize(
});
};

/**
* @param {String} id
* @param {Object} clusterInfo
* Updates the wazuh registry of an specific api id
*/
updateClusterInfoInRegistry = async (id, clusterInfo) => {
try {
const url = `/hosts/update-hostname/${id}`;
await this.genericReq.request('PUT', url, {
cluster_info: clusterInfo,
});
} catch (error) {
return Promise.reject(error);
}
};

changeAPI = async event => {
try {
const apiId = event.target[event.target.selectedIndex];
Expand All @@ -382,7 +366,6 @@ export const WzMenu = withWindowSize(
return item.id === apiId.value;
});

this.updateClusterInfoInRegistry(apiId.value, clusterInfo);
apiData[0].cluster_info = clusterInfo;

AppState.setClusterInfo(apiData[0].cluster_info);
Expand Down
23 changes: 0 additions & 23 deletions plugins/main/public/controllers/settings/settings.js
Expand Up @@ -125,8 +125,6 @@ export class SettingsController {
checkManager: entry => this.checkManager(entry),
getHosts: () => this.getHosts(),
testApi: (entry, force) => ApiCheck.checkApi(entry, force),
updateClusterInfoInRegistry: (id, clusterInfo) =>
this.updateClusterInfoInRegistry(id, clusterInfo),
copyToClipBoard: msg => this.copyToClipBoard(msg),
};

Expand Down Expand Up @@ -306,28 +304,9 @@ export class SettingsController {
};
getErrorOrchestrator().handleError(options);
}
// Every time that the API entries are required in the settings the registry will be checked in order to remove orphan host entries
await this.genericReq.request('POST', '/hosts/remove-orphan-entries', {
entries: this.apiEntries,
});
return;
}

/**
* @param {String} id
* @param {Object} clusterInfo
*/
async updateClusterInfoInRegistry(id, clusterInfo) {
try {
const url = `/hosts/update-hostname/${id}`;
await this.genericReq.request('PUT', url, {
cluster_info: clusterInfo,
});
} catch (error) {
return Promise.reject(error);
}
}

// Check manager connectivity
async checkManager(item, isIndex, silent = false) {
try {
Expand All @@ -351,7 +330,6 @@ export class SettingsController {
tmpData.cluster_info = data.data;
const { cluster_info } = tmpData;
// Updates the cluster-information in the registry
await this.updateClusterInfoInRegistry(id, cluster_info);
this.$scope.$emit('updateAPI', { cluster_info });
this.apiEntries[index].cluster_info = cluster_info;
this.apiEntries[index].status = 'online';
Expand Down Expand Up @@ -399,7 +377,6 @@ export class SettingsController {
const response = data.data.data;
this.appInfo = {
'app-version': response['app-version'],
installationDate: response['installationDate'],
revision: response['revision'],
};

Expand Down
33 changes: 0 additions & 33 deletions plugins/main/public/services/resolves/check-timestamp.js

This file was deleted.

10 changes: 1 addition & 9 deletions plugins/main/public/services/resolves/index.js
Expand Up @@ -9,18 +9,10 @@
*
* Find more information about this on the LICENSE file.
*/
import { checkTimestamp } from './check-timestamp';
import { healthCheck } from './health-check';
import { settingsWizard } from './settings-wizard';
import { getSavedSearch } from './get-saved-search';
import { getIp } from './get-ip';
import { getWzConfig } from './get-config';

export {
checkTimestamp,
healthCheck,
settingsWizard,
getSavedSearch,
getIp,
getWzConfig,
};
export { healthCheck, settingsWizard, getSavedSearch, getIp, getWzConfig };

0 comments on commit e6b1ba5

Please sign in to comment.