...
 
Commits (1100)

Too many changes to show.

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

{
"presets": [
["es2015", { "modules": false }],
"react",
"stage-0"
],
"plugins": [
"transform-es2015-modules-commonjs",
"dynamic-import-node"
]
presets: [
['@babel/preset-env', {
targets: {
chrome: 66,
firefox: 60,
edge: 42,
ie: 11,
safari: 12,
},
modules: false,
debug: false,
useBuiltIns: 'usage',
shippedProposals: true,
}],
['@babel/preset-react', {
useBuiltIns: true,
}],
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
],
env: {
test: {
presets: [
['@babel/preset-env', {
targets: {
chrome: 66,
firefox: 60,
edge: 42,
ie: 11,
safari: 12,
},
debug: false,
useBuiltIns: 'usage',
shippedProposals: true,
}],
['@babel/preset-react', {
useBuiltIns: true,
}],
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
],
}
}
}
version: 2.1
executors:
default:
working_directory: ~/mattermost-webapp
docker:
- image: mattermost/mattermost-build-webapp:oct-2-2018
aliases:
- &restore_cache
restore_cache:
key: dependencies-{{ checksum "package-lock.json" }}
- &save_cache
save_cache:
key: dependencies-{{ checksum "package-lock.json" }}
paths:
- node_modules
jobs:
install:
executor:
name: default
steps:
- checkout
- *restore_cache
- run: |
npm ci
cd node_modules/mattermost-redux && npm i && npm run build
- *save_cache
lint:
executor:
name: default
steps:
- checkout
- *restore_cache
- run: |
npm run check
test:
executor:
name: default
steps:
- checkout
- *restore_cache
- run: npm run test-ci
- store_test_results:
path: build/
build:
executor:
name: default
steps:
- checkout
- *restore_cache
- run: make package-ci
- store_artifacts:
path: ~/mattermost-webapp/mattermost-webapp.tar.gz
- run:
name: Upload to S3
command: |
if [[ -z "${CIRCLE_PULL_REQUEST:-}" ]]; then
echo "Not a PR using the branch name ${CIRCLE_BRANCH}..."
export FOLDER_NAME=${CIRCLE_BRANCH}
echo "${FOLDER_NAME}"
else
echo "This is a PR ${CIRCLE_BRANCH}..."
export FOLDER_NAME=$(echo "${CIRCLE_BRANCH}" | sed 's/pull\//PR-/g')
echo "${FOLDER_NAME}"
fi
curl --request POST \
--url "https://lambdas.devops.mattermost.com/circleci/uploader?token=${UPLOADER_TOKEN}&vcs-type=github&username=${CIRCLE_PROJECT_USERNAME}&project=${CIRCLE_PROJECT_REPONAME}&build_num=${CIRCLE_BUILD_NUM}&bucket=releases.mattermost.com/${CIRCLE_PROJECT_REPONAME}/${FOLDER_NAME}/"
- run:
name: Upload to S3 - SHA1
command: |
curl --request POST \
--url "https://lambdas.devops.mattermost.com/circleci/uploader?token=${UPLOADER_TOKEN}&vcs-type=github&username=${CIRCLE_PROJECT_USERNAME}&project=${CIRCLE_PROJECT_REPONAME}&build_num=${CIRCLE_BUILD_NUM}&bucket=releases.mattermost.com/${CIRCLE_PROJECT_REPONAME}/commit/${CIRCLE_SHA1}/"
workflows:
version: 2
untagged-build:
jobs:
- install
- lint:
requires:
- install
- test:
requires:
- lint
- build:
requires:
- test
......@@ -15,7 +15,7 @@ indent_style = tab
indent_style = space
indent_size = 4
[package.json]
[{package.json,.eslintrc.json}]
indent_size = 2
[i18n/**.json]
......
This diff is collapsed.
......@@ -8,3 +8,9 @@ node_modules
tests/reports
.DS_Store
mattermost-webapp.iml
.vscode/
# disable folders generated by Cypress
cypress/screenshots
cypress/videos
results
# Code Contribution Guidelines
Thank you for your interest in contributing! Please see the [Mattermost Contribution Guide](http://docs.mattermost.com/developer/contribution-guide.html) which describes the process for making code contributions across Mattermost projects and [join our "Contributors" community channel](https://pre-release.mattermost.com/core/channels/tickets) to ask questions from community members and the Mattermost core team.
Thank you for your interest in contributing! Please see the [Mattermost Contribution Guide](https://developers.mattermost.com/contribute/getting-started/) which describes the process for making code contributions across Mattermost projects and [join our "Contributors" community channel](https://pre-release.mattermost.com/core/channels/tickets) to ask questions from community members and the Mattermost core team.
### Review Process for this Repo
......
.PHONY: build test run clean stop check-style run-unit emojis help
.PHONY: build test run clean stop check-style run-unit emojis help package-ci
BUILD_SERVER_DIR = ../mattermost-server
BUILD_WEBAPP_DIR = ../mattermost-webapp
MM_UTILITIES_DIR = ../mattermost-utilities
EMOJI_TOOLS_DIR = ./build/emoji
check-style: .npminstall ## Checks JS file for ESLint confirmity
check-style: node_modules ## Checks JS file for ESLint confirmity
@echo Checking for style guide compliance
npm run check
test: .npminstall ## Runs tests
test: node_modules ## Runs tests
@echo Running jest unit/component testing
npm run test
.npminstall: package.json package-lock.json
i18n-extract: ## Extract strings for translation from the source code
@[[ -d $(MM_UTILITIES_DIR) ]] || echo "You must clone github.com/mattermost/mattermost-utilities repo in .. to use this command"
@[[ -d $(MM_UTILITIES_DIR) ]] && cd $(MM_UTILITIES_DIR) && npm install && npm run babel && node mmjstool/build/index.js i18n extract-webapp
node_modules: package.json package-lock.json
@echo Getting dependencies using npm
npm install
cd node_modules/mattermost-redux; npm run build
touch $@
package: build ## Packages app
@echo Packaging webapp
......@@ -30,22 +33,36 @@ package: build ## Packages app
mv tmp/client dist
rmdir tmp
build: .npminstall ## Builds the app
package-ci: ## used in the CI to build the package and bypass the npm install
@echo Building mattermost Webapp
rm -rf dist
npm run build
@echo Packaging webapp
mkdir tmp
mv dist tmp/client
tar -C tmp -czf mattermost-webapp.tar.gz client
mv tmp/client dist
rmdir tmp
build: node_modules ## Builds the app
@echo Building mattermost Webapp
rm -rf dist
npm run build
run: .npminstall ## Runs app
run: node_modules ## Runs app
@echo Running mattermost Webapp for development
npm run run &
run-fullmap: .npminstall ## Runs the app with the JS mapped to source (good for debugger)
@echo FULL SOURCE MAP Running mattermost Webapp for development FULL SOURCE MAP
run-fullmap: node_modules ## Legacy alias to run
@echo Running mattermost Webapp for development
npm run run-fullmap &
npm run run &
stop: ## Stops webpack
@echo Stopping changes watching
......@@ -66,7 +83,52 @@ clean: ## Clears cached; deletes node_modules and dist directories
rm -rf dist
rm -rf node_modules
rm -f .npminstall
e2e: node_modules
@echo E2E: Running mattermost-mysql-e2e
@if [ $(shell docker ps -a | grep -ci mattermost-mysql-e2e) -eq 0 ]; then \
echo starting mattermost-mysql-e2e; \
docker run --name mattermost-mysql-e2e -p 35476:3306 -e MYSQL_ROOT_PASSWORD=mostest \
-e MYSQL_USER=mmuser -e MYSQL_PASSWORD=mostest -e MYSQL_DATABASE=mattermost_test -d mysql:5.7 > /dev/null; \
elif [ $(shell docker ps | grep -ci mattermost-mysql-e2e) -eq 0 ]; then \
echo restarting mattermost-mysql-e2e; \
docker start mattermost-mysql-e2e > /dev/null; \
fi
cd $(BUILD_SERVER_DIR) && [[ -f config/config.json ]] && \
cp config/config.json config/config-backup.json && cp config/default.json config/config.json || \
echo "config.json not found" && cp config/default.json config/config.json
@echo E2E: Starting the server
cd $(BUILD_SERVER_DIR) && $(MAKE) run
@echo E2E: Generating test data
cd $(BUILD_SERVER_DIR) && $(MAKE) test-data
@echo E2E: Running end-to-end testing
npm run cypress:run
@echo E2E: Stoppping the server
cd $(BUILD_SERVER_DIR) && $(MAKE) stop
@echo E2E: stopping mattermost-mysql-e2e
docker stop mattermost-mysql-e2e > /dev/null
cd $(BUILD_SERVER_DIR) && [[ -f config/config-backup.json ]] && \
cp config/config-backup.json config/config.json && echo "revert local config.json" || \
echo "config-backup.json not found" && sed -i'' -e 's|"DataSource": ".*"|"DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s"|g' config/config.json
@echo E2E: Tests completed
clean-e2e:
@if [ $(shell docker ps -a | grep -ci mattermost-mysql-e2e) -eq 1 ]; then \
echo stopping mattermost-mysql-e2e; \
docker stop mattermost-mysql-e2e > /dev/null; \
fi
cd $(BUILD_SERVER_DIR) && [[ -f config/config-backup.json ]] && \
cp config/config-backup.json config/config.json && echo "revert local config.json" || \
echo "config-backup.json not found" && sed -i'' -e 's|"DataSource": ".*"|"DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s"|g' config/config.json
emojis: ## Creates emoji JSX file and extracts emoji images from the system font
gem install bundler
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -13,6 +13,7 @@ When filling in a section please remove the help text and the above text.
- [ ] Ran `make check-style` to check for style errors (required for all pull requests)
- [ ] Ran `make test` to ensure unit and component tests passed
- [ ] Added or updated unit tests (required for all new features)
- [ ] Needs to be implemented in mobile (link to PR or User Story)
- [ ] Has server changes (please link)
- [ ] Has redux changes (please link)
- [ ] Has UI changes
......
......@@ -7,6 +7,7 @@ It's written in Golang and React and runs as a single Linux binary with MySQL or
This project hosts the webapp client code. Please file issues at [/mattermost-server](https://github.com/mattermost/mattermost-server), which hosts the server code.
- [Review product documentation](http://docs.mattermost.com/).
- [Review developer documentation](https://developers.mattermost.com/).
- [Download compiled version](https://mattermost.org/download).
Try out Mattermost:
......@@ -45,6 +46,6 @@ Get the Latest News:
- **Twitter** - Follow [MattermostHQ](https://twitter.com/mattermosthq)
- **Email** - Subscribe to our [newsletter](http://mattermost.us11.list-manage.com/subscribe?u=6cdba22349ae374e188e7ab8e&id=2add1c8034) (1 or 2 per month)
- **IRC** - Join us on #matterbridge (thanks to [matterircd](https://github.com/42wim/matterircd))
- **IRC** - Join the #matterbridge channel on [Freenode](https://freenode.net/) (thanks to [matterircd](https://github.com/42wim/matterircd))
Any other questions, mail us at info@mattermost.com. We'd love to meet you!
......@@ -3,9 +3,11 @@
import * as AdminActions from 'mattermost-redux/actions/admin';
import * as UserActions from 'mattermost-redux/actions/users';
import * as TeamActions from 'mattermost-redux/actions/teams';
import {Client4} from 'mattermost-redux/client';
import {bindClientFunc} from 'mattermost-redux/actions/helpers';
import {clientLogout} from 'actions/global_actions.jsx';
import {emitUserLoggedOutEvent} from 'actions/global_actions.jsx';
import {getOnNavigationConfirmed} from 'selectors/views/admin';
import store from 'stores/redux_store.jsx';
import {ActionTypes} from 'utils/constants.jsx';
......@@ -105,42 +107,18 @@ export async function samlCertificateStatus(success, error) {
}
}
export function getOAuthAppInfo(clientId, success, error) {
Client4.getOAuthAppInfo(clientId).then(
(data) => {
if (success) {
success(data);
}
}
).catch(
(err) => {
if (error) {
error(err);
}
}
);
export function getOAuthAppInfo(clientId) {
return bindClientFunc({
clientFunc: Client4.getOAuthAppInfo,
params: [clientId],
});
}
export function allowOAuth2(params, success, error) {
const responseType = params.get('response_type');
const clientId = params.get('client_id');
const redirectUri = params.get('redirect_uri');
const state = params.get('state');
const scope = params.get('scope');
Client4.authorizeOAuthApp(responseType, clientId, redirectUri, state, scope).then(