Skip to content

Commit

Permalink
reviewed error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ck-c8y committed Apr 1, 2024
1 parent 42b3ba9 commit bce5136
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ export class BrokerConfigurationComponent implements OnInit, OnDestroy {
);
console.log('Details reconnect2NotificationEndpoint', response1);
if (response1.status === 201) {
this.alert.success(gettext('Reconnect successful!'));
this.alert.success(gettext('Reconnected successfully.'));
} else {
this.alert.danger(gettext('Failed to reconnect.'));
this.alert.danger(gettext('Failed to reconnect!'));
}
}

Expand Down Expand Up @@ -157,7 +157,7 @@ export class BrokerConfigurationComponent implements OnInit, OnDestroy {
clonedConfiguration
);
if (response.status < 300) {
this.alert.success(gettext('Update successful'));
this.alert.success(gettext('Updated successfully.'));
} else {
this.alert.danger(
gettext('Failed to update connector configuration')
Expand Down Expand Up @@ -201,10 +201,10 @@ export class BrokerConfigurationComponent implements OnInit, OnDestroy {
clonedConfiguration
);
if (response.status < 300) {
this.alert.success(gettext('Update successful'));
this.alert.success(gettext('Updated successfully.'));
} else {
this.alert.danger(
gettext('Failed to update connector configuration')
gettext('Failed to update connector configuration!')
);
}
}
Expand Down Expand Up @@ -236,7 +236,7 @@ export class BrokerConfigurationComponent implements OnInit, OnDestroy {
configuration.ident
);
if (response.status < 300) {
this.alert.success(gettext('Deleted successful'));
this.alert.success(gettext('Deleted successfully.'));
} else {
this.alert.danger(
gettext('Failed to delete connector configuration')
Expand Down Expand Up @@ -300,9 +300,9 @@ export class BrokerConfigurationComponent implements OnInit, OnDestroy {
console.log('Details toggle activation to broker', response1);
if (response1.status === 201) {
// if (response1.status === 201 && response2.status === 201) {
this.alert.success(gettext('Connection updated successful'));
this.alert.success(gettext('Connection updated successfully.'));
} else {
this.alert.danger(gettext('Failed to establish connection'));
this.alert.danger(gettext('Failed to establish connection!'));
}
await this.loadData();
}
Expand All @@ -312,7 +312,7 @@ export class BrokerConfigurationComponent implements OnInit, OnDestroy {
Operation.RESET_STATUS_MAPPING
);
if (res.status < 300) {
this.alert.success(gettext('Successfully reset'));
this.alert.success(gettext('Status reset successfully.'));
} else {
this.alert.danger(gettext('Failed to rest statistic.'));
}
Expand Down
5 changes: 2 additions & 3 deletions dynamic-mapping-ui/src/mapping/grid/mapping.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ import { StatusRendererComponent } from '../renderer/status-cell.renderer.compon
import { EditorMode, StepperConfiguration } from '../step-main/stepper-model';
import { C8YAPISubscription, PayloadWrapper } from '../shared/mapping.model';
import { MappingDeploymentRendererComponent } from '../renderer/mappingDeployment.renderer.component';
import { LowerCasePipe } from '@angular/common';

@Component({
selector: 'd11r-mapping-mapping-grid',
Expand Down Expand Up @@ -478,7 +477,7 @@ export class MappingComponent implements OnInit, OnDestroy {
async activateMapping(m: MappingEnriched) {
const { mapping } = m;
const newActive = !mapping.active;
const action = newActive ? 'Activate' : 'Deactivate';
const action = newActive ? 'Activated' : 'Deactivated';
this.alertService.success(`${action} mapping: ${mapping.id}!`);
const parameter = { id: mapping.id, active: newActive };
await this.mappingService.changeActivationMapping(parameter);
Expand Down Expand Up @@ -635,7 +634,7 @@ export class MappingComponent implements OnInit, OnDestroy {
for (let index = 0; index < mappings2Activate.length; index++) {
const m = mappings2Activate[index];
const newActive = !m.active;
const action = newActive ? 'Activate' : 'Deactivate';
const action = newActive ? 'Activated' : 'Deactivated';
const parameter = { id: m.id, active: newActive };
await this.mappingService.changeActivationMapping(parameter);
this.alertService.success(`${action} mapping: ${m.id}!`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class StatusActivationRendererComponent {
async activateMapping() {
const { mapping } = this.context.item;
const newActive = !mapping.active;
const action = newActive ? 'Activate' : 'Deactivate';
const action = newActive ? 'Activated' : 'Deactivated';
this.alertService.success(`${action} mapping: ${mapping.id}!`);
const parameter = { id: mapping.id, active: newActive };
await this.mappingService.changeActivationMapping(parameter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ export class MappingStepTestingComponent implements OnInit, OnDestroy {
}
});
if (testProcessingContext.errors.length > 0 || errors.length > 0) {
this.alertService.warning('Test transformation was not successful!');
this.alertService.warning('Testing transformation was not successful!');
testProcessingContext.errors.forEach((msg) => {
this.alertService.danger(msg);
});
} else {
this.alertService.success('Testing transformation was successful!');
this.alertService.success('Testing transformation was successful.');
}
this.onNextTestResult();
}
Expand All @@ -168,7 +168,7 @@ export class MappingStepTestingComponent implements OnInit, OnDestroy {
}
});
if (testProcessingContext.errors.length > 0 || errors.length > 0) {
this.alertService.warning('Test transformation was not successful!');
this.alertService.warning('Testing transformation was not successful!');
testProcessingContext.errors.forEach((msg) => {
this.alertService.danger(msg);
});
Expand Down

0 comments on commit bce5136

Please sign in to comment.