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

Cleanup for Cypress Tests #417

Merged
merged 1 commit into from
Apr 5, 2024
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
17 changes: 8 additions & 9 deletions html/js/routes/detection.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,9 @@ routes.push({ path: '/detection/:id', name: 'detection', component: {
this.editField = null;

if (commit && !this.isNew()) {
this.$nextTick(async () => {
await this.saveDetection(false);
this.curEditTarget = null;
});
this.saveDetection(false).then(() => {
this.curEditTarget = null;
});
}
},
async saveDetection(createNew) {
Expand Down Expand Up @@ -627,10 +626,6 @@ routes.push({ path: '/detection/:id', name: 'detection', component: {
});
}

if (response.status === 206) {
this.$root.showWarning(this.i18n.disabledFailedSync);
}

// get any expanded overrides before updating this.detect
let index = -1;
if (this.expanded && this.expanded.length) {
Expand All @@ -649,7 +644,11 @@ routes.push({ path: '/detection/:id', name: 'detection', component: {
this.expand(this.detect.overrides[index]);
}

this.$root.showTip(this.i18n.saveSuccess);
if (response.status === 206) {
this.$root.showWarning(this.i18n.disabledFailedSync);
} else {
this.$root.showTip(this.i18n.saveSuccess);
}

if (createNew) {
this.$router.push({ name: 'detection', params: { id: response.data.id } });
Expand Down
2 changes: 2 additions & 0 deletions server/detectionhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ func (h *DetectionHandler) createDetection(w http.ResponseWriter, r *http.Reques
}
}

detect.Language = model.SigLanguage(strings.ToLower(string(detect.Language)))

switch detect.Language {
case "sigma":
detect.Engine = model.EngineNameElastAlert
Expand Down
Loading