summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Godeps/Godeps.json2
-rw-r--r--Godeps/_workspace/src/github.com/nfnt/resize/converter.go6
-rw-r--r--Godeps/_workspace/src/github.com/nfnt/resize/resize.go4
-rw-r--r--Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go96
-rw-r--r--Makefile54
-rw-r--r--README.md6
-rw-r--r--api/channel.go5
-rw-r--r--api/file.go4
-rw-r--r--model/message.go1
-rw-r--r--model/session.go4
-rw-r--r--store/sql_channel_store.go2
-rw-r--r--store/sql_post_store.go12
-rw-r--r--store/sql_user_store.go2
-rw-r--r--utils/mail.go2
-rw-r--r--web/react/components/activity_log_modal.jsx3
-rw-r--r--web/react/components/create_post.jsx4
-rw-r--r--web/react/components/edit_channel_modal.jsx7
-rw-r--r--web/react/components/removed_from_channel_modal.jsx64
-rw-r--r--web/react/components/rename_channel_modal.jsx7
-rw-r--r--web/react/components/rename_team_modal.jsx11
-rw-r--r--web/react/components/sidebar.jsx14
-rw-r--r--web/react/components/signup_user_complete.jsx11
-rw-r--r--web/react/components/textbox.jsx37
-rw-r--r--web/react/components/user_settings.jsx52
-rw-r--r--web/react/pages/channel.jsx6
-rw-r--r--web/sass-files/sass/partials/_activity-log.scss3
-rw-r--r--web/sass-files/sass/partials/_signup.scss78
-rw-r--r--web/static/images/gitlabLogo.pngbin0 -> 3306 bytes
-rw-r--r--web/templates/channel.html1
29 files changed, 388 insertions, 110 deletions
diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
index 8b30d0478..86ed9e0cf 100644
--- a/Godeps/Godeps.json
+++ b/Godeps/Godeps.json
@@ -100,7 +100,7 @@
},
{
"ImportPath": "github.com/nfnt/resize",
- "Rev": "f2d1b73023c55bdfb4fa2ed385d2bec95bce3692"
+ "Rev": "dc93e1b98c579d90ee2fa15c1fd6dac34f6e7899"
},
{
"ImportPath": "github.com/stretchr/objx",
diff --git a/Godeps/_workspace/src/github.com/nfnt/resize/converter.go b/Godeps/_workspace/src/github.com/nfnt/resize/converter.go
index 84bd284ba..b3dd06b8d 100644
--- a/Godeps/_workspace/src/github.com/nfnt/resize/converter.go
+++ b/Godeps/_workspace/src/github.com/nfnt/resize/converter.go
@@ -131,11 +131,11 @@ func resizeRGBA(in *image.RGBA, out *image.NRGBA, scale float64, coeffs []int16,
// reverse alpha-premultiplication.
if a != 0 {
- r *= 0xffff
+ r *= 0xff
r /= a
- g *= 0xffff
+ g *= 0xff
g /= a
- b *= 0xffff
+ b *= 0xff
b /= a
}
diff --git a/Godeps/_workspace/src/github.com/nfnt/resize/resize.go b/Godeps/_workspace/src/github.com/nfnt/resize/resize.go
index 4d4ff6e3e..c1672432e 100644
--- a/Godeps/_workspace/src/github.com/nfnt/resize/resize.go
+++ b/Godeps/_workspace/src/github.com/nfnt/resize/resize.go
@@ -167,7 +167,7 @@ func Resize(width, height uint, img image.Image, interp InterpolationFunction) i
// accessing the YCbCr arrays in a tight loop is slow.
// converting the image to ycc increases performance by 2x.
temp := newYCC(image.Rect(0, 0, input.Bounds().Dy(), int(width)), input.SubsampleRatio)
- result := newYCC(image.Rect(0, 0, int(width), int(height)), input.SubsampleRatio)
+ result := newYCC(image.Rect(0, 0, int(width), int(height)), image.YCbCrSubsampleRatio444)
coeffs, offset, filterLength := createWeights8(temp.Bounds().Dy(), taps, blur, scaleX, kernel)
in := imageYCbCrToYCC(input)
@@ -409,7 +409,7 @@ func resizeNearest(width, height uint, scaleX, scaleY float64, img image.Image,
// accessing the YCbCr arrays in a tight loop is slow.
// converting the image to ycc increases performance by 2x.
temp := newYCC(image.Rect(0, 0, input.Bounds().Dy(), int(width)), input.SubsampleRatio)
- result := newYCC(image.Rect(0, 0, int(width), int(height)), input.SubsampleRatio)
+ result := newYCC(image.Rect(0, 0, int(width), int(height)), image.YCbCrSubsampleRatio444)
coeffs, offset, filterLength := createWeightsNearest(temp.Bounds().Dy(), taps, blur, scaleX)
in := imageYCbCrToYCC(input)
diff --git a/Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go b/Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go
index ee31ac494..6f6911316 100644
--- a/Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go
+++ b/Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go
@@ -46,7 +46,7 @@ func Test_CorrectResize(t *testing.T) {
}
}
-func Test_SameColor(t *testing.T) {
+func Test_SameColorWithRGBA(t *testing.T) {
img := image.NewRGBA(image.Rect(0, 0, 20, 20))
for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ {
for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ {
@@ -56,9 +56,99 @@ func Test_SameColor(t *testing.T) {
out := Resize(10, 10, img, Lanczos3)
for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ {
for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ {
- color := img.At(x, y).(color.RGBA)
+ color := out.At(x, y).(color.NRGBA)
if color.R != 0x80 || color.G != 0x80 || color.B != 0x80 || color.A != 0xFF {
- t.Fail()
+ t.Errorf("%+v", color)
+ }
+ }
+ }
+}
+
+func Test_SameColorWithNRGBA(t *testing.T) {
+ img := image.NewNRGBA(image.Rect(0, 0, 20, 20))
+ for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ {
+ for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ {
+ img.SetNRGBA(x, y, color.NRGBA{0x80, 0x80, 0x80, 0xFF})
+ }
+ }
+ out := Resize(10, 10, img, Lanczos3)
+ for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ {
+ for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ {
+ color := out.At(x, y).(color.NRGBA)
+ if color.R != 0x80 || color.G != 0x80 || color.B != 0x80 || color.A != 0xFF {
+ t.Errorf("%+v", color)
+ }
+ }
+ }
+}
+
+func Test_SameColorWithRGBA64(t *testing.T) {
+ img := image.NewRGBA64(image.Rect(0, 0, 20, 20))
+ for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ {
+ for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ {
+ img.SetRGBA64(x, y, color.RGBA64{0x8000, 0x8000, 0x8000, 0xFFFF})
+ }
+ }
+ out := Resize(10, 10, img, Lanczos3)
+ for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ {
+ for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ {
+ color := out.At(x, y).(color.NRGBA64)
+ if color.R != 0x8000 || color.G != 0x8000 || color.B != 0x8000 || color.A != 0xFFFF {
+ t.Errorf("%+v", color)
+ }
+ }
+ }
+}
+
+func Test_SameColorWithNRGBA64(t *testing.T) {
+ img := image.NewNRGBA64(image.Rect(0, 0, 20, 20))
+ for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ {
+ for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ {
+ img.SetNRGBA64(x, y, color.NRGBA64{0x8000, 0x8000, 0x8000, 0xFFFF})
+ }
+ }
+ out := Resize(10, 10, img, Lanczos3)
+ for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ {
+ for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ {
+ color := out.At(x, y).(color.NRGBA64)
+ if color.R != 0x8000 || color.G != 0x8000 || color.B != 0x8000 || color.A != 0xFFFF {
+ t.Errorf("%+v", color)
+ }
+ }
+ }
+}
+
+func Test_SameColorWithGray(t *testing.T) {
+ img := image.NewGray(image.Rect(0, 0, 20, 20))
+ for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ {
+ for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ {
+ img.SetGray(x, y, color.Gray{0x80})
+ }
+ }
+ out := Resize(10, 10, img, Lanczos3)
+ for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ {
+ for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ {
+ color := out.At(x, y).(color.Gray)
+ if color.Y != 0x80 {
+ t.Errorf("%+v", color)
+ }
+ }
+ }
+}
+
+func Test_SameColorWithGray16(t *testing.T) {
+ img := image.NewGray16(image.Rect(0, 0, 20, 20))
+ for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ {
+ for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ {
+ img.SetGray16(x, y, color.Gray16{0x8000})
+ }
+ }
+ out := Resize(10, 10, img, Lanczos3)
+ for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ {
+ for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ {
+ color := out.At(x, y).(color.Gray16)
+ if color.Y != 0x8000 {
+ t.Errorf("%+v", color)
}
}
}
diff --git a/Makefile b/Makefile
index 8793ba98a..222d4ffe4 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,8 @@ GOPATH ?= $(GOPATH:)
GOFLAGS ?= $(GOFLAGS:)
BUILD_NUMBER ?= $(BUILD_NUMBER:)
+GO=$(GOPATH)/bin/godep go
+
ifeq ($(BUILD_NUMBER),)
BUILD_NUMBER := dev
endif
@@ -21,29 +23,27 @@ travis:
@echo building for travis
rm -Rf $(DIST_ROOT)
- @go clean $(GOFLAGS) -i ./...
-
+ @$(GO) clean $(GOFLAGS) -i ./...
+
@cd web/react/ && npm install
- @go build $(GOFLAGS) ./...
+ @$(GO) build $(GOFLAGS) ./...
@mkdir -p logs
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./api || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./store || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./api || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./store || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1
build:
- @go build $(GOFLAGS) ./...
+ @$(GO) build $(GOFLAGS) ./...
install:
@go get $(GOFLAGS) github.com/tools/godep
@if [ $(shell docker ps -a | grep -ci mattermost-mysql) -eq 0 ]; then \
- echo restoring go libs using godep; \
- $(GOPATH)/bin/godep restore; \
echo starting mattermost-mysql; \
docker run --name mattermost-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=mostest \
-e MYSQL_USER=mmuser -e MYSQL_PASSWORD=mostest -e MYSQL_DATABASE=mattermost_test -d mysql > /dev/null; \
@@ -64,37 +64,37 @@ install:
test: install
@mkdir -p logs
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./api || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./store || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1
- @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./api || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./store || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1
+ @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1
benchmark: install
@mkdir -p logs
- @go test $(GOFLAGS) -test.v -run=NO_TESTS -bench=$(BENCH) ./api || exit 1
+ @$(GO) test $(GOFLAGS) -test.v -run=NO_TESTS -bench=$(BENCH) ./api || exit 1
cover: install
rm -Rf $(DIST_RESULTS)
mkdir -p $(DIST_RESULTS)
- @go test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/api.cover.out github.com/mattermost/platform/api
- @go test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/model.cover.out github.com/mattermost/platform/model
- @go test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/store.cover.out github.com/mattermost/platform/store
- @go test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/utils.cover.out github.com/mattermost/platform/utils
- @go test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/web.cover.out github.com/mattermost/platform/web
+ @$(GO) test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/api.cover.out github.com/mattermost/platform/api
+ @$(GO) test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/model.cover.out github.com/mattermost/platform/model
+ @$(GO) test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/store.cover.out github.com/mattermost/platform/store
+ @$(GO) test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/utils.cover.out github.com/mattermost/platform/utils
+ @$(GO) test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/web.cover.out github.com/mattermost/platform/web
cd $(DIST_RESULTS) && \
echo "mode: set" > coverage.out && cat *.cover.out | grep -v mode: | sort -r | \
awk '{if($$1 != last) {print $$0;last=$$1}}' >> coverage.out
- cd $(DIST_RESULTS) && go tool cover -html=coverage.out -o=coverage.html
+ cd $(DIST_RESULTS) && $(GO) tool cover -html=coverage.out -o=coverage.html
rm -f $(DIST_RESULTS)/*.cover.out
clean:
rm -Rf $(DIST_ROOT)
- @go clean $(GOFLAGS) -i ./...
+ @$(GO) clean $(GOFLAGS) -i ./...
@if [ $(shell docker ps -a | grep -ci mattermost-mysql) -eq 1 ]; then \
echo stopping mattermost-mysql; \
@@ -124,7 +124,7 @@ run: install
@cd web/react && npm start &
@echo starting go web server
- @go run $(GOFLAGS) mattermost.go -config=config.json &
+ @$(GO) run $(GOFLAGS) mattermost.go -config=config.json &
@echo starting compass watch
@cd web/sass-files && compass watch &
@@ -161,8 +161,8 @@ cleandb:
dist: install
- @go build $(GOFLAGS) -i -a ./...
- @go install $(GOFLAGS) -a ./...
+ @$(GO) build $(GOFLAGS) -i -a ./...
+ @$(GO) install $(GOFLAGS) -a ./...
mkdir -p $(DIST_PATH)/bin
cp $(GOPATH)/bin/platform $(DIST_PATH)/bin
diff --git a/README.md b/README.md
index 65a3e7c66..f0857e99d 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-**Mattermost Preview**
+**Mattermost Alpha**
**Team Communication Service**
-**Version 0.5.0**
+**Development Build**
About Mattermost
@@ -22,7 +22,7 @@ Learn More
Installing the Mattermost
=========================
-You're installing "Mattermost Preview", a pre-released 0.5.0 version intended for an early look at what we're building. While SpinPunch runs this version internally, it's not recommended for production deployments since we can't guarantee API stability or backwards compatibility until our 1.0.0 version release.
+You're installing "Mattermost Alpha", a pre-released version intended for an early look at what we're building. While SpinPunch runs this version internally, it's not recommended for production deployments since we can't guarantee API stability or backwards compatibility until our production release.
That said, any issues at all, please let us know on the Mattermost forum at: http://forum.mattermost.org
diff --git a/api/channel.go b/api/channel.go
index 4d8dbad09..123fd8a35 100644
--- a/api/channel.go
+++ b/api/channel.go
@@ -710,6 +710,11 @@ func removeChannelMember(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
+ message := model.NewMessage(c.Session.TeamId, "", userId, model.ACTION_USER_REMOVED)
+ message.Add("channel_id",id)
+ message.Add("remover", c.Session.UserId)
+ PublishAndForget(message)
+
c.LogAudit("name=" + channel.Name + " user_id=" + userId)
result := make(map[string]string)
diff --git a/api/file.go b/api/file.go
index 82cee9d1e..889c9dd1b 100644
--- a/api/file.go
+++ b/api/file.go
@@ -142,7 +142,7 @@ func fireAndForgetHandleImages(filenames []string, fileData [][]byte, teamId, ch
go func() {
var thumbnail image.Image
if imgConfig.Width > int(utils.Cfg.ImageSettings.ThumbnailWidth) {
- thumbnail = resize.Resize(utils.Cfg.ImageSettings.ThumbnailWidth, utils.Cfg.ImageSettings.ThumbnailHeight, img, resize.NearestNeighbor)
+ thumbnail = resize.Resize(utils.Cfg.ImageSettings.ThumbnailWidth, utils.Cfg.ImageSettings.ThumbnailHeight, img, resize.Lanczos3)
} else {
thumbnail = img
}
@@ -164,7 +164,7 @@ func fireAndForgetHandleImages(filenames []string, fileData [][]byte, teamId, ch
go func() {
var preview image.Image
if imgConfig.Width > int(utils.Cfg.ImageSettings.PreviewWidth) {
- preview = resize.Resize(utils.Cfg.ImageSettings.PreviewWidth, utils.Cfg.ImageSettings.PreviewHeight, img, resize.NearestNeighbor)
+ preview = resize.Resize(utils.Cfg.ImageSettings.PreviewWidth, utils.Cfg.ImageSettings.PreviewHeight, img, resize.Lanczos3)
} else {
preview = img
}
diff --git a/model/message.go b/model/message.go
index 52ee69e8f..ec4817b2a 100644
--- a/model/message.go
+++ b/model/message.go
@@ -16,6 +16,7 @@ const (
ACTION_VIEWED = "viewed"
ACTION_NEW_USER = "new_user"
ACTION_USER_ADDED = "user_added"
+ ACTION_USER_REMOVED = "user_removed"
)
type Message struct {
diff --git a/model/session.go b/model/session.go
index 9fd3b9ec3..c812f83e2 100644
--- a/model/session.go
+++ b/model/session.go
@@ -10,9 +10,9 @@ import (
const (
SESSION_TOKEN = "MMSID"
- SESSION_TIME_WEB_IN_DAYS = 365
+ SESSION_TIME_WEB_IN_DAYS = 30
SESSION_TIME_WEB_IN_SECS = 60 * 60 * 24 * SESSION_TIME_WEB_IN_DAYS
- SESSION_TIME_MOBILE_IN_DAYS = 365
+ SESSION_TIME_MOBILE_IN_DAYS = 30
SESSION_TIME_MOBILE_IN_SECS = 60 * 60 * 24 * SESSION_TIME_MOBILE_IN_DAYS
SESSION_CACHE_IN_SECS = 60 * 10
SESSION_CACHE_SIZE = 10000
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go
index 8961d5d97..f64558a92 100644
--- a/store/sql_channel_store.go
+++ b/store/sql_channel_store.go
@@ -120,7 +120,7 @@ func (s SqlChannelStore) Update(channel *model.Channel) StoreChannel {
if count, err := s.GetMaster().Update(channel); err != nil {
if IsUniqueConstraintError(err.Error(), "Name", "channels_name_teamid_key") {
dupChannel := model.Channel{}
- s.GetReplica().SelectOne(&dupChannel, "SELECT * FROM Channels WHERE TeamId=? AND Name=? AND DeleteAt > 0", channel.TeamId, channel.Name)
+ s.GetReplica().SelectOne(&dupChannel, "SELECT * FROM Channels WHERE TeamId = :TeamId AND Name= :Name AND DeleteAt > 0", map[string]interface{}{"TeamId": channel.TeamId, "Name": channel.Name})
if dupChannel.DeleteAt > 0 {
result.Err = model.NewAppError("SqlChannelStore.Update", "A channel with that name was previously created", "id="+channel.Id+", "+err.Error())
} else {
diff --git a/store/sql_post_store.go b/store/sql_post_store.go
index 56c174e4c..ede69d125 100644
--- a/store/sql_post_store.go
+++ b/store/sql_post_store.go
@@ -38,7 +38,7 @@ func NewSqlPostStore(sqlStore *SqlStore) PostStore {
func (s SqlPostStore) UpgradeSchemaIfNeeded() {
// These execs are for upgrading currently created databases to full utf8mb4 compliance
- // Will be removed as seen fit for upgrading
+ // Will be removed as seen fit for upgrading
s.GetMaster().Exec("ALTER TABLE Posts charset=utf8mb4")
s.GetMaster().Exec("ALTER TABLE Posts MODIFY COLUMN Message varchar(4000) CHARACTER SET utf8mb4")
}
@@ -80,14 +80,14 @@ func (s SqlPostStore) Save(post *model.Post) StoreChannel {
time := model.GetMillis()
if post.Type != model.POST_JOIN_LEAVE {
- s.GetMaster().Exec("UPDATE Channels SET LastPostAt = ?, TotalMsgCount = TotalMsgCount + 1 WHERE Id = ?", time, post.ChannelId)
+ s.GetMaster().Exec("UPDATE Channels SET LastPostAt = :LastPostAt, TotalMsgCount = TotalMsgCount + 1 WHERE Id = :ChannelId", map[string]interface{}{"LastPostAt": time, "ChannelId": post.ChannelId})
} else {
// don't update TotalMsgCount for unimportant messages so that the channel isn't marked as unread
- s.GetMaster().Exec("UPDATE Channels SET LastPostAt = ? WHERE Id = ?", time, post.ChannelId)
+ s.GetMaster().Exec("UPDATE Channels SET LastPostAt = :LastPostAt WHERE Id = :ChannelId", map[string]interface{}{"LastPostAt": time, "ChannelId": post.ChannelId})
}
if len(post.RootId) > 0 {
- s.GetMaster().Exec("UPDATE Posts SET UpdateAt = ? WHERE Id = ?", time, post.RootId)
+ s.GetMaster().Exec("UPDATE Posts SET UpdateAt = :UpdateAt WHERE Id = :RootId", map[string]interface{}{"UpdateAt": time, "RootId": post.RootId})
}
result.Data = post
@@ -126,10 +126,10 @@ func (s SqlPostStore) Update(oldPost *model.Post, newMessage string, newHashtags
result.Err = model.NewAppError("SqlPostStore.Update", "We couldn't update the Post", "id="+editPost.Id+", "+err.Error())
} else {
time := model.GetMillis()
- s.GetMaster().Exec("UPDATE Channels SET LastPostAt = ? WHERE Id = ?", time, editPost.ChannelId)
+ s.GetMaster().Exec("UPDATE Channels SET LastPostAt = :LastPostAt WHERE Id = :ChannelId", map[string]interface{}{"LastPostAt": time, "ChannelId": editPost.ChannelId})
if len(editPost.RootId) > 0 {
- s.GetMaster().Exec("UPDATE Posts SET UpdateAt = ? WHERE Id = ?", time, editPost.RootId)
+ s.GetMaster().Exec("UPDATE Posts SET UpdateAt = :UpdateAt WHERE Id = :RootId", map[string]interface{}{"UpdateAt": time, "RootId": editPost.RootId})
}
// mark the old post as deleted
diff --git a/store/sql_user_store.go b/store/sql_user_store.go
index 0228fa308..cd63e95b8 100644
--- a/store/sql_user_store.go
+++ b/store/sql_user_store.go
@@ -184,7 +184,7 @@ func (us SqlUserStore) UpdateLastPictureUpdate(userId string) StoreChannel {
curTime := model.GetMillis()
- if _, err := us.GetMaster().Exec("UPDATE Users SET LastPictureUpdate = ?, UpdateAt = ? WHERE Id = ?", curTime, curTime, userId); err != nil {
+ if _, err := us.GetMaster().Exec("UPDATE Users SET LastPictureUpdate = :Time, UpdateAt = :Time WHERE Id = :UserId", map[string]interface{}{"Time": curTime, "UserId": userId}); err != nil {
result.Err = model.NewAppError("SqlUserStore.UpdateUpdateAt", "We couldn't update the update_at", "user_id="+userId)
} else {
result.Data = userId
diff --git a/utils/mail.go b/utils/mail.go
index 0fe7042b7..d152b2669 100644
--- a/utils/mail.go
+++ b/utils/mail.go
@@ -83,7 +83,7 @@ func SendMail(to, subject, body string) *model.AppError {
return nil
}
- fromMail := mail.Address{"", Cfg.EmailSettings.FeedbackEmail}
+ fromMail := mail.Address{Cfg.EmailSettings.FeedbackName, Cfg.EmailSettings.FeedbackEmail}
toMail := mail.Address{"", to}
headers := make(map[string]string)
diff --git a/web/react/components/activity_log_modal.jsx b/web/react/components/activity_log_modal.jsx
index 7cce807a9..90f139e8b 100644
--- a/web/react/components/activity_log_modal.jsx
+++ b/web/react/components/activity_log_modal.jsx
@@ -102,8 +102,9 @@ module.exports = React.createClass({
<div className="modal-content">
<div className="modal-header">
<button type="button" className="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
- <h4 className="modal-title" id="myModalLabel">Active Devices</h4>
+ <h4 className="modal-title" id="myModalLabel">Active Sessions</h4>
</div>
+ <p className="session-help-text">Sessions are created when you log in with your email and password to a new browser on a device. Sessions let you use Mattermost for up to 30 days without having to log in again. If you want to log out sooner, use the "Logout" button below to end a session.</p>
<div ref="modalBody" className="modal-body">
<form role="form">
{ activityList }
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx
index b065dff83..327520210 100644
--- a/web/react/components/create_post.jsx
+++ b/web/react/components/create_post.jsx
@@ -32,7 +32,7 @@ module.exports = React.createClass({
post.message = this.state.messageText;
// if this is a reply, trim off any carets from the beginning of a message
- if (this.state.rootId && post.message.startsWith("^")) {
+ if (this.state.rootId && post.message[0] === "^") {
post.message = post.message.replace(/^\^+\s*/g, "");
}
@@ -275,7 +275,7 @@ module.exports = React.createClass({
messageText = draft['message'];
uploadsInProgress = draft['uploadsInProgress'];
}
- this.setState({ channel_id: channel_id, messageText: messageText, initialText: messageText, submitting: false, post_error: null, previews: previews, uploadsInProgress: uploadsInProgress });
+ this.setState({ channel_id: channel_id, messageText: messageText, initialText: messageText, submitting: false, limit_error: null, server_error: null, post_error: null, previews: previews, uploadsInProgress: uploadsInProgress });
}
},
_onActiveThreadChanged: function(rootId, parentId) {
diff --git a/web/react/components/edit_channel_modal.jsx b/web/react/components/edit_channel_modal.jsx
index d055feacd..a35a531b5 100644
--- a/web/react/components/edit_channel_modal.jsx
+++ b/web/react/components/edit_channel_modal.jsx
@@ -30,12 +30,19 @@ module.exports = React.createClass({
handleUserInput: function(e) {
this.setState({ description: e.target.value });
},
+ handleClose: function() {
+ this.setState({description: "", server_error: ""});
+ },
componentDidMount: function() {
var self = this;
$(this.refs.modal.getDOMNode()).on('show.bs.modal', function(e) {
var button = e.relatedTarget;
self.setState({ description: $(button).attr('data-desc'), title: $(button).attr('data-title'), channel_id: $(button).attr('data-channelid'), server_error: "" });
});
+ $(this.refs.modal.getDOMNode()).on('hidden.bs.modal', this.handleClose)
+ },
+ componentWillUnmount: function() {
+ $(this.refs.modal.getDOMNode()).off('hidden.bs.modal', this.handleClose)
},
getInitialState: function() {
return { description: "", title: "", channel_id: "" };
diff --git a/web/react/components/removed_from_channel_modal.jsx b/web/react/components/removed_from_channel_modal.jsx
new file mode 100644
index 000000000..a8889a92a
--- /dev/null
+++ b/web/react/components/removed_from_channel_modal.jsx
@@ -0,0 +1,64 @@
+// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+var ChannelStore = require('../stores/channel_store.jsx');
+var UserStore = require('../stores/user_store.jsx');
+var BrowserStore = require('../stores/browser_store.jsx')
+var utils = require('../utils/utils.jsx');
+
+module.exports = React.createClass({
+ handleShow: function() {
+ var newState = {};
+ if(BrowserStore.getItem("channel-removed-state")) {
+ newState = BrowserStore.getItem("channel-removed-state");
+ BrowserStore.removeItem("channel-removed-state");
+ }
+
+ this.setState(newState);
+ },
+ handleClose: function() {
+ var townSquare = ChannelStore.getByName("town-square");
+ utils.switchChannel(townSquare);
+
+ this.setState({channelName: "", remover: ""})
+ },
+ componentDidMount: function() {
+ $(this.getDOMNode()).on('show.bs.modal',this.handleShow);
+ $(this.getDOMNode()).on('hidden.bs.modal',this.handleClose);
+ },
+ componentWillUnmount: function() {
+ $(this.getDOMNode()).off('show.bs.modal',this.handleShow);
+ $(this.getDOMNode()).off('hidden.bs.modal',this.handleClose);
+ },
+ getInitialState: function() {
+ return {channelName: "", remover: ""}
+ },
+ render: function() {
+ var currentUser = UserStore.getCurrentUser();
+ var channelName = this.state.channelName ? this.state.channelName : "the channel"
+ var remover = this.state.remover ? this.state.remover : "Someone"
+
+ if (currentUser != null) {
+ return (
+ <div className="modal fade" ref="modal" id="removed_from_channel" tabIndex="-1" role="dialog" aria-hidden="true">
+ <div className="modal-dialog">
+ <div className="modal-content">
+ <div className="modal-header">
+ <button type="button" className="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+ <h4 className="modal-title">Removed from {channelName}</h4>
+ </div>
+ <div className="modal-body">
+ <p>{remover} removed you from {channelName}</p>
+ </div>
+ <div className="modal-footer">
+ <button type="button" className="btn btn-primary" data-dismiss="modal">Okay</button>
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+ } else {
+ return <div/>;
+ }
+ }
+}); \ No newline at end of file
diff --git a/web/react/components/rename_channel_modal.jsx b/web/react/components/rename_channel_modal.jsx
index 2ae331626..9e4a25f85 100644
--- a/web/react/components/rename_channel_modal.jsx
+++ b/web/react/components/rename_channel_modal.jsx
@@ -89,12 +89,19 @@ module.exports = React.createClass({
this.refs.channel_name.getDOMNode().value = channel_name;
this.setState({ channel_name: channel_name })
},
+ handleClose: function() {
+ this.setState({display_name: "", channel_name: "", display_name_error: "", server_error: "", name_error: ""});
+ },
componentDidMount: function() {
var self = this;
$(this.refs.modal.getDOMNode()).on('show.bs.modal', function(e) {
var button = $(e.relatedTarget);
self.setState({ display_name: button.attr('data-display'), title: button.attr('data-name'), channel_id: button.attr('data-channelid') });
});
+ $(this.refs.modal.getDOMNode()).on('hidden.bs.modal', this.handleClose);
+ },
+ componentWillUnmount: function() {
+ $(this.refs.modal.getDOMNode()).off('hidden.bs.modal', this.handleClose);
},
getInitialState: function() {
return { display_name: "", channel_name: "", channel_id: "" };
diff --git a/web/react/components/rename_team_modal.jsx b/web/react/components/rename_team_modal.jsx
index a6da57b67..dfd775a3b 100644
--- a/web/react/components/rename_team_modal.jsx
+++ b/web/react/components/rename_team_modal.jsx
@@ -44,11 +44,14 @@ module.exports = React.createClass({
onNameChange: function() {
this.setState({ name: this.refs.name.getDOMNode().value })
},
+ handleClose: function() {
+ this.setState({ name: this.props.teamDisplayName, name_error: "", server_error: ""});
+ },
componentDidMount: function() {
- var self = this;
- $(this.refs.modal.getDOMNode()).on('hidden.bs.modal', function(e) {
- self.setState({ name: self.props.teamDisplayName });
- });
+ $(this.refs.modal.getDOMNode()).on('hidden.bs.modal', this.handleClose);
+ },
+ componentWillUnmount: function() {
+ $(this.refs.modal.getDOMNode()).off('hidden.bs.modal', this.handleClose);
},
getInitialState: function() {
return { name: this.props.teamDisplayName };
diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index 3cf67e410..5b8d6c542 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -7,6 +7,7 @@ var AsyncClient = require('../utils/async_client.jsx');
var SocketStore = require('../stores/socket_store.jsx');
var UserStore = require('../stores/user_store.jsx');
var TeamStore = require('../stores/team_store.jsx');
+var BrowserStore = require('../stores/browser_store.jsx')
var utils = require('../utils/utils.jsx');
var SidebarHeader = require('./sidebar_header.jsx');
var SearchBox = require('./search_bar.jsx');
@@ -197,6 +198,19 @@ module.exports = React.createClass({
if (UserStore.getCurrentId() === msg.user_id) {
AsyncClient.getChannels(true);
}
+ } else if(msg.action === "user_removed") {
+ if(msg.user_id === UserStore.getCurrentId()) {
+ AsyncClient.getChannels(true);
+
+ if(msg.props.channel_id === ChannelStore.getCurrentId() && $('#removed_from_channel').length > 0) {
+ var sentState = {};
+ sentState.channelName = ChannelStore.getCurrent().display_name;
+ sentState.remover = UserStore.getProfile(msg.props.remover).username;
+
+ BrowserStore.setItem('channel-removed-state',sentState);
+ $('#removed_from_channel').modal('show');
+ }
+ }
}
},
updateTitle: function() {
diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx
index dc5ba64aa..bbf1f670c 100644
--- a/web/react/components/signup_user_complete.jsx
+++ b/web/react/components/signup_user_complete.jsx
@@ -117,24 +117,24 @@ module.exports = React.createClass({
var signup_message;
if (auth_services.indexOf("gitlab") >= 0) {
- signup_message = <p>{"Choose your username and password for the " + this.props.teamDisplayName + " " + strings.Team} <a href={"/"+this.props.teamName+"/signup/gitlab"+window.location.search}>{"or sign up with GitLab."}</a></p>;
- } else {
- signup_message = <p>{"Choose your username and password for the " + this.props.teamDisplayName + " " + strings.Team + "."}</p>;
+ signup_message = <div><a className="btn btn-custom-login gitlab" href={"/"+this.props.teamName+"/signup/gitlab"+window.location.search}><span className="icon" />{"with GitLab"}</a>
+ <div className="or__container"><span>or</span></div></div>;
}
return (
<div>
<img className="signup-team-logo" src="/static/images/logo.png" />
- <h4>Welcome to { config.SiteName }</h4>
+ <h3 className="text-center extra-margin">Signup to { config.SiteName }</h3>
<div className="form-group form-group--small">
<span></span>
</div>
{ signup_message }
- <p>Your username can be made of lowercase letters and numbers.</p>
<label className="control-label">Username</label>
<div className={ name_error ? "form-group has-error" : "form-group" }>
<input type="text" ref="name" className="form-control" placeholder="" maxLength="128" />
{ name_error }
+ <p className="form__hint">Your username can be made of lowercase letters and numbers.</p>
+ <p className="form__hint">{"Pick something " + strings.Team + "mates will recognize. Your username is how you will appear to others"}</p>
</div>
{ email }
<label className="control-label">Password</label>
@@ -142,7 +142,6 @@ module.exports = React.createClass({
<input type="password" ref="password" className="form-control" placeholder="" maxLength="128" />
{ password_error }
</div>
- <p>{"Pick something " + strings.Team + "mates will recognize. Your username is how you will appear to others"}</p>
<p className={ this.state.original_email == "" ? "hidden" : ""}>{ yourEmailIs } You’ll use this address to sign in to {config.SiteName}.</p>
<div className="checkbox"><label><input type="checkbox" ref="email_service" /> It's ok to send me occassional email with updates about the {config.SiteName} service. </label></div>
<p><button onClick={this.handleSubmit} className="btn-primary btn">Create Account</button></p>
diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx
index ad50b7920..bbd1f84b6 100644
--- a/web/react/components/textbox.jsx
+++ b/web/react/components/textbox.jsx
@@ -36,7 +36,6 @@ module.exports = React.createClass({
this.resize();
this.processMentions();
- this.updateTextdiv();
},
componentWillUnmount: function() {
PostStore.removeAddMentionListener(this._onChange);
@@ -87,7 +86,6 @@ module.exports = React.createClass({
this.processMentions();
this.doProcessMentions = false;
}
- this.updateTextdiv();
this.resize();
},
componentWillReceiveProps: function(nextProps) {
@@ -117,17 +115,6 @@ module.exports = React.createClass({
});
}, 1);
},
- updateTextdiv: function() {
- var html = utils.insertHtmlEntities(this.refs.message.getDOMNode().value);
- for (var k in this.mentions) {
- var m = this.mentions[k];
- var re = new RegExp('( |^)@' + m + '( |$|\n)', 'm');
- html = html.replace(re, '$1<span class="mention">@'+m+'</span>$2');
- }
- var re2 = new RegExp('(^$)(?![.\n])', 'gm');
- html = html.replace(re2, '<br/><br/>');
- $(this.refs.textdiv.getDOMNode()).html(html);
- },
handleChange: function() {
this.props.onUserInput(this.refs.message.getDOMNode().value);
this.resize();
@@ -181,7 +168,7 @@ module.exports = React.createClass({
}
},
processMentions: function() {
- /* First, find all the possible mentions, highlight them in the HTML and add
+ /* First, find all the possible mentions and add
them all to a list of mentions */
var text = utils.insertHtmlEntities(this.refs.message.getDOMNode().value);
@@ -192,9 +179,7 @@ module.exports = React.createClass({
var matches = text.match(re1);
if (!matches) {
- $(this.refs.textdiv.getDOMNode()).text(text);
this.updateMentionTab(null, []);
- this.mentions = [];
return;
}
@@ -207,7 +192,7 @@ module.exports = React.createClass({
}
/* Figure out what the user is currently typing. If it's a mention then we don't
- want to highlight it and add it to the mention list yet, so we remove it if
+ want to add it to the mention list yet, so we remove it if
there is only one occurence of that mention so far. */
var caret = utils.getCaretPosition(this.refs.message.getDOMNode());
@@ -225,14 +210,13 @@ module.exports = React.createClass({
typingMention = text.substring(atIndex+1, caret);
}
- var re3 = new RegExp('@' + typingMention + '( |$|\n)', 'g');
+ var re2 = new RegExp('@' + typingMention + '( |$|\n)', 'g');
- if ((text.match(re3) || []).length === 1 && mentions.indexOf(typingMention) !== -1) {
+ if ((text.match(re2) || []).length === 1 && mentions.indexOf(typingMention) !== -1) {
mentions.splice(mentions.indexOf(typingMention), 1);
}
this.updateMentionTab(null, mentions);
- this.mentions = mentions;
},
checkForNewMention: function(text) {
var caret = utils.getCaretPosition(this.refs.message.getDOMNode());
@@ -287,15 +271,9 @@ module.exports = React.createClass({
elm.value = cmd;
this.handleChange();
},
- scroll: function() {
- var e = this.refs.message.getDOMNode();
- var d = this.refs.textdiv.getDOMNode();
- $(d).scrollTop($(e).scrollTop());
- },
resize: function() {
var e = this.refs.message.getDOMNode();
var w = this.refs.wrapper.getDOMNode();
- var d = this.refs.textdiv.getDOMNode();
var lht = parseInt($(e).css('lineHeight'),10);
var lines = e.scrollHeight / lht;
@@ -303,15 +281,11 @@ module.exports = React.createClass({
if (e.scrollHeight - mod < 167) {
$(e).css({'height':'auto','overflow-y':'hidden'}).height(e.scrollHeight - mod);
- $(d).css({'height':'auto','overflow-y':'hidden'}).height(e.scrollHeight - mod);
$(w).css({'height':'auto'}).height(e.scrollHeight+2);
} else {
$(e).css({'height':'auto','overflow-y':'scroll'}).height(167);
- $(d).css({'height':'auto','overflow-y':'scroll'}).height(167);
$(w).css({'height':'auto'}).height(167);
}
-
- $(d).scrollTop($(e).scrollTop());
},
handleFocus: function() {
var elm = this.refs.message.getDOMNode();
@@ -332,8 +306,7 @@ module.exports = React.createClass({
return (
<div ref="wrapper" className="textarea-wrapper">
<CommandList ref='commands' addCommand={this.addCommand} channelId={this.props.channelId} />
- <div className="form-control textarea-div" ref="textdiv"/>
- <textarea id={this.props.id} ref="message" className={"form-control custom-textarea " + this.state.connection} spellCheck="true" autoComplete="off" autoCorrect="off" rows="1" placeholder={this.props.createMessage} value={this.props.messageText} onInput={this.handleChange} onChange={this.handleChange} onKeyPress={this.handleKeyPress} onKeyDown={this.handleKeyDown} onScroll={this.scroll} onFocus={this.handleFocus} onBlur={this.handleBlur} onPaste={this.handlePaste} />
+ <textarea id={this.props.id} ref="message" className={"form-control custom-textarea " + this.state.connection} spellCheck="true" autoComplete="off" autoCorrect="off" rows="1" placeholder={this.props.createMessage} value={this.props.messageText} onInput={this.handleChange} onChange={this.handleChange} onKeyPress={this.handleKeyPress} onKeyDown={this.handleKeyDown} onFocus={this.handleFocus} onBlur={this.handleBlur} onPaste={this.handlePaste} />
</div>
);
}
diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx
index 298f5ee70..e1ae6da52 100644
--- a/web/react/components/user_settings.jsx
+++ b/web/react/components/user_settings.jsx
@@ -11,6 +11,7 @@ var client = require('../utils/client.jsx');
var AsyncClient = require('../utils/async_client.jsx');
var utils = require('../utils/utils.jsx');
var Constants = require('../utils/constants.jsx');
+var assign = require('object-assign');
function getNotificationsStateFromStores() {
var user = UserStore.getCurrentUser();
@@ -95,11 +96,20 @@ var NotificationsTab = React.createClass({
}.bind(this)
);
},
+ handleClose: function() {
+ $(this.getDOMNode()).find(".form-control").each(function() {
+ this.value = "";
+ });
+
+ this.setState(assign({},getNotificationsStateFromStores(),{server_error: null}));
+ },
componentDidMount: function() {
UserStore.addChangeListener(this._onChange);
+ $('#user_settings1').on('hidden.bs.modal', this.handleClose);
},
componentWillUnmount: function() {
UserStore.removeChangeListener(this._onChange);
+ $('#user_settings1').off('hidden.bs.modal', this.handleClose);
},
_onChange: function() {
var newState = getNotificationsStateFromStores();
@@ -502,6 +512,18 @@ var SecurityTab = React.createClass({
handleDevicesOpen: function() {
$("#user_settings1").modal('hide');
},
+ handleClose: function() {
+ $(this.getDOMNode()).find(".form-control").each(function() {
+ this.value = "";
+ });
+ this.setState({current_password: '', new_password: '', confirm_password: '', server_error: null, password_error: null});
+ },
+ componentDidMount: function() {
+ $('#user_settings1').on('hidden.bs.modal', this.handleClose);
+ },
+ componentWillUnmount: function() {
+ $('#user_settings1').off('hidden.bs.modal', this.handleClose);
+ },
getInitialState: function() {
return { current_password: '', new_password: '', confirm_password: '' };
},
@@ -595,7 +617,7 @@ var SecurityTab = React.createClass({
<br></br>
<a data-toggle="modal" className="security-links theme" data-target="#access-history" href="#" onClick={this.handleHistoryOpen}><i className="fa fa-clock-o"></i>View Access History</a>
<b> </b>
- <a data-toggle="modal" className="security-links theme" data-target="#activity-log" href="#" onClick={this.handleDevicesOpen}><i className="fa fa-globe"></i>View and Logout of Active Devices</a>
+ <a data-toggle="modal" className="security-links theme" data-target="#activity-log" href="#" onClick={this.handleDevicesOpen}><i className="fa fa-globe"></i>View and Logout of Active Sessions</a>
</div>
</div>
);
@@ -699,13 +721,15 @@ var GeneralTab = React.createClass({
if(!this.submitActive) return;
- if(this.state.picture.type !== "image/jpeg") {
- this.setState({client_error: "Only JPG images may be used for profile pictures"});
+ var picture = this.state.picture;
+
+ if(picture.type !== "image/jpeg" && picture.type !== "image/png") {
+ this.setState({client_error: "Only JPG or PNG images may be used for profile pictures"});
return;
}
formData = new FormData();
- formData.append('image', this.state.picture, this.state.picture.name);
+ formData.append('image', picture, picture.name);
client.uploadProfileImage(formData,
function(data) {
@@ -751,6 +775,19 @@ var GeneralTab = React.createClass({
this.submitActive = false
this.props.updateSection(section);
},
+ handleClose: function() {
+ $(this.getDOMNode()).find(".form-control").each(function() {
+ this.value = "";
+ });
+
+ this.setState(assign({}, this.getInitialState(), {client_error: null, server_error: null, email_error: null}));
+ },
+ componentDidMount: function() {
+ $('#user_settings1').on('hidden.bs.modal', this.handleClose);
+ },
+ componentWillUnmount: function() {
+ $('#user_settings1').off('hidden.bs.modal', this.handleClose);
+ },
getInitialState: function() {
var user = this.props.user;
@@ -994,10 +1031,14 @@ var AppearanceTab = React.createClass({
var hex = utils.rgb2hex(e.target.style.backgroundColor);
this.setState({ theme: hex.toLowerCase() });
},
+ handleClose: function() {
+ this.setState({server_error: null});
+ },
componentDidMount: function() {
if (this.props.activeSection === "theme") {
$(this.refs[this.state.theme].getDOMNode()).addClass('active-border');
}
+ $('#user_settings1').on('hidden.bs.modal', this.handleClose);
},
componentDidUpdate: function() {
if (this.props.activeSection === "theme") {
@@ -1005,6 +1046,9 @@ var AppearanceTab = React.createClass({
$(this.refs[this.state.theme].getDOMNode()).addClass('active-border');
}
},
+ componentWillUnmount: function() {
+ $('#user_settings1').off('hidden.bs.modal', this.handleClose);
+ },
getInitialState: function() {
var user = UserStore.getCurrentUser();
var theme = config.ThemeColors != null ? config.ThemeColors[0] : "#2389d7";
diff --git a/web/react/pages/channel.jsx b/web/react/pages/channel.jsx
index cc78df120..90d90b29f 100644
--- a/web/react/pages/channel.jsx
+++ b/web/react/pages/channel.jsx
@@ -34,6 +34,7 @@ var MentionList = require('../components/mention_list.jsx');
var ChannelInfoModal = require('../components/channel_info_modal.jsx');
var AccessHistoryModal = require('../components/access_history_modal.jsx');
var ActivityLogModal = require('../components/activity_log_modal.jsx');
+var RemovedFromChannelModal = require('../components/removed_from_channel_modal.jsx')
var Constants = require('../utils/constants.jsx');
@@ -217,4 +218,9 @@ global.window.setup_channel_page = function(team_name, team_type, team_id, chann
document.getElementById('activity_log_modal')
);
+ React.render(
+ <RemovedFromChannelModal />,
+ document.getElementById('removed_from_channel_modal')
+ );
+
};
diff --git a/web/sass-files/sass/partials/_activity-log.scss b/web/sass-files/sass/partials/_activity-log.scss
index 36eb48750..3f0c3090d 100644
--- a/web/sass-files/sass/partials/_activity-log.scss
+++ b/web/sass-files/sass/partials/_activity-log.scss
@@ -28,4 +28,7 @@
.report__info {
color: #999;
}
+}
+.session-help-text {
+ padding: 20px 20px 5px 20px;
} \ No newline at end of file
diff --git a/web/sass-files/sass/partials/_signup.scss b/web/sass-files/sass/partials/_signup.scss
index db22718d2..5996306d2 100644
--- a/web/sass-files/sass/partials/_signup.scss
+++ b/web/sass-files/sass/partials/_signup.scss
@@ -8,7 +8,6 @@
padding: 100px 0px 50px 0px;
max-width: 380px;
margin: 0 auto;
- font-size: 1.1em;
position: relative;
h1, h2, h3, h4, h5, h6, p {
line-height: 1.3;
@@ -17,15 +16,18 @@
font-weight: 600;
margin-bottom: 0.5em;
letter-spacing: -0.5px;
- font-size: em(28px);
+ font-size: em(30px);
}
h3 {
font-weight: 600;
margin: 0 0 1.3em 0;
- font-size: 1.4em;
+ font-size: 1.5em;
+ &.extra-margin {
+ margin-bottom: 2.5em;
+ }
}
h4 {
- font-size: em(18px);
+ font-size: em(20px);
font-weight: 600;
margin-bottom: 1em;
&.text--light {
@@ -44,6 +46,11 @@
form {
margin-bottom: 0.8em;
}
+ .form__hint {
+ font-size: 0.95em;
+ color: #999;
+ margin: 10px 0;
+ }
.external-link {
position: absolute;
bottom: 0;
@@ -61,10 +68,54 @@
.form-control {
height: em(38px);
}
+ .or__container {
+ height: 1px;
+ background: #dddddd;
+ text-align: center;
+ margin: 2em 0;
+ span {
+ width: 33px;
+ top: -10px;
+ position: relative;
+ font-size: em(16px);
+ line-height: 20px;
+ font-weight: 600;
+ background: #fff;
+ display: inline-block;
+ }
+ }
.btn {
padding: em(7px) em(15px);
font-weight: 600;
- font-size: em(13px);
+ margin-right: 5px;
+ &.btn-custom-login {
+ display: block;
+ min-width: 200px;
+ width: 200px;
+ padding: 0 1em;
+ margin: 1em auto;
+ height: 40px;
+ line-height: 35px;
+ color: #fff;
+ @include border-radius(2px);
+ &.gitlab {
+ background: #554488;
+ &:hover {
+ background: darken(#554488, 10%);
+ }
+ span {
+ vertical-align: middle;
+ }
+ .icon {
+ background: url("../images/gitlabLogo.png");
+ width: 18px;
+ height: 18px;
+ margin-right: 8px;
+ @include background-size(100% 100%);
+ display: inline-block;
+ }
+ }
+ }
&.btn-default {
color: #444;
}
@@ -75,13 +126,11 @@
font-size: 0.9em;
}
&.glyphicon-chevron-right {
- margin-left: 0.3em;
font-size: 0.8em;
right: -2px;
top: 0px;
}
&.glyphicon-chevron-left {
- margin-right: 0.3em;
font-size: 0.8em;
left: -2px;
top: 0px;
@@ -90,9 +139,20 @@
}
.has-error {
.control-label {
- margin-top: 5px;
+ background: #f2f2f2;
+ padding: 0.7em 1em;
+ @include border-radius(3px);
+ margin: 1em 0 0;
font-size: 14px;
- font-weight: 600;
+ font-weight: normal;
+ color: #999;
+ width: 100%;
+ &:before {
+ @extend .fa;
+ content: "\f071";
+ margin-right: 4px;
+ color: #aaa;
+ }
}
}
.reset-form {
diff --git a/web/static/images/gitlabLogo.png b/web/static/images/gitlabLogo.png
new file mode 100644
index 000000000..9004a8f0c
--- /dev/null
+++ b/web/static/images/gitlabLogo.png
Binary files differ
diff --git a/web/templates/channel.html b/web/templates/channel.html
index 8e856032d..6325069ee 100644
--- a/web/templates/channel.html
+++ b/web/templates/channel.html
@@ -47,6 +47,7 @@
<div id="channel_info_modal"></div>
<div id="access_history_modal"></div>
<div id="activity_log_modal"></div>
+ <div id="removed_from_channel_modal"></div>
<script>
window.setup_channel_page('{{ .Props.TeamDisplayName }}', '{{ .Props.TeamType }}', '{{ .Props.TeamId }}', '{{ .Props.ChannelName }}', '{{ .Props.ChannelId }}');
</script>