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

Fixed visual bug - dupe operational notes when updating custom rule #551

Merged
merged 2 commits into from
Jun 18, 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
2 changes: 1 addition & 1 deletion html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ <h2 id="detection-title">{{ detect.title }}</h2>
<v-btn :title="i18n.addCommentHelp" color="primary" @click.stop="prepareForInput('comment-input')" id="add-comment-button" data-aid="detection_comments_new">
<v-icon>fa-plus</v-icon>
</v-btn>
<v-btn class="mx-1" :title="i18n.refreshCommentsHelp" color="secondary" @click.stop="reloadAssociation(true)" id="refresh-comments-button" data-aid="detection_comments_refresh">
<v-btn class="mx-1" :title="i18n.refreshCommentsHelp" color="secondary" @click.stop="loadComments(true)" id="refresh-comments-button" data-aid="detection_comments_refresh">
<v-icon>fa-sync</v-icon>
</v-btn>
</v-toolbar>
Expand Down
12 changes: 5 additions & 7 deletions html/js/routes/detection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1077,16 +1077,12 @@ routes.push({ path: '/detection/:id', name: 'detection', component: {
el.scrollIntoView()
el.focus();
},
async reloadComments(showLoadingIndicator = false) {
async loadComments(showLoadingIndicator = false) {
if (showLoadingIndicator) this.$root.startLoading();
this.comments = [];
await this.loadComments();
if (showLoadingIndicator) this.$root.stopLoading();
},
async loadComments() {
try {
const response = await this.$root.papi.get(`detection/${this.detect.id}/comment`);
if (response && response.data) {
this.comments = [];
for (var idx = 0; idx < response.data.length; idx++) {
const obj = response.data[idx];

Expand All @@ -1107,6 +1103,8 @@ routes.push({ path: '/detection/:id', name: 'detection', component: {
}
} catch (error) {
this.$root.showError(error);
} finally {
if (showLoadingIndicator) this.$root.stopLoading();
}
},
async addComment() {
Expand Down Expand Up @@ -1140,7 +1138,7 @@ routes.push({ path: '/detection/:id', name: 'detection', component: {

if (response && response.data) {
if (isUpdate) {
this.reloadComments();
this.loadComments();
} else {
await this.$root.populateUserDetails(response.data, "userId", "owner");
this.comments.push(response.data);
Expand Down
Loading