Skip to content

Commit

Permalink
[Backport 4.6.0-7.16] Remove unused embedded jquery-ui (#5674)
Browse files Browse the repository at this point in the history
* Remove unused embedded jquery-ui (#5592)

* fix: remove unused embedded jquery-ui dependency

* changelog: add pull request entry

---------

Co-authored-by: Federico Rodriguez <[email protected]>
(cherry picked from commit 249eb8b)

* fix: missing bracket
  • Loading branch information
Desvelao authored Jul 18, 2023
1 parent d85bad0 commit 7370635
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 12,705 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"ignorePatterns": [
"node_modules/",
"public/utils/codemirror/",
"public/kibana-integrations/",
"public/utils/jquery-ui.js"
"public/kibana-integrations/"
],
"rules": {
"filenames-simple/naming-convention": "error",
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Removed pretty parameter from cron job requests. [#5532](https://github.com/wazuh/wazuh-kibana-app/pull/5532)
- Removed unnecessary requests in `Management/Status` section. [#5528](https://github.com/wazuh/wazuh-kibana-app/pull/5528)
- Removed obsolete code that caused duplicate requests to the api in `Management`. [#5485](https://github.com/wazuh/wazuh-kibana-app/pull/5485)
- Removed unused embedded jquery-ui [#5592](https://github.com/wazuh/wazuh-kibana-app/pull/5592)

## Wazuh v4.5.0 - Kibana 7.10.2, 7.16.x, 7.17.x - Revision 01

Expand Down
65 changes: 37 additions & 28 deletions plugins/main/public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import './utils/fontawesome/scss/font-awesome.scss';
// Dev tools
import './utils/codemirror';

import './utils/jquery-ui';

// Material
import 'angular-material/angular-material.css';
import 'angular-aria/angular-aria';
Expand Down Expand Up @@ -57,7 +55,9 @@ const app = getAngularModule();
app.config([
'$compileProvider',
function ($compileProvider) {
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|data|blob):/);
$compileProvider.aHrefSanitizationWhitelist(
/^\s*(https?|ftp|mailto|data|blob):/,
);
},
]);

Expand All @@ -75,7 +75,7 @@ app.run([

// Set currentSecurity platform in Redux when app starts.
checkCurrentSecurityPlatform()
.then((item) => {
.then(item => {
store.dispatch(updateCurrentPlatform(item));
})
.catch(() => {});
Expand All @@ -91,7 +91,9 @@ app.run([
/**
* Set trigger for logout
*/
app.run(['$rootElement', function ($rootElement) {
app.run([
'$rootElement',
function ($rootElement) {
$rootElement.append(`
<div>
<div class="wazuhNotReadyYet"></div>
Expand All @@ -101,27 +103,34 @@ app.run(['$rootElement', function ($rootElement) {
<react-component name="ToastNotificationsModal" props=""></react-component>
</div>`);

// Add plugin help links as extension to plugin platform help menu
addHelpMenuToAppChrome();

// Bind deleteExistentToken on Log out component.
$('.euiHeaderSectionItem__button, .euiHeaderSectionItemButton').on('mouseleave', function () {
// opendistro
$('button:contains(Log out)').on('click', function () {
WzAuthentication.deleteExistentToken();
});
// x-pack
$('a:contains(Log out)').on('click', function (event) {
// Override href's behaviour and navigate programatically
// to the logout path once the token has been deleted.
event.preventDefault();
WzAuthentication.deleteExistentToken()
.catch((err) => {
console.error('[ERROR] - User token could not be deprecated - ', err);
})
.finally(() => {
window.location = event.currentTarget.href;
// Add plugin help links as extension to plugin platform help menu
addHelpMenuToAppChrome();

// Bind deleteExistentToken on Log out component.
$('.euiHeaderSectionItem__button, .euiHeaderSectionItemButton').on(
'mouseleave',
function () {
// opendistro
$('button:contains(Log out)').on('click', function () {
WzAuthentication.deleteExistentToken();
});
});
});
}]);
// x-pack
$('a:contains(Log out)').on('click', function (event) {
// Override href's behaviour and navigate programatically
// to the logout path once the token has been deleted.
event.preventDefault();
WzAuthentication.deleteExistentToken()
.catch(err => {
console.error(
'[ERROR] - User token could not be deprecated - ',
err,
);
})
.finally(() => {
window.location = event.currentTarget.href;
});
});
},
);
},
]);
Loading

0 comments on commit 7370635

Please sign in to comment.