diff options
-rw-r--r-- | .travis.yml | 29 | ||||
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | docker/dev/Dockerfile | 7 | ||||
-rwxr-xr-x | docker/dev/Dockerrun.aws.json | 2 | ||||
-rw-r--r-- | docker/local/Dockerfile | 84 | ||||
-rwxr-xr-x | docker/local/Dockerrun.aws.json | 13 | ||||
-rw-r--r-- | docker/local/config_docker.json | 98 | ||||
-rwxr-xr-x | docker/local/docker-entry.sh | 116 | ||||
-rw-r--r-- | model/file.go | 4 | ||||
-rw-r--r-- | web/react/components/file_upload.jsx | 33 | ||||
-rw-r--r-- | web/react/components/invite_member_modal.jsx | 2 | ||||
-rw-r--r-- | web/react/components/view_image.jsx | 2 | ||||
-rw-r--r-- | web/react/utils/constants.jsx | 2 |
13 files changed, 361 insertions, 37 deletions
diff --git a/.travis.yml b/.travis.yml index 359de244e..b8a503714 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,10 +30,25 @@ addons: hosts: - 127.0.0.1 dockerhost deploy: - provider: releases - api_key: - secure: ma8Y0oimU+LB6LTAh8to2E1/ghaDPhcsAFXBrODsHpd4JgxA6HYoEwSEBCJFHSpu/JteclsxSTfp9hcuzw/IOtlwlSAiVoBZ60s24MRKTIAQNtrJ4QrX5wyfAZi+Bcuk/E8NynmoIW5qpaElSAdjgocyjAJIQ5ChMEztglL0cAEBXQRWbWMqSZ0hVLPrKDCIkWIyv3pFxqdLOxktkzxW07r2dlT0hppXR3dCaPJo0nelArS2H3LdN/3Iv6cAddfS27RaZkqDj/PDh6OZr4EguC99TxlVNChIr7nPr3/OiAssbkvEnhlSLeABFO9+7KfutL2WhAjpFXTjtPVq6Qalc8UW0K0gxq//sVfhb1MzjenmdOf06uB2bilQ8kgwHo7dDdRZBqqAtxQ6Q0Ht3SFMj6v/1zVD3s+YX/kWCEbUTHm6r2G/eF794ozcJyU+6j1L8hm6mvf8Mr9XCqBfgpZy6FCLX+9OKdMvX2jY8reo3Xz1PA9R6yzhN08vjku+jW+fsoYrBLd0fY1UGK2uOuvBByCeJzXupd3YpBMjEyRupVxqEj7K0GWOJeml65mkqKSNsHdDSeSjMpb8mwneZyTbdjsxCFQRLcLgpAajFrkk4G2Yz3KfhXSo29XKEGX+EbY5NuP8KmDsBsguPI0zfwv/co0hAY8PIIcehxcdoR9Vb2c= - file: dist/mattermost.tar.gz - skip_cleanup: true - on: - tags: true + - provider: releases + api_key: + secure: ma8Y0oimU+LB6LTAh8to2E1/ghaDPhcsAFXBrODsHpd4JgxA6HYoEwSEBCJFHSpu/JteclsxSTfp9hcuzw/IOtlwlSAiVoBZ60s24MRKTIAQNtrJ4QrX5wyfAZi+Bcuk/E8NynmoIW5qpaElSAdjgocyjAJIQ5ChMEztglL0cAEBXQRWbWMqSZ0hVLPrKDCIkWIyv3pFxqdLOxktkzxW07r2dlT0hppXR3dCaPJo0nelArS2H3LdN/3Iv6cAddfS27RaZkqDj/PDh6OZr4EguC99TxlVNChIr7nPr3/OiAssbkvEnhlSLeABFO9+7KfutL2WhAjpFXTjtPVq6Qalc8UW0K0gxq//sVfhb1MzjenmdOf06uB2bilQ8kgwHo7dDdRZBqqAtxQ6Q0Ht3SFMj6v/1zVD3s+YX/kWCEbUTHm6r2G/eF794ozcJyU+6j1L8hm6mvf8Mr9XCqBfgpZy6FCLX+9OKdMvX2jY8reo3Xz1PA9R6yzhN08vjku+jW+fsoYrBLd0fY1UGK2uOuvBByCeJzXupd3YpBMjEyRupVxqEj7K0GWOJeml65mkqKSNsHdDSeSjMpb8mwneZyTbdjsxCFQRLcLgpAajFrkk4G2Yz3KfhXSo29XKEGX+EbY5NuP8KmDsBsguPI0zfwv/co0hAY8PIIcehxcdoR9Vb2c= + file: dist/mattermost.tar.gz + skip_cleanup: true + on: + repo: mattermost/platform + tags: true + + - provider: s3 + access_key_id: AKIAJCO3KJYEGWJIKDIQ + secret_access_key: + secure: p66X2tJBmKgtcVyPtGgkAwW29IiRojqGA39RjCJkIWNTJ0e/9JvBOiMS2c4a7I4aOads38rsthwdaigBWagDWNH7bGsEZN7B0TszZuFAuU+XGjU5A66MIOfFfzbUg8AnByysr+XG5/bknFIrP/XhM2fbRr6gbYrFUK7TNkpgjFs5u3BzUrz2iTAV8uOpSJqKSnaf0pTZk1EywOK/X8W8ViIjc7Di3FzQcqIW9K3D27N+3rVsv8SRT1hWASVlnG6aThqqebiM8FCGCzAYVgQb3h3Wu8JT5fIz7Qo7A6siVRwNBwWwzP8HkGoinEK32Wsj/fDXk27vjpFQO/+9sV0xfcTbIZA6MnuYWF4rHOT59KcshCWCD3V0FopX57p/dtOzM9+6lxIctAT++izxWoZit/5c5A4633iY1d+RMeTko1POix6MSlxPMRHZUFwSXROgFuWWRpyD6TlUTCST9/wTTd0WDPklAAiYcnuEPW3qCnw0r0xkrA4AwWUXqXdAIwDt5bA27KcjRyY4Fofv9NxH09BNuBTXNPrvnYPZMmaKrv+HOX3NFTreuV6+5LJdhYUxYSBvSWo1jeWIQ5Q9RUdTU0PqmKpMhJKbKey/S4gxCXHg2HR8DwLCcbIZcvneF9yPEAT71YA6zpLKoPVSwWwH97huKSzjpic/RUfFXQOcgCQ= + bucket: mattermost-travis-master + local_dir: dist + acl: public_read + region: us-east-1 + skip_cleanup: true + detect_encoding: true + on: + repo: mattermost/platform + branch: master @@ -245,10 +245,8 @@ dist: install tar -C dist -czf $(DIST_PATH).tar.gz mattermost -docker-build: stop dist - cp $(DIST_PATH).tar.gz docker/dev - cd docker/dev && docker build -t ${DOCKERNAME} . - rm docker/dev/mattermost.tar.gz +docker-build: stop + docker build -t ${DOCKERNAME} -f docker/local/Dockerfile . docker-run: docker-build docker run --name ${DOCKER_CONTAINER_NAME} -d --publish 8065:80 ${DOCKERNAME} diff --git a/docker/dev/Dockerfile b/docker/dev/Dockerfile index a684ac10d..cdfdc1845 100644 --- a/docker/dev/Dockerfile +++ b/docker/dev/Dockerfile @@ -13,8 +13,6 @@ ENV MYSQL_DATABASE=mattermost_test RUN groupadd -r mysql && useradd -r -g mysql mysql -RUN apt-get update && apt-get install -y perl --no-install-recommends && rm -rf /var/lib/apt/lists/* - RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5 ENV MYSQL_MAJOR 5.6 @@ -24,7 +22,7 @@ RUN echo "deb http://repo.mysql.com/apt/debian/ wheezy mysql-${MYSQL_MAJOR}" > / RUN apt-get update \ && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install mysql-server \ + && apt-get -y install perl wget mysql-server \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql @@ -36,7 +34,8 @@ VOLUME /var/lib/mysql WORKDIR /mattermost # Copy over files -ADD mattermost.tar.gz / +RUN wget --no-check-certificate https://s3.amazonaws.com/mattermost-travis-master/mattermost.tar.gz +RUN tar -zxvf mattermost.tar.gz --strip-components=1 && rm mattermost.tar.gz ADD config_docker.json / ADD docker-entry.sh / diff --git a/docker/dev/Dockerrun.aws.json b/docker/dev/Dockerrun.aws.json index 9f69f1fb1..ae847ef80 100755 --- a/docker/dev/Dockerrun.aws.json +++ b/docker/dev/Dockerrun.aws.json @@ -1,7 +1,7 @@ {
"AWSEBDockerrunVersion": "1",
"Image": {
- "Name": "YOUR_DEV_INSTANCE_HERE",
+ "Name": "mattermost/platform:dev",
"Update": "true"
},
"Ports": [
diff --git a/docker/local/Dockerfile b/docker/local/Dockerfile new file mode 100644 index 000000000..55725e293 --- /dev/null +++ b/docker/local/Dockerfile @@ -0,0 +1,84 @@ +# Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +# See License.txt for license information. +FROM ubuntu:14.04 + +# Install Dependancies +RUN apt-get update && apt-get install -y build-essential +RUN apt-get install -y curl +RUN curl -sL https://deb.nodesource.com/setup | bash - +RUN apt-get install -y nodejs +RUN apt-get install -y ruby-full +RUN gem install compass + +# +# Install GO +# + +RUN apt-get update && apt-get install -y \ + gcc libc6-dev make git mercurial \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +ENV GOLANG_VERSION 1.4.2 + +RUN curl -sSL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz \ + | tar -v -C /usr/src -xz + +RUN cd /usr/src/go/src && ./make.bash --no-clean 2>&1 + +ENV PATH /usr/src/go/bin:$PATH + +RUN mkdir -p /go/src /go/bin && chmod -R 777 /go +ENV GOPATH /go +ENV PATH /go/bin:$PATH +WORKDIR /go + +# --------------------------------------------------------------------------------------------------------------------- + +# +# Install SQL +# + +ENV MYSQL_ROOT_PASSWORD=mostest +ENV MYSQL_USER=mmuser +ENV MYSQL_PASSWORD=mostest +ENV MYSQL_DATABASE=mattermost_test + +RUN groupadd -r mysql && useradd -r -g mysql mysql + +RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5 + +ENV MYSQL_MAJOR 5.6 +ENV MYSQL_VERSION 5.6.25 + +RUN echo "deb http://repo.mysql.com/apt/debian/ wheezy mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list + +RUN apt-get update \ + && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install perl mysql-server \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql + +RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf + +VOLUME /var/lib/mysql +# --------------------------------------------------------------------------------------------------------------------- + +# Copy over files +ADD . /go/src/github.com/mattermost/platform + +RUN go get github.com/tools/godep +RUN cd /go/src/github.com/mattermost/platform/; godep go install +RUN cd /go/src/github.com/mattermost/platform/web/react; npm install + +ADD /docker/local/config_docker.json / +ADD /docker/local/docker-entry.sh / + +RUN chmod +x /docker-entry.sh +ENTRYPOINT /docker-entry.sh + +# Create default storage directory +RUN mkdir /mattermost-data/ + +# Ports +EXPOSE 80 diff --git a/docker/local/Dockerrun.aws.json b/docker/local/Dockerrun.aws.json new file mode 100755 index 000000000..9f69f1fb1 --- /dev/null +++ b/docker/local/Dockerrun.aws.json @@ -0,0 +1,13 @@ +{
+ "AWSEBDockerrunVersion": "1",
+ "Image": {
+ "Name": "YOUR_DEV_INSTANCE_HERE",
+ "Update": "true"
+ },
+ "Ports": [
+ {
+ "ContainerPort": "80"
+ }
+ ],
+ "Logging": "/var/log/"
+}
diff --git a/docker/local/config_docker.json b/docker/local/config_docker.json new file mode 100644 index 000000000..cd612c7fe --- /dev/null +++ b/docker/local/config_docker.json @@ -0,0 +1,98 @@ +{ + "LogSettings": { + "ConsoleEnable": true, + "ConsoleLevel": "INFO", + "FileEnable": true, + "FileLevel": "INFO", + "FileFormat": "", + "FileLocation": "" + }, + "ServiceSettings": { + "SiteName": "Mattermost", + "Mode" : "dev", + "AllowTesting" : true, + "UseSSL": false, + "Port": "80", + "Version": "developer", + "Shards": { + }, + "InviteSalt": "gxHVDcKUyP2y1eiyW8S8na1UYQAfq6J6", + "PublicLinkSalt": "TO3pTyXIZzwHiwyZgGql7lM7DG3zeId4", + "ResetSalt": "IPxFzSfnDFsNsRafZxz8NaYqFKhf9y2t", + "AnalyticsUrl": "", + "UseLocalStorage": true, + "StorageDirectory": "/mattermost/data/", + "AllowedLoginAttempts": 10 + }, + "SSOSettings": { + "gitlab": { + "Allow": false, + "Secret" : "", + "Id": "", + "AuthEndpoint": "", + "TokenEndpoint": "", + "UserApiEndpoint": "" + } + }, + "SqlSettings": { + "DriverName": "mysql", + "DataSource": "mmuser:mostest@tcp(localhost:3306)/mattermost_test?charset=utf8mb4,utf8", + "DataSourceReplicas": ["mmuser:mostest@tcp(localhost:3306)/mattermost_test?charset=utf8mb4,utf8"], + "MaxIdleConns": 10, + "MaxOpenConns": 10, + "Trace": false, + "AtRestEncryptKey": "Ya0xMrybACJ3sZZVWQC7e31h5nSDWZFS" + }, + "AWSSettings": { + "S3AccessKeyId": "", + "S3SecretAccessKey": "", + "S3Bucket": "", + "S3Region": "" + }, + "ImageSettings": { + "ThumbnailWidth": 120, + "ThumbnailHeight": 100, + "PreviewWidth": 1024, + "PreviewHeight": 0, + "ProfileWidth": 128, + "ProfileHeight": 128, + "InitialFont": "luximbi.ttf" + }, + "EmailSettings": { + "ByPassEmail" : true, + "SMTPUsername": "", + "SMTPPassword": "", + "SMTPServer": "", + "UseTLS": false, + "FeedbackEmail": "", + "FeedbackName": "", + "ApplePushServer": "", + "ApplePushCertPublic": "", + "ApplePushCertPrivate": "" + }, + "RateLimitSettings": { + "UseRateLimiter": true, + "PerSec": 10, + "MemoryStoreSize": 10000, + "VaryByRemoteAddr": true, + "VaryByHeader": "" + }, + "PrivacySettings": { + "ShowEmailAddress": true, + "ShowPhoneNumber": true, + "ShowSkypeId": true, + "ShowFullName": true + }, + "TeamSettings": { + "MaxUsersPerTeam": 150, + "AllowPublicLink": true, + "AllowValetDefault": false, + "TermsLink": "/static/help/configure_links.html", + "PrivacyLink": "/static/help/configure_links.html", + "AboutLink": "/static/help/configure_links.html", + "HelpLink": "/static/help/configure_links.html", + "ReportProblemLink": "/static/help/configure_links.html", + "TourLink": "/static/help/configure_links.html", + "DefaultThemeColor": "#2389D7" + } +} diff --git a/docker/local/docker-entry.sh b/docker/local/docker-entry.sh new file mode 100755 index 000000000..16583e525 --- /dev/null +++ b/docker/local/docker-entry.sh @@ -0,0 +1,116 @@ +#!/bin/bash +# Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +# See License.txt for license information. + +mkdir -p web/static/js + +echo "127.0.0.1 dockerhost" >> /etc/hosts +/etc/init.d/networking restart + +echo configuring mysql + +# SQL!!! +set -e + +get_option () { + local section=$1 + local option=$2 + local default=$3 + ret=$(my_print_defaults $section | grep '^--'${option}'=' | cut -d= -f2-) + [ -z $ret ] && ret=$default + echo $ret +} + + +# Get config +DATADIR="$("mysqld" --verbose --help 2>/dev/null | awk '$1 == "datadir" { print $2; exit }')" +SOCKET=$(get_option mysqld socket "$DATADIR/mysql.sock") +PIDFILE=$(get_option mysqld pid-file "/var/run/mysqld/mysqld.pid") + +if [ ! -d "$DATADIR/mysql" ]; then + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" ]; then + echo >&2 'error: database is uninitialized and MYSQL_ROOT_PASSWORD not set' + echo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?' + exit 1 + fi + + mkdir -p "$DATADIR" + chown -R mysql:mysql "$DATADIR" + + echo 'Running mysql_install_db' + mysql_install_db --user=mysql --datadir="$DATADIR" --rpm --keep-my-cnf + echo 'Finished mysql_install_db' + + mysqld --user=mysql --datadir="$DATADIR" --skip-networking & + for i in $(seq 30 -1 0); do + [ -S "$SOCKET" ] && break + echo 'MySQL init process in progress...' + sleep 1 + done + if [ $i = 0 ]; then + echo >&2 'MySQL init process failed.' + exit 1 + fi + + # These statements _must_ be on individual lines, and _must_ end with + # semicolons (no line breaks or comments are permitted). + # TODO proper SQL escaping on ALL the things D: + + tempSqlFile=$(mktemp /tmp/mysql-first-time.XXXXXX.sql) + cat > "$tempSqlFile" <<-EOSQL + -- What's done in this file shouldn't be replicated + -- or products like mysql-fabric won't work + SET @@SESSION.SQL_LOG_BIN=0; + + DELETE FROM mysql.user ; + CREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ; + GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ; + DROP DATABASE IF EXISTS test ; + EOSQL + + if [ "$MYSQL_DATABASE" ]; then + echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" >> "$tempSqlFile" + fi + + if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then + echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" >> "$tempSqlFile" + + if [ "$MYSQL_DATABASE" ]; then + echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" >> "$tempSqlFile" + fi + fi + + echo 'FLUSH PRIVILEGES ;' >> "$tempSqlFile" + + mysql -uroot < "$tempSqlFile" + + rm -f "$tempSqlFile" + kill $(cat $PIDFILE) + for i in $(seq 30 -1 0); do + [ -f "$PIDFILE" ] || break + echo 'MySQL init process in progress...' + sleep 1 + done + if [ $i = 0 ]; then + echo >&2 'MySQL hangs during init process.' + exit 1 + fi + echo 'MySQL init process done. Ready for start up.' +fi + +chown -R mysql:mysql "$DATADIR" + +mysqld & + +sleep 5 + +# ------------------------ + +echo starting react processor +cd /go/src/github.com/mattermost/platform/web/react && npm start & + +echo starting go web server +cd /go/src/github.com/mattermost/platform/; godep go run mattermost.go -config=/config_docker.json & + +echo starting compass watch +cd /go/src/github.com/mattermost/platform/web/sass-files && compass watch diff --git a/model/file.go b/model/file.go index 3d38ddbd1..85545d718 100644 --- a/model/file.go +++ b/model/file.go @@ -13,8 +13,8 @@ const ( ) var ( - IMAGE_EXTENSIONS = [4]string{".jpg", ".gif", ".bmp", ".png"} - IMAGE_MIME_TYPES = map[string]string{".jpg": "image/jpeg", ".gif": "image/gif", ".bmp": "image/bmp", ".png": "image/png", ".tiff": "image/tiff"} + IMAGE_EXTENSIONS = [5]string{".jpg", ".jpeg", ".gif", ".bmp", ".png"} + IMAGE_MIME_TYPES = map[string]string{".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".gif": "image/gif", ".bmp": "image/bmp", ".png": "image/png", ".tiff": "image/tiff"} ) type FileUploadResponse struct { diff --git a/web/react/components/file_upload.jsx b/web/react/components/file_upload.jsx index b90fa4fd3..c1fab669c 100644 --- a/web/react/components/file_upload.jsx +++ b/web/react/components/file_upload.jsx @@ -7,6 +7,13 @@ var ChannelStore = require('../stores/channel_store.jsx'); var utils = require('../utils/utils.jsx'); module.exports = React.createClass({ + displayName: 'FileUpload', + propTypes: { + onUploadError: React.PropTypes.func, + getFileCount: React.PropTypes.func, + onFileUpload: React.PropTypes.func, + onUploadStart: React.PropTypes.func + }, getInitialState: function() { return {requests: {}}; }, @@ -21,7 +28,7 @@ module.exports = React.createClass({ // This looks redundant, but must be done this way due to // setState being an asynchronous call var numFiles = 0; - for(var i = 0; i < files.length; i++) { + for (var i = 0; i < files.length; i++) { if (files[i].size <= Constants.MAX_FILE_SIZE) { numFiles++; } @@ -51,11 +58,11 @@ module.exports = React.createClass({ var request = client.uploadFile(formData, function(data) { var parsedData = $.parseJSON(data); - this.props.onFileUpload(parsedData['filenames'], parsedData['client_ids'], channelId); + this.props.onFileUpload(parsedData.filenames, parsedData.client_ids, channelId); var requests = this.state.requests; - for (var i = 0; i < parsedData['client_ids'].length; i++) { - delete requests[parsedData['client_ids'][i]]; + for (var i = 0; i < parsedData.client_ids.length; i++) { + delete requests[parsedData.client_ids[i]]; } this.setState({requests: requests}); }.bind(this), @@ -100,12 +107,9 @@ module.exports = React.createClass({ if (items) { for (var i = 0; i < items.length; i++) { if (items[i].type.indexOf('image') !== -1) { - var ext = items[i].type.split('/')[1].toLowerCase(); - if (ext === 'jpeg') { - ext = 'jpg'; - } + var testExt = items[i].type.split('/')[1].toLowerCase(); - if (Constants.IMAGE_TYPES.indexOf(ext) < 0) { + if (Constants.IMAGE_TYPES.indexOf(testExt) < 0) { continue; } @@ -113,7 +117,7 @@ module.exports = React.createClass({ } } - var numToUpload = Math.min(Constants.MAX_UPLOAD_FILES - self.props.getFileCount(channelId), numItems); + var numToUpload = Math.min(Constants.MAX_UPLOAD_FILES - self.props.getFileCount(ChannelStore.getCurrentId()), numItems); if (numItems > numToUpload) { self.props.onUploadError('Uploads limited to ' + Constants.MAX_UPLOAD_FILES + ' files maximum. Please use additional posts for more files.'); @@ -124,9 +128,6 @@ module.exports = React.createClass({ var file = items[i].getAsFile(); var ext = items[i].type.split('/')[1].toLowerCase(); - if (ext === 'jpeg') { - ext = 'jpg'; - } if (Constants.IMAGE_TYPES.indexOf(ext) < 0) { continue; @@ -161,11 +162,11 @@ module.exports = React.createClass({ var request = client.uploadFile(formData, function(data) { var parsedData = $.parseJSON(data); - self.props.onFileUpload(parsedData['filenames'], parsedData['client_ids'], channelId); + self.props.onFileUpload(parsedData.filenames, parsedData.client_ids, channelId); var requests = self.state.requests; - for (var i = 0; i < parsedData['client_ids'].length; i++) { - delete requests[parsedData['client_ids'][i]]; + for (var i = 0; i < parsedData.client_ids.length; i++) { + delete requests[parsedData.client_ids[i]]; } self.setState({requests: requests}); }, diff --git a/web/react/components/invite_member_modal.jsx b/web/react/components/invite_member_modal.jsx index 3eca79bae..75538c8fe 100644 --- a/web/react/components/invite_member_modal.jsx +++ b/web/react/components/invite_member_modal.jsx @@ -256,7 +256,7 @@ module.exports = React.createClass({ parent_id='invite_member' title='Discard Invitations?' message='You have unsent invitations, are you sure you want to discard them?' - confirm_button='Yes, Discard/' + confirm_button='Yes, Discard' /> </div> ); diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx index 20a02b595..2b7f64030 100644 --- a/web/react/components/view_image.jsx +++ b/web/react/components/view_image.jsx @@ -273,7 +273,7 @@ module.exports = React.createClass({ <div className='modal-close' data-dismiss='modal'></div> {content} <div ref='imageFooter' className='modal-button-bar'> - <span className='pull-left text'>{'Image ' + (this.state.imgId + 1) + ' of ' + this.props.filenames.length}</span> + <span className='pull-left text'>{'File ' + (this.state.imgId + 1) + ' of ' + this.props.filenames.length}</span> <div className='image-links'> {publicLink} <a href={fileUrl} download={name} className='text'>Download</a> diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx index bed0ec556..505f7fa17 100644 --- a/web/react/utils/constants.jsx +++ b/web/react/utils/constants.jsx @@ -38,7 +38,7 @@ module.exports = { }), SPECIAL_MENTIONS: ['all', 'channel'], CHARACTER_LIMIT: 4000, - IMAGE_TYPES: ['jpg', 'gif', 'bmp', 'png'], + IMAGE_TYPES: ['jpg', 'gif', 'bmp', 'png', 'jpeg'], AUDIO_TYPES: ['mp3', 'wav', 'wma', 'm4a', 'flac', 'aac'], VIDEO_TYPES: ['mp4', 'avi', 'webm', 'mkv', 'wmv', 'mpg', 'mov', 'flv'], SPREADSHEET_TYPES: ['ppt', 'pptx', 'csv'], |