diff options
-rw-r--r-- | Makefile | 48 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | i18n/en.json | 2 | ||||
-rw-r--r-- | web/react/components/audit_table.jsx | 66 | ||||
-rw-r--r-- | web/react/utils/utils.jsx | 28 | ||||
-rw-r--r-- | web/static/i18n/en.json | 5 |
6 files changed, 107 insertions, 44 deletions
@@ -1,4 +1,4 @@ -.PHONY: all dist dist-local dist-travis start-docker build-server package build-client test travis-init build-container stop-docker clean-docker clean nuke run stop setup-mac cleandb docker-build docker-run +.PHONY: all dist dist-local dist-travis start-docker build-server package build-client test travis-init build-container stop-docker clean-docker clean nuke run run-client run-server stop stop-client stop-server setup-mac cleandb docker-build docker-run restart-server GOPATH ?= $(GOPATH:) GOFLAGS ?= $(GOFLAGS:) @@ -263,7 +263,13 @@ nuke: | clean clean-docker touch $@ -run: start-docker .prepare-go .prepare-jsx +run: start-docker run-server run-client + +run-server: .prepare-go + @echo Starting go web server + $(GO) run $(GOFLAGS) mattermost.go -config=config.json & + +run-client: .prepare-jsx mkdir -p web/static/js @echo Starting react processo @@ -279,13 +285,23 @@ run: start-docker .prepare-go .prepare-jsx sed -i'.bak' 's|_BUILD_ENTERPRISE_READY_|false|g' ./model/version.go; \ fi - @echo Starting go web server - $(GO) run $(GOFLAGS) mattermost.go -config=config.json & - @echo Starting compass watch cd web/sass-files && compass compile && compass watch & -stop: +stop: stop-client stop-server + @if [ $(shell docker ps -a | grep -ci ${DOCKER_CONTAINER_NAME}) -eq 1 ]; then \ + echo removing dev docker container; \ + docker stop ${DOCKER_CONTAINER_NAME} > /dev/null; \ + docker rm -v ${DOCKER_CONTAINER_NAME} > /dev/null; \ + fi + + @if [ "$(BUILD_ENTERPRISE)" = "true" ] && [ -d "$(ENTERPRISE_DIR)" ]; then \ + mv ./config/config.json.bak ./config/config.json 2> /dev/null || true; \ + mv ./mattermost.go.bak ./mattermost.go 2> /dev/null || true; \ + mv ./model/version.go.bak ./model/version.go 2> /dev/null || true; \ + fi + +stop-client: @for PID in $$(ps -ef | grep [c]ompass | awk '{ print $$2 }'); do \ echo stopping css watch $$PID; \ kill $$PID; \ @@ -296,22 +312,18 @@ stop: kill $$PID; \ done - @for PID in $$(ps -ef | grep [m]atterm | grep -v VirtualBox | awk '{ print $$2 }'); do \ - echo stopping go web $$PID; \ +stop-server: + @for PID in $$(ps -ef | grep "go run [m]attermost.go" | awk '{ print $$2 }'); do \ + echo stopping go $$PID; \ kill $$PID; \ done - @if [ $(shell docker ps -a | grep -ci ${DOCKER_CONTAINER_NAME}) -eq 1 ]; then \ - echo removing dev docker container; \ - docker stop ${DOCKER_CONTAINER_NAME} > /dev/null; \ - docker rm -v ${DOCKER_CONTAINER_NAME} > /dev/null; \ - fi + @for PID in $$(ps -ef | grep "go-build.*/[m]attermost" | awk '{ print $$2 }'); do \ + echo stopping mattermost $$PID; \ + kill $$PID; \ + done - @if [ "$(BUILD_ENTERPRISE)" = "true" ] && [ -d "$(ENTERPRISE_DIR)" ]; then \ - mv ./config/config.json.bak ./config/config.json 2> /dev/null || true; \ - mv ./mattermost.go.bak ./mattermost.go 2> /dev/null || true; \ - mv ./model/version.go.bak ./model/version.go 2> /dev/null || true; \ - fi +restart-server: stop-server run-server setup-mac: echo $$(boot2docker ip 2> /dev/null) dockerhost | sudo tee -a /etc/hosts @@ -41,7 +41,7 @@ Please see the [features pages of the Mattermost website](http://www.mattermost. - [Feature Ideas Forum](http://www.mattermost.org/feature-requests/) - For sharing ideas for future versions - [Contribution Guidelines](https://github.com/mattermost/platform/blob/master/CONTRIBUTING.md) - For contributing code or feedback to the project -Follow us on Twitter at [@MattermostHQ](https://twitter.com/mattermosthq), or talk to the core team on our [daily builds server](https://pre-release.mattermost.com/core) via [this invite link](https://pre-release.mattermost.com/signup_user_complete/?id=rcgiyftm7jyrxnma1osd8zswby). +Follow us on Twitter at [@MattermostHQ](https://twitter.com/mattermosthq), or talk to the core team by creating an account on our [daily builds server](https://pre-release.mattermost.com/core). ## Installing Mattermost diff --git a/i18n/en.json b/i18n/en.json index 3b204f250..f45f65526 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1165,7 +1165,7 @@ }, { "id": "api.templates.password_change_body.title", - "translation": "You updated your password" + "translation": "Your password has been updated" }, { "id": "api.templates.password_change_subject", diff --git a/web/react/components/audit_table.jsx b/web/react/components/audit_table.jsx index 49892ff98..31d04f19b 100644 --- a/web/react/components/audit_table.jsx +++ b/web/react/components/audit_table.jsx @@ -183,6 +183,26 @@ const holders = defineMessages({ loginFailure: { id: 'audit_table.loginFailure', defaultMessage: ' (Login failure)' + }, + attemptedLicenseAdd: { + id: 'audit_table.attemptedLicenseAdd', + defaultMessage: 'Attempted to add new license' + }, + successfullLicenseAdd: { + id: 'audit_table.successfullLicenseAdd', + defaultMessage: 'Successfully added new license' + }, + failedExpiredLicenseAdd: { + id: 'audit_table.failedExpiredLicenseAdd', + defaultMessage: 'Failed to add a new license as it has either expired or not yet been started' + }, + failedInvalidLicenseAdd: { + id: 'audit_table.failedInvalidLicenseAdd', + defaultMessage: 'Failed to add an invalid license' + }, + licenseRemoved: { + id: 'audit_table.licenseRemoved', + defaultMessage: 'Successfully removed a license' } }); @@ -327,17 +347,17 @@ export function formatAuditInfo(audit, formatMessage) { switch (actionURL) { case '/channels/create': - auditDesc = formatMessage(holders.channelCreated, {channelName: channelName}); + auditDesc = formatMessage(holders.channelCreated, {channelName}); break; case '/channels/create_direct': auditDesc = formatMessage(holders.establishedDM, {username: Utils.getDirectTeammate(channelObj.id).username}); break; case '/channels/update': - auditDesc = formatMessage(holders.nameUpdated, {channelName: channelName}); + auditDesc = formatMessage(holders.nameUpdated, {channelName}); break; case '/channels/update_desc': // support the old path case '/channels/update_header': - auditDesc = formatMessage(holders.headerUpdated, {channelName: channelName}); + auditDesc = formatMessage(holders.headerUpdated, {channelName}); break; default: { let userIdField = []; @@ -356,9 +376,9 @@ export function formatAuditInfo(audit, formatMessage) { if (/\/channels\/[A-Za-z0-9]+\/delete/.test(actionURL)) { auditDesc = formatMessage(holders.channelDeleted, {url: channelURL}); } else if (/\/channels\/[A-Za-z0-9]+\/add/.test(actionURL)) { - auditDesc = formatMessage(holders.userAdded, {username: username, channelName: channelName}); + auditDesc = formatMessage(holders.userAdded, {username, channelName}); } else if (/\/channels\/[A-Za-z0-9]+\/remove/.test(actionURL)) { - auditDesc = formatMessage(holders.userRemoved, {username: username, channelName: channelName}); + auditDesc = formatMessage(holders.userRemoved, {username, channelName}); } break; @@ -495,25 +515,25 @@ export function formatAuditInfo(audit, formatMessage) { break; } } else if (actionURL.indexOf('/hooks') === 0) { - const webhookInfo = audit.extra_info.split(' '); + const webhookInfo = audit.extra_info; switch (actionURL) { case '/hooks/incoming/create': - if (webhookInfo[0] === 'attempt') { + if (webhookInfo === 'attempt') { auditDesc = formatMessage(holders.attemptedWebhookCreate); - } else if (webhookInfo[0] === 'success') { + } else if (webhookInfo === 'success') { auditDesc = formatMessage(holders.succcessfullWebhookCreate); - } else if (webhookInfo[0] === 'fail - bad channel permissions') { + } else if (webhookInfo === 'fail - bad channel permissions') { auditDesc = formatMessage(holders.failedWebhookCreate); } break; case '/hooks/incoming/delete': - if (webhookInfo[0] === 'attempt') { + if (webhookInfo === 'attempt') { auditDesc = formatMessage(holders.attemptedWebhookDelete); - } else if (webhookInfo[0] === 'success') { + } else if (webhookInfo === 'success') { auditDesc = formatMessage(holders.successfullWebhookDelete); - } else if (webhookInfo[0] === 'fail - inappropriate conditions') { + } else if (webhookInfo === 'fail - inappropriate conditions') { auditDesc = formatMessage(holders.failedWebhookDelete); } @@ -521,6 +541,28 @@ export function formatAuditInfo(audit, formatMessage) { default: break; } + } else if (actionURL.indexOf('/license') === 0) { + const licenseInfo = audit.extra_info; + + switch (actionURL) { + case '/license/add': + if (licenseInfo === 'attempt') { + auditDesc = formatMessage(holders.attemptedLicenseAdd); + } else if (licenseInfo === 'success') { + auditDesc = formatMessage(holders.successfullLicenseAdd); + } else if (licenseInfo === 'failed - expired or non-started license') { + auditDesc = formatMessage(holders.failedExpiredLicenseAdd); + } else if (licenseInfo === 'failed - invalid license') { + auditDesc = formatMessage(holders.failedInvalidLicenseAdd); + } + + break; + case '/license/remove': + auditDesc = formatMessage(holders.licenseRemoved); + break; + default: + break; + } } else { switch (actionURL) { case '/logout': diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index bdf68fc03..2b946d81f 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -160,18 +160,22 @@ export function notifyMe(title, body, channel) { } if (permission === 'granted') { - var notification = new Notification(title, {body, tag: body, icon: '/static/images/icon50x50.png'}); - notification.onclick = () => { - window.focus(); - if (channel) { - switchChannel(channel); - } else { - window.location.href = TeamStore.getCurrentTeamUrl() + '/channels/town-square'; - } - }; - setTimeout(() => { - notification.close(); - }, 5000); + try { + var notification = new Notification(title, {body, tag: body, icon: '/static/images/icon50x50.png'}); + notification.onclick = () => { + window.focus(); + if (channel) { + switchChannel(channel); + } else { + window.location.href = TeamStore.getCurrentTeamUrl() + '/channels/town-square'; + } + }; + setTimeout(() => { + notification.close(); + }, 5000); + } catch (e) { + console.error(e); //eslint-disable-line no-console + } } }); } diff --git a/web/static/i18n/en.json b/web/static/i18n/en.json index d980885a3..ec5ef599c 100644 --- a/web/static/i18n/en.json +++ b/web/static/i18n/en.json @@ -485,6 +485,11 @@ "audit_table.revokedAll": "Revoked all current sessions for the team", "audit_table.loginAttempt": " (Login attempt)", "audit_table.loginFailure": " (Login failure)", + "audit_table.attemptedLicenseAdd": "Attempted to add new license", + "audit_table.successfullLicenseAdd": "Successfully added new license", + "audit_table.failedExpiredLicenseAdd": "Failed to add a new license as it has either expired or not yet been started", + "audit_table.failedInvalidLicenseAdd": "Failed to add an invalid license", + "audit_table.licenseRemoved": "Successfully removed a license", "audit_table.userId": "User ID", "audit_table.ip": "IP Address", "audit_table.session": "Session ID", |