Removing webapp

parent 7bc8e9a0

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

{
"presets": [
"es2015",
"react",
"stage-0"
]
}
This diff is collapsed.
.PHONY: build test run clean stop check-style run-unit emojis
BUILD_SERVER_DIR = ..
check-style: .yarninstall
@echo Checking for style guide compliance
yarn run check
test: .yarninstall
cd $(BUILD_SERVER_DIR) && $(MAKE) internal-test-web-client
.yarninstall: package.json
@echo Getting dependencies using yarn
yarn install
touch $@
build: .yarninstall
@echo Building mattermost Webapp
rm -rf dist
yarn run build
run: .yarninstall
@echo Running mattermost Webapp for development
yarn run run &
run-fullmap: .yarninstall
@echo FULL SOURCE MAP Running mattermost Webapp for development FULL SOURCE MAP
yarn run run-fullmap &
stop:
@echo Stopping changes watching
ifeq ($(OS),Windows_NT)
wmic process where "Caption='node.exe' and CommandLine like '%webpack%'" call terminate
else
@for PROCID in $$(ps -ef | grep "[n]ode.*[w]ebpack" | awk '{ print $$2 }'); do \
echo stopping webpack watch $$PROCID; \
kill $$PROCID; \
done
endif
clean:
@echo Cleaning Webapp
yarn cache clean
rm -rf dist
rm -rf node_modules
rm -f .yarninstall
emojis:
./make-emojis
This diff is collapsed.
This diff is collapsed.
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import UserStore from 'stores/user_store.jsx';
export function trackEvent(category, event, props) {
if (global.window && global.window.analytics) {
const properties = Object.assign({category, type: event, user_actual_id: UserStore.getCurrentId()}, props);
const options = {
context: {
ip: '0.0.0.0'
},
page: {
path: '',
referrer: '',
search: '',
title: '',
url: ''
},
anonymousId: '00000000000000000000000000'
};
global.window.analytics.track('event', properties, options);
}
}
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import UserStore from 'stores/user_store.jsx';
import AppDispatcher from 'dispatcher/app_dispatcher.jsx';
import {ActionTypes} from 'utils/constants.jsx';
import store from 'stores/redux_store.jsx';
const dispatch = store.dispatch;
const getState = store.getState;
import {getProfilesByIds} from 'mattermost-redux/actions/users';
import * as EmojiActions from 'mattermost-redux/actions/emojis';
export async function loadEmoji(getProfiles = true) {
const data = await EmojiActions.getAllCustomEmojis()(dispatch, getState);
if (data && getProfiles) {
loadProfilesForEmoji(data);
}
}
function loadProfilesForEmoji(emojiList) {
const profilesToLoad = {};
for (let i = 0; i < emojiList.length; i++) {
const emoji = emojiList[i];
if (!UserStore.hasProfile(emoji.creator_id)) {
profilesToLoad[emoji.creator_id] = true;
}
}
const list = Object.keys(profilesToLoad);
if (list.length === 0) {
return;
}
getProfilesByIds(list)(dispatch, getState);
}
export function addEmoji(emoji, image, success, error) {
EmojiActions.createCustomEmoji(emoji, image)(dispatch, getState).then(
(data) => {
if (data && success) {
success(data);
} else if (data == null && error) {
const serverError = getState().requests.emojis.createCustomEmoji.error;
error({id: serverError.server_error_id, ...serverError});
}
}
);
}
export function deleteEmoji(emojiId, success, error) {
EmojiActions.deleteCustomEmoji(emojiId)(dispatch, getState).then(
(data) => {
if (data) {
// Needed to remove recently used emoji
AppDispatcher.handleServerAction({
type: ActionTypes.REMOVED_CUSTOM_EMOJI,
id: emojiId
});
if (success) {
success(data);
}
} else if (data == null && error) {
const serverError = getState().requests.emojis.deleteCustomEmoji.error;
error({id: serverError.server_error_id, ...serverError});
}
}
);
}
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {batchActions} from 'redux-batched-actions';
import request from 'superagent';
import store from 'stores/redux_store.jsx';
import * as Utils from 'utils/utils.jsx';
import {FileTypes} from 'mattermost-redux/action_types';
import {forceLogoutIfNecessary} from 'mattermost-redux/actions/helpers';
import {getLogErrorAction} from 'mattermost-redux/actions/errors';
import {Client4} from 'mattermost-redux/client';
export function uploadFile(file, name, channelId, clientId, successCallback, errorCallback) {
const {dispatch, getState} = store;
function handleResponse(err, res) {
if (err) {
let e;
if (res && res.body && res.body.id) {
e = res.body;
} else if (err.status === 0 || !err.status) {
e = {message: Utils.localizeMessage('channel_loader.connection_error', 'There appears to be a problem with your internet connection.')};
} else {
e = {message: Utils.localizeMessage('channel_loader.unknown_error', 'We received an unexpected status code from the server.') + ' (' + err.status + ')'};
}
forceLogoutIfNecessary(err, dispatch);
const failure = {
type: FileTypes.UPLOAD_FILES_FAILURE,
clientIds: [clientId],
channelId,
rootId: null,
error: err
};
dispatch(batchActions([failure, getLogErrorAction(err)]), getState);
if (errorCallback) {
errorCallback(e, err, res);
}
} else if (res) {
const data = res.body.file_infos.map((fileInfo, index) => {
return {
...fileInfo,
clientId: res.body.client_ids[index]
};
});
dispatch(batchActions