Browse Source

UI: Fixed slack autocomplete and refactroing code

pull/8265/head
Vladyslav_Prykhodko 4 years ago
parent
commit
11d6df96d1
  1. 6
      ui-ngx/src/app/shared/components/slack-conversation-autocomplete.component.ts
  2. 2
      ui-ngx/src/app/shared/models/notification.models.ts
  3. 0
      ui-ngx/src/assets/help/en_US/notification/rule_engine.md

6
ui-ngx/src/app/shared/components/slack-conversation-autocomplete.component.ts

@ -134,6 +134,7 @@ export class SlackConversationAutocompleteComponent implements ControlValueAcces
if (!change.firstChange && change.currentValue !== change.previousValue) {
if (propName === 'slackChanelType' || propName === 'token') {
this.clearSlackCache();
this.dirty = true;
this.conversationSlackFormGroup.get('conversation').patchValue('');
}
}
@ -167,8 +168,8 @@ export class SlackConversationAutocompleteComponent implements ControlValueAcces
onFocus() {
if (this.dirty) {
this.conversationSlackFormGroup.get('conversation').updateValueAndValidity({onlySelf: true, emitEvent: true});
this.dirty = false;
this.conversationSlackFormGroup.get('conversation').updateValueAndValidity({onlySelf: true, emitEvent: true});
}
}
@ -184,6 +185,9 @@ export class SlackConversationAutocompleteComponent implements ControlValueAcces
}
private fetchSlackConversation(searchText?: string): Observable<Array<SlackConversation>> {
if (this.dirty) {
return of([]);
}
if (this.slackSearchText !== searchText || this.latestSearchConversetionResult === null) {
this.slackSearchText = searchText;
const slackConversationFilter = this.createSlackConversationFilter(this.slackSearchText);

2
ui-ngx/src/app/shared/models/notification.models.ts

@ -539,7 +539,7 @@ export const NotificationTemplateTypeTranslateMap = new Map<NotificationType, No
[NotificationType.RULE_ENGINE,
{
name: 'notification.template-type.rule-engine',
helpId: 'notification/rule-engine'
helpId: 'notification/rule_engine'
}
]
]);

0
ui-ngx/src/assets/help/en_US/notification/rule-engine.md → ui-ngx/src/assets/help/en_US/notification/rule_engine.md

Loading…
Cancel
Save