Skip to content

Commit

Permalink
Merge pull request #4281 from mendersoftware/master
Browse files Browse the repository at this point in the history
Align staging with master
  • Loading branch information
alfrunes authored Jan 8, 2024
2 parents 399dafe + 7a14037 commit 436ea83
Show file tree
Hide file tree
Showing 19 changed files with 622 additions and 882 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ build:docker:
build:docker-multiplatform:
# by default alvaldi-gui uses the unprivileged mode
script:
- if [[ ! $CI_COMMIT_REF_NAME =~ "(main|master|staging|production|feature-.+)" ]]; then
- if [[ ! $CI_COMMIT_REF_NAME =~ "(main|master|staging|production|feature-.+|\d+\.\d+\..+)" ]]; then
- export MULTIPLATFORM_PLATFORMS='linux/amd64'
- fi
- echo "building ${CI_PROJECT_NAME} for ${DOCKER_BUILD_SERVICE_IMAGE}"
Expand Down
1 change: 0 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ cat >/var/www/mender-gui/dist/env.js <<EOF
hostedAnnouncement: "$ANNOUNCEMENT",
isDemoMode: "$DEMO",
features: {
hasAddons: "$HAVE_ADDONS",
hasAuditlogs: "$HAVE_AUDITLOGS",
hasDeviceConfig: "$HAVE_DEVICECONFIG",
hasDeviceConnect: "$HAVE_DEVICECONNECT",
Expand Down
1 change: 0 additions & 1 deletion src/js/actions/appActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export const commonErrorHandler = (err, errorContext, dispatch, fallback, mightB
const getComparisonCompatibleVersion = version => (isNaN(version.charAt(0)) && version !== 'next' ? 'master' : version);

const featureFlags = [
'hasAddons',
'hasAuditlogs',
'hasMultitenancy',
'hasDeltaProgress',
Expand Down
3 changes: 2 additions & 1 deletion src/js/actions/organizationActions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ describe('organization actions', () => {
...defaultState.app,
features: {
...defaultState.app.features,
hasAuditlogs: true
hasAuditlogs: true,
isEnterprise: true
}
}
});
Expand Down
512 changes: 277 additions & 235 deletions src/js/components/auditlogs/__snapshots__/auditlogs.test.js.snap

Large diffs are not rendered by default.

31 changes: 28 additions & 3 deletions src/js/components/auditlogs/auditlogs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,37 @@ import { TIMEOUTS } from '../../constants/appConstants';
import { getConfiguredStore } from '../../reducers';
import AuditLogs from './auditlogs';

const preloadedState = { ...defaultState, app: { ...defaultState.app, features: { ...defaultState.app.features, hasAuditlogs: true } } };
const preloadedState = {
...defaultState,
app: {
...defaultState.app,
features: {
...defaultState.app.features,
hasAuditlogs: true,
isEnterprise: true
}
}
};

const preloadedStateNoAuditlogs = {
...defaultState,
app: {
...defaultState.app,
features: {
...defaultState.app.features,
hasAuditlogs: true,
isEnterprise: false
}
}
};

describe('Auditlogs Component', () => {
it('renders correctly', async () => {
const { baseElement } = render(
<LocalizationProvider dateAdapter={AdapterMoment}>
<AuditLogs />
</LocalizationProvider>,
{ preloadedState }
{ preloadedState: preloadedStateNoAuditlogs }
);
const view = prettyDOM(baseElement.firstChild, 100000, { highlight: false })
.replace(/id="mui-[0-9]*"/g, '')
Expand All @@ -49,10 +71,13 @@ describe('Auditlogs Component', () => {
});

it('works as expected', async () => {
let store = getConfiguredStore({ preloadedState });
const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime });
render(
<LocalizationProvider dateAdapter={AdapterMoment}>
<AuditLogs />
<Provider store={store}>
<AuditLogs />
</Provider>
</LocalizationProvider>,
{ preloadedState }
);
Expand Down
9 changes: 8 additions & 1 deletion src/js/components/devices/authorized-devices.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('AuthorizedDevices Component', () => {
features: {
...defaultState.app.features,
// hasReporting: true,
hasAddons: true,
hasMonitor: true,
isEnterprise: true
}
},
Expand All @@ -81,6 +81,13 @@ describe('AuthorizedDevices Component', () => {
rejected: { ...defaultState.devices.byStatus.rejected, total: 38 }
}
},
organization: {
...defaultState.organization,
organization: {
...defaultState.organization.organization,
addons: [{ enabled: true, name: 'monitor' }]
}
},
users: {
...defaultState.users,
customColumns: [{ attribute: { name: attributeNames.updateTime, scope: 'system' }, size: 220 }]
Expand Down
Loading

0 comments on commit 436ea83

Please sign in to comment.