diff --git a/src/www/messages/en.json b/src/www/messages/en.json index 991e5decfa9..503fb9c0d0c 100644 --- a/src/www/messages/en.json +++ b/src/www/messages/en.json @@ -18,7 +18,6 @@ "contact-view-issue-cannot-add-server": "I am having trouble adding a server using my access key", "contact-view-issue-connection": "I am having trouble connecting to my Outline VPN server", "contact-view-issue-general": "General feedback & suggestions", - "contact-view-issue-installation": "I am having trouble installing Outline", "contact-view-issue-managing": "I need assistance managing my Outline VPN server or helping others connect to it", "contact-view-issue-no-server": "I need an access key", "contact-view-issue-performance": "My internet access is slow while connected to my Outline VPN server", diff --git a/src/www/views/contact_view/index.ts b/src/www/views/contact_view/index.ts index 30bd41bb34e..da19b973354 100644 --- a/src/www/views/contact_view/index.ts +++ b/src/www/views/contact_view/index.ts @@ -90,7 +90,16 @@ export class ContactView extends LitElement { `, ]; - private static readonly ISSUES = Object.values(IssueType); + private static readonly ISSUES: {[key in AppType]: IssueType[]} = { + [AppType.CLIENT]: [ + IssueType.NO_SERVER, + IssueType.CANNOT_ADD_SERVER, + IssueType.CONNECTION, + IssueType.PERFORMANCE, + IssueType.GENERAL, + ], + [AppType.MANAGER]: [IssueType.CANNOT_ADD_SERVER, IssueType.CONNECTION, IssueType.MANAGING, IssueType.GENERAL], + }; @property({type: Function}) localize: Localizer = msg => msg; @property({type: String}) variant: AppType = AppType.CLIENT; @@ -137,7 +146,7 @@ export class ContactView extends LitElement { } private selectIssue(e: SingleSelectedEvent) { - this.selectedIssueType = ContactView.ISSUES[e.detail.index]; + this.selectedIssueType = ContactView.ISSUES[this.variant][e.detail.index]; if (UNSUPPORTED_ISSUE_TYPE_HELPPAGES.has(this.selectedIssueType)) { // TODO: Send users to localized support pages based on chosen language. @@ -212,6 +221,9 @@ export class ContactView extends LitElement { } render() { + console.log(this.variant); + console.log(ContactView.ISSUES[this.variant]); + switch (this.step) { case Step.FORM: { return html` ${this.renderIntroTemplate} ${this.renderForm} `; @@ -252,7 +264,7 @@ export class ContactView extends LitElement { ?hidden=${!this.showIssueSelector} @selected="${this.selectIssue}" > - ${ContactView.ISSUES.map(value => { + ${ContactView.ISSUES[this.variant].map(value => { return html` ${this.localize(`contact-view-issue-${value}`)} diff --git a/src/www/views/contact_view/issue_type.ts b/src/www/views/contact_view/issue_type.ts index b1f39af68a7..19281d6500d 100644 --- a/src/www/views/contact_view/issue_type.ts +++ b/src/www/views/contact_view/issue_type.ts @@ -16,7 +16,6 @@ /** Supported issue types in the feedback flow. */ export enum IssueType { - INSTALLATION = 'installation', NO_SERVER = 'no-server', CANNOT_ADD_SERVER = 'cannot-add-server', CONNECTION = 'connection',