yanas 86fcfcc535 WiP(invite-ui): Initial move of invite UI to invite button (#1950)
* WiP(invite-ui): Initial move of invite UI to invite button

* Adjusts styling to fit both horizontal and vertical filmstrip

* Removes comment and functions not needed

* [squash] Addressing various review comments

* [squash] Move invite options to a separate config

* [squash] Adjust invite button styles until we fix the whole UI theme

* [squash] Fix the remote videos scroll

* [squash]:Do not show popup menu when 1 option is available

* [squash]: Disable the invite button in filmstrip mode

* feat(connection-indicator): implement automatic hiding on good connection (#2009)

* ref(connection-stats): use PropTypes package

* feat(connection-stats): display a summary of the connection quality

* feat(connection-indicator): show empty bars for interrupted connection

* feat(connection-indicator): change background color based on status

* feat(connection-indicator): implement automatic hiding on good connection

* fix(connection-indicator): explicitly set font size

Currently non-react code will set an icon size on ConnectionIndicator.
This doesn't work on initial call join in vertical filmstrip after
some changes to support hiding the indicator. The chosen fix is
passing in the icon size to mirror what would happe with full
filmstrip reactification.

* ref(connection-stats): rename statuses

* feat(connection-indicator): make hiding behavior configurable

The original implementation made the auto hiding of the indicator
configured in interfaceConfig.

* fix(connection-indicator): readd class expected by torture tests

* fix(connection-indicator): change connection quality display styling

Bold the connection summary in the stats popover so it stands out.
Change the summaries so there are only three--strong, nonoptimal,
poor.

* fix(connection-indicator): gray background on lost connection

* feat(icons): add new gsm bars icon

* feat(connection-indicator): use new 3-bar icon

* ref(icons): remove icon-connection and icon-connection-lost

Both have been replaced by icon-gsm-bars so they are not
being referenced anymore. Mobile looks to have connect-lost
as a separate icon in font-icons/jitsi.json.

* fix(defaultToolbarButtons): Fixes unresolved InfoDialogButton component problem

* [squash]: Makes invite button fit the container

* [squash]:Addressing invite truncate, remote menu position and comment

* [squash]:Fix z-index in horizontal mode, z-index in lonely call

* [squash]: Fix filmstripOnly property, remove important from css
2017-10-03 11:30:42 -05:00

104 lines
3.3 KiB
JavaScript

declare var $: Function;
declare var interfaceConfig: Object;
/**
* Sends an ajax request to a directory service.
*
* @param {string} serviceUrl - The service to query.
* @param {string} jwt - The jwt token to pass to the search service.
* @param {string} text - Text to search.
* @param {Array<string>} queryTypes - Array with the query types that will be
* executed - "conferenceRooms" | "user" | "room".
* @returns {Promise} - The promise created by the request.
*/
export function searchPeople( // eslint-disable-line max-params
serviceUrl,
jwt,
text,
queryTypes = [ 'conferenceRooms', 'user', 'room' ]) {
const queryTypesString = JSON.stringify(queryTypes);
return new Promise((resolve, reject) => {
$.getJSON(`${serviceUrl}?query=${encodeURIComponent(text)}`
+ `&queryTypes=${queryTypesString}&jwt=${jwt}`,
response => resolve(response)
).fail((jqxhr, textStatus, error) =>
reject(error)
);
});
}
/**
* Sends a post request to an invite service.
*
* @param {string} inviteServiceUrl - The invite service that generates the
* invitation.
* @param {string} inviteUrl - The url to the conference.
* @param {string} jwt - The jwt token to pass to the search service.
* @param {Immutable.List} people - The list of the "user" type items to invite.
* @returns {Promise} - The promise created by the request.
*/
export function invitePeople(inviteServiceUrl, inviteUrl, jwt, people) { // eslint-disable-line max-params, max-len
return new Promise((resolve, reject) => {
$.post(`${inviteServiceUrl}?token=${jwt}`,
JSON.stringify({
'invited': people,
'url': inviteUrl }),
response => resolve(response),
'json')
.fail((jqxhr, textStatus, error) =>
reject(error)
);
});
}
/**
* Invites room participants to the conference through the SIP Jibri service.
*
* @param {JitsiMeetConference} conference - The conference to which the rooms
* will be invited to.
* @param {Immutable.List} rooms - The list of the "videosipgw" type items to
* invite.
* @returns {void}
*/
export function inviteRooms(conference, rooms) {
for (const room of rooms) {
const sipAddress = room.id;
const displayName = room.name;
if (sipAddress && displayName) {
const newSession
= conference.createVideoSIPGWSession(sipAddress, displayName);
newSession.start();
} else {
console.error(
`No display name or sip number for ${JSON.stringify(room)}`);
}
}
}
/**
* Indicates if an invite option is enabled in the configuration.
*
* @param {string} name - The name of the option defined in
* interfaceConfig.INVITE_OPTIONS.
* @returns {boolean} - True to indicate that the given invite option is
* enabled, false - otherwise.
*/
export function isInviteOptionEnabled(name) {
return interfaceConfig.INVITE_OPTIONS.indexOf(name) !== -1;
}
/**
* Get the position of the invite option in the interfaceConfig.INVITE_OPTIONS
* list.
*
* @param {string} optionName - The invite option name.
* @private
* @returns {number} - The position of the option in the list.
*/
export function getInviteOptionPosition(optionName) {
return interfaceConfig.INVITE_OPTIONS.indexOf(optionName);
}