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

Names updates and version check #218

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ e2e-results/

# Editor
.idea
.vscode


# cypress atrifacts
Expand Down
9 changes: 7 additions & 2 deletions src/backend/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,14 @@ export default class RestApiBackend implements Backend {
`Checkmk version 2.1.0 has been detected, but this plugin is configured to use version 2.2.0 and above. Please set the backend option to '< 2.2'.`
);
}
if (this.datasource.getEdition() === 'CEE' && result.data.edition === 'raw') {
if (this.datasource.getEdition() !== 'RAW' && result.data.edition === 'cre') {
throw new Error(
'The data source specified the Checkmk Enterprise Edition, but Checkmk Raw Edition was detected. Please choose the raw edition in the data source settings.'
'The data source specified the Checkmk commercial editions, but Checkmk Raw Edition was detected. Choose the raw edition in the data source settings.'
);
}
if (this.datasource.getEdition() === 'RAW' && result.data.edition !== 'cre') {
throw new Error(
'The data source specified the Checkmk Raw Edition, but a Checkmk commercial edition was detected. Some functionality may not be available. Choose commercial editions in the data source settings to enable all features.'
);
}
// The REST API would be ok with other users, but the autocompleter are not
Expand Down
4 changes: 2 additions & 2 deletions src/ui/ConfigEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export class ConfigEditor extends PureComponent<Props, State> {
}

const cmkEditions: EditionOption[] = [
{ value: 'CEE', label: 'Enterprise Editions' },
{ value: 'RAW', label: 'RAW Edition' },
{ value: 'CEE', label: 'Commercial editions' },
{ value: 'RAW', label: 'Raw Edition' },
];
if (!jsonData.edition) {
this.onEditionChange(cmkEditions[0]);
Expand Down
4 changes: 2 additions & 2 deletions tests/cypress/e2e/spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ describe('e2e tests', () => {
const hostName0 = 'localhost_grafana0';
const hostName1 = 'localhost_grafana1';

const CmkCEE = 'Enterprise Editions';
const CmkCRE = 'RAW Edition';
const CmkCEE = 'Commercial editions';
const CmkCRE = 'Raw Edition';

const inputDatasourceId = 'data-source-picker';
const inputFilterId = 'react-select-7-input';
Expand Down