Skip to content

Commit

Permalink
Sync 4.9.0 to 4.10.0 (#269)
Browse files Browse the repository at this point in the history
Co-authored-by: Luciano Gorza <[email protected]>
Co-authored-by: Chantal Belén kelm <[email protected]>
  • Loading branch information
3 people committed Oct 28, 2024
1 parent 3371776 commit ede1313
Show file tree
Hide file tree
Showing 20 changed files with 65 additions and 1,392 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cypress_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
TEST_REPO: ${{ inputs.test_repo != '' && inputs.test_repo || 'opensearch-project/opensearch-dashboards-functional-test' }}
TEST_BRANCH: "${{ inputs.test_branch != '' && inputs.test_branch || github.base_ref }}"
FTR_PATH: 'ftr'
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true --csp.warnLegacyBrowsers=false --uiSettings.overrides["query:enhancements:enabled"]=false'
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch --savedObjects.maxImportPayloadBytes=10485760 --server.maxPayloadBytes=1759977 --logging.json=false --data.search.aggs.shardDelay.enabled=true --csp.warnLegacyBrowsers=false --uiSettings.overrides["query:enhancements:enabled"]=false --opensearchDashboards.branding.useExpandedHeader=true'
OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot -E cluster.routing.allocation.disk.threshold_enabled=false'
CYPRESS_BROWSER: 'chromium'
CYPRESS_VISBUILDER_ENABLED: true
Expand Down
1,350 changes: 5 additions & 1,345 deletions CHANGELOG.md

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions config/opensearch_dashboards.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ server.ssl.key: "/etc/wazuh-dashboard/certs/dashboard-key.pem"
server.ssl.certificate: "/etc/wazuh-dashboard/certs/dashboard.pem"
opensearch.ssl.certificateAuthorities: ["/etc/wazuh-dashboard/certs/root-ca.pem"]
uiSettings.overrides.defaultRoute: /app/wz-home

opensearchDashboards.branding:
useExpandedHeader: false
1 change: 1 addition & 0 deletions dev-tools/build-packages/deb/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ configure)
chmod 750 "${TARGET_DIR}""${INSTALLATION_DIR}"
chown -R "${NAME}":"${NAME}" "${TARGET_DIR}""${INSTALLATION_DIR}"
setcap 'cap_net_bind_service=+ep' "${INSTALLATION_DIR}"/node/bin/node
setcap 'cap_net_bind_service=+ep' "${INSTALLATION_DIR}"/node/fallback/bin/node
if [ -f "${INSTALLATION_DIR}"/"${NAME}".restart ]; then
rm -f "${INSTALLATION_DIR}"/"${NAME}".restart
if command -v systemctl >/dev/null 2>&1 && systemctl >/dev/null 2>&1; then
Expand Down
1 change: 1 addition & 0 deletions dev-tools/build-packages/rpm/wazuh-dashboard.spec
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ fi

%post
setcap 'cap_net_bind_service=+ep' %{INSTALL_DIR}/node/bin/node
setcap 'cap_net_bind_service=+ep' %{INSTALL_DIR}/node/fallback/bin/node

if [ ! -f %{INSTALLATION_DIR}/config/opensearch_dashboards.keystore ]; then
runuser %{USER} --shell="/bin/bash" --command="%{INSTALL_DIR}/bin/opensearch-dashboards-keystore create" > /dev/null 2>&1
Expand Down
3 changes: 0 additions & 3 deletions docker/config/opensearch_dashboards.dev.security.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
server.host: "0.0.0.0"

opensearchDashboards.branding:
useExpandedHeader: false

opensearch.hosts: ["https://indexer:9200"]
opensearch.ssl.verificationMode: none
opensearch.username: "kibanaserver"
Expand Down
3 changes: 0 additions & 3 deletions docker/config/opensearch_dashboards.dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
server.host: "0.0.0.0"

