summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console/legal_and_support_settings.jsx
blob: 33494b36f8fec8dfb8d587015e646a32e3b8d7c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import React from 'react';

import AdminSettings from './admin_settings.jsx';
import {FormattedMessage} from 'react-intl';
import SettingsGroup from './settings_group.jsx';
import TextSetting from './text_setting.jsx';

export default class LegalAndSupportSettings extends AdminSettings {
    constructor(props) {
        super(props);

        this.getConfigFromState = this.getConfigFromState.bind(this);

        this.renderSettings = this.renderSettings.bind(this);

        this.state = Object.assign(this.state, {
            termsOfServiceLink: props.config.SupportSettings.TermsOfServiceLink,
            privacyPolicyLink: props.config.SupportSettings.PrivacyPolicyLink,
            aboutLink: props.config.SupportSettings.AboutLink,
            helpLink: props.config.SupportSettings.HelpLink,
            reportAProblemLink: props.config.SupportSettings.ReportAProblemLink,
            supportEmail: props.config.SupportSettings.SupportEmail
        });
    }

    getConfigFromState(config) {
        config.SupportSettings.TermsOfServiceLink = this.state.termsOfServiceLink;
        config.SupportSettings.PrivacyPolicyLink = this.state.privacyPolicyLink;
        config.SupportSettings.AboutLink = this.state.aboutLink;
        config.SupportSettings.HelpLink = this.state.helpLink;
        config.SupportSettings.ReportAProblemLink = this.state.reportAProblemLink;
        config.SupportSettings.SupportEmail = this.state.supportEmail;

        return config;
    }

    renderTitle() {
        return (
            <h3>
                <FormattedMessage
                    id='admin.customization.support'
                    defaultMessage='Legal and Support'
                />
            </h3>
        );
    }

    renderSettings() {
        return (
            <SettingsGroup>
                <TextSetting
                    id='termsOfServiceLink'
                    label={
                        <FormattedMessage
                            id='admin.support.termsTitle'
                            defaultMessage='Terms of Service link:'
                        />
                    }
                    helpText={
                        <FormattedMessage
                            id='admin.support.termsDesc'
                            defaultMessage='Link to Terms of Service available to users on desktop and on mobile. Leaving this blank will hide the option to display a notice.'
                        />
                    }
                    value={this.state.termsOfServiceLink}
                    onChange={this.handleChange}
                />
                <TextSetting
                    id='privacyPolicyLink'
                    label={
                        <FormattedMessage
                            id='admin.support.privacyTitle'
                            defaultMessage='Privacy Policy link:'
                        />
                    }
                    helpText={
                        <FormattedMessage
                            id='admin.support.privacyDesc'
                            defaultMessage='Link to Privacy Policy available to users on desktop and on mobile. Leaving this blank will hide the option to display a notice.'
                        />
                    }
                    value={this.state.privacyPolicyLink}
                    onChange={this.handleChange}
                />
                <TextSetting
                    id='aboutLink'
                    label={
                        <FormattedMessage
                            id='admin.support.aboutTitle'
                            defaultMessage='About link:'
                        />
                    }
                    helpText={
                        <FormattedMessage
                            id='admin.support.aboutDesc'
                            defaultMessage='Link to About page for more information on your Mattermost deployment, for example its purpose and audience within your organization. Defaults to Mattermost information page.'
                        />
                    }
                    value={this.state.aboutLink}
                    onChange={this.handleChange}
                />
                <TextSetting
                    id='helpLink'
                    label={
                        <FormattedMessage
                            id='admin.support.helpTitle'
                            defaultMessage='Help link:'
                        />
                    }
                    helpText={
                        <FormattedMessage
                            id='admin.support.helpDesc'
                            defaultMessage='Link to help documentation from team site main menu. Typically not changed unless your organization chooses to create custom documentation.'
                        />
                    }
                    value={this.state.helpLink}
                    onChange={this.handleChange}
                />
                <TextSetting
                    id='reportAProblemLink'
                    label={
                        <FormattedMessage
                            id='admin.support.problemTitle'
                            defaultMessage='Report a Problem link:'
                        />
                    }
                    helpText={
                        <FormattedMessage
                            id='admin.support.problemDesc'
                            defaultMessage='Link to help documentation from team site main menu. By default this points to the peer-to-peer troubleshooting forum where users can search for, find and request help with technical issues.'
                        />
                    }
                    value={this.state.reportAProblemLink}
                    onChange={this.handleChange}
                />
                <TextSetting
                    id='supportEmail'
                    label={
                        <FormattedMessage
                            id='admin.support.emailTitle'
                            defaultMessage='Support Email:'
                        />
                    }
                    helpText={
                        <FormattedMessage
                            id='admin.support.emailHelp'
                            defaultMessage='Email address displayed on email notifications and during tutorial for end users to ask support questions.'
                        />
                    }
                    value={this.state.supportEmail}
                    onChange={this.handleChange}
                />
            </SettingsGroup>
        );
    }
}