Skip to content

Commit

Permalink
Add markdown help to Support Page greeting box
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Feb 17, 2025
1 parent 9014e5a commit 7c7c29c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ <h3>Greeting</h3>
</p>

<label for="supportPageGreeting">Enter a greeting (allows markdown)</label>
<textarea id="supportPageGreeting" rows="8" [placeholder]="'Welcome to **{{appName}}** Support!'"
class="form-control" name="supportPageGreeting" [(ngModel)]="settings.supportPageGreeting"
<textarea id="supportPageGreeting" rows="8" [placeholder]="placeholder" class="form-control"
name="supportPageGreeting" [(ngModel)]="settings.supportPageGreeting"
(input)="handleSettingsChanged()"></textarea>

<h3 class="mt-5">Ticket Auto-Labeling</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { SupportSettings } from '@/api/support-models';
import { SupportService } from '@/api/support.service';
import { UnsubscriberService } from '@/services/unsubscriber.service';
import { ConfigService } from '@/utility/config.service';
import { MarkdownHelpersService } from '@/services/markdown-helpers.service';

@Component({
selector: 'app-support-settings',
Expand All @@ -13,11 +14,13 @@ import { ConfigService } from '@/utility/config.service';
})
export class SupportSettingsComponent implements OnInit {
protected appName: string;
protected placeholder = "Welcome to Support!";
protected settings?: SupportSettings;
private update$ = new Subject<SupportSettings>();

constructor(
config: ConfigService,
private markdownHelpers: MarkdownHelpersService,
private supportService: SupportService,
private unsub: UnsubscriberService) {
// use the app name to personalize the placeholder
Expand All @@ -35,6 +38,7 @@ export class SupportSettingsComponent implements OnInit {

async ngOnInit(): Promise<void> {
this.load();
this.placeholder = this.markdownHelpers.getMarkdownPlaceholderHelp(`Welcome to ${this.appName} Support!`);
}

protected async handleSettingsChanged() {
Expand Down

0 comments on commit 7c7c29c

Please sign in to comment.