Merge pull request #765 from mattermost/PLT-349

PLT-349 adding team mgt to admin console
Этот коммит содержится в:
Christopher Speller
2015-09-24 08:14:30 -04:00
родитель 56f76502e3 00112cae51
Коммит 54c7dba33d
24 изменённых файлов: 1283 добавлений и 175 удалений

Просмотреть файл

@@ -371,6 +371,32 @@ export function getConfig() {
);
}
export function getAllTeams() {
if (isCallInProgress('getAllTeams')) {
return;
}
callTracker.getAllTeams = utils.getTimestamp();
client.getAllTeams(
(data, textStatus, xhr) => {
callTracker.getAllTeams = 0;
if (xhr.status === 304 || !data) {
return;
}
AppDispatcher.handleServerAction({
type: ActionTypes.RECIEVED_ALL_TEAMS,
teams: data
});
},
(err) => {
callTracker.getAllTeams = 0;
dispatchError(err, 'getAllTeams');
}
);
}
export function findTeams(email) {
if (isCallInProgress('findTeams_' + email)) {
return;

Просмотреть файл

@@ -347,6 +347,20 @@ export function testEmail(config, success, error) {
});
}
export function getAllTeams(success, error) {
$.ajax({
url: '/api/v1/teams/all',
dataType: 'json',
contentType: 'application/json',
type: 'GET',
success,
error: function onError(xhr, status, err) {
var e = handleError('getAllTeams', xhr, status, err);
error(e);
}
});
}
export function getMeSynchronous(success, error) {
var currentUser = null;
$.ajax({
@@ -890,6 +904,21 @@ export function getProfiles(success, error) {
});
}
export function getProfilesForTeam(teamId, success, error) {
$.ajax({
cache: false,
url: '/api/v1/users/profiles/' + teamId,
dataType: 'json',
contentType: 'application/json',
type: 'GET',
success,
error: function onError(xhr, status, err) {
var e = handleError('getProfilesForTeam', xhr, status, err);
error(e);
}
});
}
export function uploadFile(formData, success, error) {
var request = $.ajax({
url: '/api/v1/files/upload',

Просмотреть файл

@@ -35,8 +35,8 @@ module.exports = {
RECIEVED_TEAM: null,
RECIEVED_CONFIG: null,
RECIEVED_LOGS: null,
RECIEVED_ALL_TEAMS: null,
TOGGLE_IMPORT_THEME_MODAL: null
}),