|
@@ -24,35 +24,19 @@ const _RIGHT_WATERMARK_STYLE = {
|
24
|
24
|
type Props = {
|
25
|
25
|
|
26
|
26
|
/**
|
27
|
|
- * The user selected url used to navigate to on logo click.
|
|
27
|
+ * The link used to navigate to on logo click.
|
28
|
28
|
*/
|
29
|
|
- _customLogoLink: string,
|
|
29
|
+ _logoLink: string,
|
30
|
30
|
|
31
|
31
|
/**
|
32
|
|
- * The url of the user selected logo.
|
|
32
|
+ * The url for the logo.
|
33
|
33
|
*/
|
34
|
|
- _customLogoUrl: string,
|
|
34
|
+ _logoUrl: string,
|
35
|
35
|
|
36
|
36
|
/**
|
37
|
|
- * Whether or not the current user is logged in through a JWT.
|
|
37
|
+ * If the Jitsi watermark should be displayed or not.
|
38
|
38
|
*/
|
39
|
|
- _isGuest: boolean,
|
40
|
|
-
|
41
|
|
- /**
|
42
|
|
- * Whether or not the current meeting is a vpaas one.
|
43
|
|
- */
|
44
|
|
- _isVpaas: boolean,
|
45
|
|
-
|
46
|
|
- /**
|
47
|
|
- * Flag used to signal that the logo can be displayed.
|
48
|
|
- * It becomes true after the user customization options are fetched.
|
49
|
|
- */
|
50
|
|
- _readyToDisplayJitsiWatermark: boolean,
|
51
|
|
-
|
52
|
|
- /**
|
53
|
|
- * Returns true if welcome page is visible at the moment.
|
54
|
|
- */
|
55
|
|
- _welcomePageIsVisible: boolean,
|
|
39
|
+ _showJitsiWatermark: boolean,
|
56
|
40
|
|
57
|
41
|
/**
|
58
|
42
|
* The default value for the Jitsi logo URL.
|
|
@@ -75,27 +59,11 @@ type State = {
|
75
|
59
|
*/
|
76
|
60
|
brandWatermarkLink: string,
|
77
|
61
|
|
78
|
|
- /**
|
79
|
|
- * The url to open when clicking the Jitsi watermark.
|
80
|
|
- */
|
81
|
|
- jitsiWatermarkLink: string,
|
82
|
|
-
|
83
|
62
|
/**
|
84
|
63
|
* Whether or not the brand watermark should be displayed.
|
85
|
64
|
*/
|
86
|
65
|
showBrandWatermark: boolean,
|
87
|
66
|
|
88
|
|
- /**
|
89
|
|
- * Whether or not the Jitsi watermark should be displayed.
|
90
|
|
- */
|
91
|
|
- showJitsiWatermark: boolean,
|
92
|
|
-
|
93
|
|
- /**
|
94
|
|
- * Whether or not the Jitsi watermark should be displayed for users not
|
95
|
|
- * logged in through a JWT.
|
96
|
|
- */
|
97
|
|
- showJitsiWatermarkForGuests: boolean,
|
98
|
|
-
|
99
|
67
|
/**
|
100
|
68
|
* Whether or not the show the "powered by Jitsi.org" link.
|
101
|
69
|
*/
|
|
@@ -117,29 +85,17 @@ class Watermarks extends Component<Props, State> {
|
117
|
85
|
super(props);
|
118
|
86
|
|
119
|
87
|
let showBrandWatermark;
|
120
|
|
- let showJitsiWatermark;
|
121
|
|
- let showJitsiWatermarkForGuests;
|
122
|
88
|
|
123
|
89
|
if (interfaceConfig.filmStripOnly) {
|
124
|
90
|
showBrandWatermark = false;
|
125
|
|
- showJitsiWatermark = false;
|
126
|
|
- showJitsiWatermarkForGuests = false;
|
127
|
91
|
} else {
|
128
|
92
|
showBrandWatermark = interfaceConfig.SHOW_BRAND_WATERMARK;
|
129
|
|
- showJitsiWatermark = interfaceConfig.SHOW_JITSI_WATERMARK;
|
130
|
|
- showJitsiWatermarkForGuests
|
131
|
|
- = interfaceConfig.SHOW_WATERMARK_FOR_GUESTS;
|
132
|
93
|
}
|
133
|
94
|
|
134
|
95
|
this.state = {
|
135
|
96
|
brandWatermarkLink:
|
136
|
97
|
showBrandWatermark ? interfaceConfig.BRAND_WATERMARK_LINK : '',
|
137
|
|
- jitsiWatermarkLink:
|
138
|
|
- showJitsiWatermark || showJitsiWatermarkForGuests
|
139
|
|
- ? interfaceConfig.JITSI_WATERMARK_LINK : '',
|
140
|
98
|
showBrandWatermark,
|
141
|
|
- showJitsiWatermark,
|
142
|
|
- showJitsiWatermarkForGuests,
|
143
|
99
|
showPoweredBy: interfaceConfig.SHOW_POWERED_BY
|
144
|
100
|
};
|
145
|
101
|
}
|
|
@@ -166,55 +122,6 @@ class Watermarks extends Component<Props, State> {
|
166
|
122
|
);
|
167
|
123
|
}
|
168
|
124
|
|
169
|
|
- /**
|
170
|
|
- * Returns true if the watermark is ready to be displayed.
|
171
|
|
- *
|
172
|
|
- * @private
|
173
|
|
- * @returns {boolean}
|
174
|
|
- */
|
175
|
|
- _canDisplayJitsiWatermark() {
|
176
|
|
- const {
|
177
|
|
- showJitsiWatermark,
|
178
|
|
- showJitsiWatermarkForGuests
|
179
|
|
- } = this.state;
|
180
|
|
- const {
|
181
|
|
- _isGuest,
|
182
|
|
- _readyToDisplayJitsiWatermark,
|
183
|
|
- _welcomePageIsVisible
|
184
|
|
- } = this.props;
|
185
|
|
-
|
186
|
|
- return (_readyToDisplayJitsiWatermark
|
187
|
|
- && (showJitsiWatermark || (_isGuest && showJitsiWatermarkForGuests)))
|
188
|
|
- || _welcomePageIsVisible;
|
189
|
|
- }
|
190
|
|
-
|
191
|
|
- /**
|
192
|
|
- * Returns the background image style.
|
193
|
|
- *
|
194
|
|
- * @private
|
195
|
|
- * @returns {string}
|
196
|
|
- */
|
197
|
|
- _getBackgroundImageStyle() {
|
198
|
|
- const {
|
199
|
|
- _customLogoUrl,
|
200
|
|
- _isVpaas,
|
201
|
|
- defaultJitsiLogoURL
|
202
|
|
- } = this.props;
|
203
|
|
- let style = 'none';
|
204
|
|
-
|
205
|
|
- if (_isVpaas) {
|
206
|
|
- if (_customLogoUrl) {
|
207
|
|
- style = `url(${_customLogoUrl})`;
|
208
|
|
- }
|
209
|
|
- } else {
|
210
|
|
- style = `url(${_customLogoUrl
|
211
|
|
- || defaultJitsiLogoURL
|
212
|
|
- || interfaceConfig.DEFAULT_LOGO_URL})`;
|
213
|
|
- }
|
214
|
|
-
|
215
|
|
- return style;
|
216
|
|
- }
|
217
|
|
-
|
218
|
125
|
/**
|
219
|
126
|
* Renders a brand watermark if it is enabled.
|
220
|
127
|
*
|
|
@@ -254,33 +161,28 @@ class Watermarks extends Component<Props, State> {
|
254
|
161
|
* @returns {ReactElement|null}
|
255
|
162
|
*/
|
256
|
163
|
_renderJitsiWatermark() {
|
|
164
|
+ const {
|
|
165
|
+ _logoLink,
|
|
166
|
+ _logoUrl,
|
|
167
|
+ _showJitsiWatermark
|
|
168
|
+ } = this.props;
|
257
|
169
|
let reactElement = null;
|
258
|
170
|
|
259
|
|
- if (this._canDisplayJitsiWatermark()) {
|
260
|
|
- const backgroundImage = this._getBackgroundImageStyle();
|
261
|
|
- const link = this.props._customLogoLink || this.state.jitsiWatermarkLink;
|
262
|
|
- const additionalStyles = {};
|
263
|
|
-
|
264
|
|
- if (backgroundImage === 'none') {
|
265
|
|
- additionalStyles.height = 0;
|
266
|
|
- additionalStyles.width = 0;
|
267
|
|
- }
|
268
|
|
-
|
|
171
|
+ if (_showJitsiWatermark) {
|
269
|
172
|
const style = {
|
270
|
|
- backgroundImage,
|
|
173
|
+ backgroundImage: `url(${_logoUrl})`,
|
271
|
174
|
maxWidth: 140,
|
272
|
|
- maxHeight: 70,
|
273
|
|
- ...additionalStyles
|
|
175
|
+ maxHeight: 70
|
274
|
176
|
};
|
275
|
177
|
|
276
|
178
|
reactElement = (<div
|
277
|
179
|
className = 'watermark leftwatermark'
|
278
|
180
|
style = { style } />);
|
279
|
181
|
|
280
|
|
- if (link) {
|
|
182
|
+ if (_logoLink) {
|
281
|
183
|
reactElement = (
|
282
|
184
|
<a
|
283
|
|
- href = { link }
|
|
185
|
+ href = { _logoLink }
|
284
|
186
|
target = '_new'>
|
285
|
187
|
{ reactElement }
|
286
|
188
|
</a>
|
|
@@ -319,27 +221,52 @@ class Watermarks extends Component<Props, State> {
|
319
|
221
|
* Maps parts of Redux store to component prop types.
|
320
|
222
|
*
|
321
|
223
|
* @param {Object} state - Snapshot of Redux store.
|
|
224
|
+ * @param {Object} ownProps - Component's own props.
|
322
|
225
|
* @returns {Props}
|
323
|
226
|
*/
|
324
|
|
-function _mapStateToProps(state) {
|
|
227
|
+function _mapStateToProps(state, ownProps) {
|
325
|
228
|
const { isGuest } = state['features/base/jwt'];
|
326
|
|
- const { customizationReady, logoClickUrl, logoImageUrl } = state['features/dynamic-branding'];
|
327
|
|
- const { room } = state['features/base/conference'];
|
|
229
|
+ const {
|
|
230
|
+ customizationReady,
|
|
231
|
+ customizationFailed,
|
|
232
|
+ defaultBranding,
|
|
233
|
+ useDynamicBrandingData,
|
|
234
|
+ logoClickUrl,
|
|
235
|
+ logoImageUrl
|
|
236
|
+ } = state['features/dynamic-branding'];
|
|
237
|
+ const isValidRoom = state['features/base/conference'].room;
|
|
238
|
+ const {
|
|
239
|
+ DEFAULT_LOGO_URL,
|
|
240
|
+ JITSI_WATERMARK_LINK,
|
|
241
|
+ SHOW_JITSI_WATERMARK,
|
|
242
|
+ SHOW_JITSI_WATERMARK_FOR_GUESTS,
|
|
243
|
+ filmStripOnly
|
|
244
|
+ } = interfaceConfig;
|
|
245
|
+ let _showJitsiWatermark = (!filmStripOnly
|
|
246
|
+ && (customizationReady && !customizationFailed)
|
|
247
|
+ && (SHOW_JITSI_WATERMARK || (isGuest && SHOW_JITSI_WATERMARK_FOR_GUESTS)))
|
|
248
|
+ || !isValidRoom;
|
|
249
|
+ let _logoUrl = logoImageUrl;
|
|
250
|
+ let _logoLink = logoClickUrl;
|
|
251
|
+
|
|
252
|
+ if (useDynamicBrandingData) {
|
|
253
|
+ if (isVpaasMeeting(state)) {
|
|
254
|
+ // don't show logo if request fails or no logo set for vpaas meetings
|
|
255
|
+ _showJitsiWatermark = !customizationFailed && Boolean(logoImageUrl);
|
|
256
|
+ } else if (defaultBranding) {
|
|
257
|
+ _logoUrl = DEFAULT_LOGO_URL;
|
|
258
|
+ _logoLink = JITSI_WATERMARK_LINK;
|
|
259
|
+ }
|
|
260
|
+ } else {
|
|
261
|
+ // When there is no custom branding data use defaults
|
|
262
|
+ _logoUrl = ownProps.defaultJitsiLogoURL || DEFAULT_LOGO_URL;
|
|
263
|
+ _logoLink = JITSI_WATERMARK_LINK;
|
|
264
|
+ }
|
328
|
265
|
|
329
|
266
|
return {
|
330
|
|
- /**
|
331
|
|
- * The indicator which determines whether the local participant is a
|
332
|
|
- * guest in the conference.
|
333
|
|
- *
|
334
|
|
- * @private
|
335
|
|
- * @type {boolean}
|
336
|
|
- */
|
337
|
|
- _customLogoLink: logoClickUrl,
|
338
|
|
- _customLogoUrl: logoImageUrl,
|
339
|
|
- _isGuest: isGuest,
|
340
|
|
- _isVpaas: isVpaasMeeting(state),
|
341
|
|
- _readyToDisplayJitsiWatermark: customizationReady,
|
342
|
|
- _welcomePageIsVisible: !room
|
|
267
|
+ _logoLink,
|
|
268
|
+ _logoUrl,
|
|
269
|
+ _showJitsiWatermark
|
343
|
270
|
};
|
344
|
271
|
}
|
345
|
272
|
|