Skip to content

Commit

Permalink
fix(#2997): Fix default selection for timestamp rule (#2998)
Browse files Browse the repository at this point in the history
  • Loading branch information
tenthe authored Jul 5, 2024
1 parent a6e5958 commit 6136d93
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
40 changes: 21 additions & 19 deletions ui/cypress/tests/adapter/fileStream.smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,26 @@ describe(
);
});

// it('File Stream adapter with unix timestamp in milliseconds', () => {
// FileManagementUtils.addFile('connect/fileReplay/timestampInMilliseconds/input.csv');
// const adapterConfiguration =
// ConnectUtils.setUpPreprocessingRuleTest(false);
//
// // Edit timestamp property
// ConnectEventSchemaUtils.editTimestampPropertyWithNumber(
// 'timestamp',
// 'Milliseconds',
// );
//
// ConnectEventSchemaUtils.finishEventSchemaConfiguration();
// ConnectUtils.tearDownPreprocessingRuleTest(
// adapterConfiguration,
// 'cypress/fixtures/connect/fileReplay/timestampInMilliseconds/expected.csv',
// false,
// 2000,
// );
// });
it('File Stream adapter with unix timestamp in milliseconds', () => {
FileManagementUtils.addFile(
'connect/fileReplay/timestampInMilliseconds/input.csv',
);
const adapterConfiguration =
ConnectUtils.setUpPreprocessingRuleTest(false);

// Edit timestamp property
ConnectEventSchemaUtils.editTimestampPropertyWithNumber(
'timestamp',
'Milliseconds',
);

ConnectEventSchemaUtils.finishEventSchemaConfiguration();
ConnectUtils.tearDownPreprocessingRuleTest(
adapterConfiguration,
'cypress/fixtures/connect/fileReplay/timestampInMilliseconds/expected.csv',
false,
2000,
);
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
Milliseconds
</mat-option>
<mat-option
value="second"
value="seconds"
(click)="
cachedProperty.additionalMetadata.multiplier = 1000
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,25 @@
*
*/

import { Component, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';

@Component({
selector: 'sp-edit-timestamp-property',
templateUrl: './edit-timestamp-property.component.html',
styleUrls: ['./edit-timestamp-property.component.scss'],
})
export class EditTimestampPropertyComponent {
@Input() cachedProperty: any;
@Input() showEditTimestampProperty: boolean;
export class EditTimestampPropertyComponent implements OnInit {
@Input()
cachedProperty: any;
@Input()
showEditTimestampProperty: boolean;

private selectedTimeMultiplier;
selectedTimeMultiplier = 'seconds';

constructor() {
// Set preselected value
this.selectedTimeMultiplier = 'second';
ngOnInit(): void {
// Change default if multiplier is 1
if (this.cachedProperty.additionalMetadata.multiplier == 0) {
this.selectedTimeMultiplier = 'milliseconds';
}
}
}

0 comments on commit 6136d93

Please sign in to comment.