opensearchDashboards.branding:
useExpandedHeader: false
12 changes: 12 additions & 0 deletions packages/osd-plugin-helpers/src/integration_tests/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,15 @@ it('builds a generated plugin into a viable archive', async () => {
info running @osd/optimizer
│ info initialized, 0 bundles cached
│ info starting worker [1 bundle]
│ warn worker stderr Browserslist: caniuse-lite is outdated. Please run:
│ warn worker stderr npx update-browserslist-db@latest
│ warn worker stderr Why you should do it regularly: https://github.com/browserslist/update-db#readme
│ succ 1 bundles compiled successfully after <time>
info copying assets from \`public/assets\` to build
info copying server source into the build and converting with babel
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
info running yarn to install dependencies
info compressing plugin into [fooTestPlugin-1.0.0.zip]
info cleaning up compression temporary artifacts"
Expand Down Expand Up @@ -189,9 +195,15 @@ it('builds a non-semver generated plugin into a viable archive', async () => {
info running @osd/optimizer
│ info initialized, 0 bundles cached
│ info starting worker [1 bundle]
│ warn worker stderr Browserslist: caniuse-lite is outdated. Please run:
│ warn worker stderr npx update-browserslist-db@latest
│ warn worker stderr Why you should do it regularly: https://github.com/browserslist/update-db#readme
│ succ 1 bundles compiled successfully after <time>
info copying assets from \`public/assets\` to build
info copying server source into the build and converting with babel
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme
info running yarn to install dependencies
info compressing plugin into [fooTestPlugin-1.0.0.x.zip]
info cleaning up compression temporary artifacts"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions src/core/public/chrome/ui/header/home_icon.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ describe('Home icon,', () => {
});

it('uses the home icon by default', () => {
const props = mockProps();
const props = {
...mockProps(),
branding: {
useExpandedHeader: true,
},
};
const component = shallow(<HomeIcon {...props} />);
const icon = component.find('EuiIcon');
expect(icon.prop('data-test-subj')).toEqual('homeIcon');
Expand Down Expand Up @@ -53,9 +58,9 @@ describe('Home icon,', () => {
};
const component = shallow(<HomeIcon {...props} />);
const icon = component.find('EuiIcon');
expect(icon.prop('data-test-subj')).toEqual('homeIcon');
expect(icon.prop('data-test-subj')).toEqual('defaultMark');
expect(icon.prop('type')).toEqual(props.logos.Mark.url);
expect(icon.prop('size')).toEqual('m');
expect(icon.prop('size')).toEqual('l');
expect(icon.prop('title')).toEqual('Wazuh dashboards home');

expect(component).toMatchSnapshot();
Expand Down
4 changes: 2 additions & 2 deletions src/core/public/chrome/ui/header/home_icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface Props {
*/
export const HomeIcon = ({ branding, logos }: Props) => {
// Removed prop unnecessary useExpandedHeader Wazuh dashboards
const { applicationTitle = 'Wazuh dashboards' } = branding;
const { applicationTitle = 'Wazuh dashboards', useExpandedHeader } = branding;

const { url: markURL, type: markType } = logos.Mark;

Expand All @@ -27,7 +27,7 @@ export const HomeIcon = ({ branding, logos }: Props) => {
let markIconSize: IconSize = 'l';

// If no custom branded mark was set, use `home` icon Wazuh dashboards
if (markType !== 'custom') {
if (markType !== 'custom' && useExpandedHeader) {
testSubj = 'homeIcon';
// Home icon should be medium to fit in with other icons
markIconSize = 'm';
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/opensearch_dashboards_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const config = {
defaultValue: 'Wazuh',
}),
useExpandedHeader: schema.boolean({
defaultValue: true,
defaultValue: false,
}),
}),
survey: schema.object({
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/core/utils/default_app_categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ export const DEFAULT_APP_CATEGORIES: Record<string, AppCategory> = Object.freeze
label: i18n.translate('core.ui.dashboardManagementNavList.label', {
defaultMessage: 'Dashboard management',
}),
order: 700,
order: 6000,
euiIconType: 'dashboardApp',
},
management: {
id: 'management',
label: i18n.translate('core.ui.managementNavList.label', {
defaultMessage: 'Index management',
defaultMessage: 'Indexer management',
}),
order: 5000,
euiIconType: 'managementApp',
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/server/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export default () =>
}),
faviconUrl: Joi.any().default('/'),
applicationTitle: Joi.any().default(''),
useExpandedHeader: Joi.boolean().default(true),
useExpandedHeader: Joi.boolean().default(false),
}),
survey: Joi.object({
url: Joi.any().default('/'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ describe('ImportFlyout Component', () => {
component.update();

await act(async () => {
await nextTick();
component.find(confirmBtnIdentifier).first().simulate('click');
await nextTick();
});

component.update();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ jest.mock('./tutorial_directory', () => ({
),
}));

describe('<HomeApp />', () => {
// Wazuh: skip this because we remove the sampledata and the tutorial because sample data is needed

describe.skip('<HomeApp />', () => {
let currentService: ReturnType<typeof getMockedServices>;
beforeEach(() => {
currentService = getMockedServices();
Expand All @@ -45,7 +47,7 @@ describe('<HomeApp />', () => {
});
});

describe('<ImportSampleDataApp />', () => {
describe.skip('<ImportSampleDataApp />', () => {
let currentService: ReturnType<typeof getMockedServices>;
beforeEach(() => {
currentService = getMockedServices();
Expand Down
1 change: 1 addition & 0 deletions test/common/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export default function () {
`--opensearchDashboards.branding.mark.darkModeUrl=https://opensearch.org/assets/brand/SVG/Mark/opensearch_mark_darkmode.svg`,
`--opensearchDashboards.branding.applicationTitle=OpenSearch`,
`--uiSettings.overrides['query:enhancements:enabled']=false`,
`--opensearchDashboards.branding.useExpandedHeader=true`,
],
},
services,
Expand Down

0 comments on commit ede1313

Please sign in to comment.