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

[frontend] fix filter priority order #1534

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 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
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,15 @@
// Inject has a command payload
Payload payload = injectorContract.getPayload();
Command payloadCommand = (Command) Hibernate.unproxy(payload);
return new InjectStatusCommandLine(!payloadCommand.getContent().isBlank() ? List.of(payloadCommand.getContent()) : null,
!payloadCommand.getCleanupCommand().isBlank() ? List.of(payload.getCleanupCommand()) : null, payload.getExternalId());
return new InjectStatusCommandLine(

Check warning on line 439 in openbas-api/src/main/java/io/openbas/service/AtomicTestingService.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/service/AtomicTestingService.java#L439

Added line #L439 was not covered by tests
payloadCommand.getContent() != null && !payloadCommand.getContent().isBlank()
? List.of(payloadCommand.getContent())
: null,

Check warning on line 442 in openbas-api/src/main/java/io/openbas/service/AtomicTestingService.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/service/AtomicTestingService.java#L441-L442

Added lines #L441 - L442 were not covered by tests
payloadCommand.getCleanupCommand() != null && !payloadCommand.getCleanupCommand().isBlank()
? List.of(payloadCommand.getCleanupCommand())
: null,
payload.getExternalId()

Check warning on line 446 in openbas-api/src/main/java/io/openbas/service/AtomicTestingService.java

View check run for this annotation

Codecov / codecov/patch

openbas-api/src/main/java/io/openbas/service/AtomicTestingService.java#L444-L446

Added lines #L444 - L446 were not covered by tests
);
} else {
// Inject comes from Caldera ability and tomorrow from other(s) Executor(s)
io.openbas.execution.Injector executor = context.getBean(injectorContract.getInjector().getType(), io.openbas.execution.Injector.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ export const availableOperators = (propertySchema: PropertySchemaDTO) => {
if (propertySchema.schema_property_type.includes('instant')) {
return ['gt', 'gte', 'lt', 'lte', 'empty', 'not_empty'];
}
// Array
if (propertySchema.schema_property_type_array || propertySchema.schema_property_values) {
return ['contains', 'not_contains', 'empty', 'not_empty'];
}
// Enum & not array
if (propertySchema.schema_property_values && !propertySchema.schema_property_type_array) {
return ['eq'];
Expand All @@ -103,6 +99,10 @@ export const availableOperators = (propertySchema: PropertySchemaDTO) => {
if (propertySchema.schema_property_has_dynamic_value && !propertySchema.schema_property_type_array) {
return ['contains', 'not_contains', 'empty', 'not_empty'];
}
// Array
if (propertySchema.schema_property_type_array) {
return ['contains', 'not_contains', 'empty', 'not_empty'];
}
return [
'eq',
'not_eq',
Expand Down