Open platform to collect and prioritize feedback
chore: part 1 of "Customize Look and Feel" (#379)
Guilherme Oenning82e191e56d22
diff --git a/Makefile b/Makefileindex a9f723b9f..f712fb85c 100644--- a/Makefile+++ b/Makefile@@ -18,7 +18,7 @@ test-ui:TZ='GMT' npx jest ./publictest-server:- godotenv -f .test.env go test ./..+ godotenv -f .test.env go test ./...test : test-server test-uidiff --git a/app/pkg/dbx/dbx_test.go b/app/pkg/dbx/dbx_test.goindex a072fa3d2..d95436778 100644--- a/app/pkg/dbx/dbx_test.go+++ b/app/pkg/dbx/dbx_test.go@@ -1,11 +1,13 @@package dbx_testimport (+ "io/ioutil""os""testing". "github.com/getfider/fider/app/pkg/assert""github.com/getfider/fider/app/pkg/dbx"+ "github.com/getfider/fider/app/pkg/env")type user struct {@@ -251,3 +253,35 @@ func TestArray(t *testing.T) {Expect(result.Tags[0]).Equals(int64(5))Expect(result.Tags[1]).Equals(int64(10))}++func TestByteArray(t *testing.T) {+ RegisterT(t)+ db := dbx.New()+ defer db.Close()++ trx, _ := db.Begin()+ defer trx.Rollback()++ type file struct {+ ContentType string `db:"content_type"`+ Size int `db:"size"`+ Content []byte `db:"file"`+ }++ fileContent, err := ioutil.ReadFile(env.Path("/favicon.ico"))+ Expect(err).IsNil()++ _, err = trx.Execute(`+ INSERT INTO uploads (tenant_id, size, content_type, file)+ VALUES (1, $1, 'text/plain', $2)+ `, len(fileContent), fileContent)++ Expect(err).IsNil()++ theFile := file{}+ err = trx.Get(&theFile, "SELECT content_type, size, file FROM uploads WHERE id = 1")+ Expect(err).IsNil()+ Expect(theFile.ContentType).Equals("text/plain")+ Expect(theFile.Content).Equals(fileContent)+ Expect(theFile.Size).Equals(len(theFile.Content))+}diff --git a/app/pkg/dbx/mapping.go b/app/pkg/dbx/mapping.goindex c475f6961..351a216e3 100644--- a/app/pkg/dbx/mapping.go+++ b/app/pkg/dbx/mapping.go@@ -55,7 +55,7 @@ func (m *RowMapper) Map(dest interface{}, columns []string, scanner func(dest ..panic(fmt.Sprintf("Field not found for column %s", c))}- if field.Kind() == reflect.Slice {+ if field.Kind() == reflect.Slice && field.Type().Elem().Kind() != reflect.Uint8 {obj := reflect.New(reflect.MakeSlice(field.Type(), 0, 0).Type()).Elem()field.Set(obj)pointers[i] = pq.Array(field.Addr().Interface())diff --git a/migrations/201805061319_create_uploads.up.sql b/migrations/201805061319_create_uploads.up.sqlnew file mode 100644index 000000000..9ff331b5c--- /dev/null+++ b/migrations/201805061319_create_uploads.up.sql@@ -0,0 +1,10 @@+create table if not exists uploads (+ id serial not null,+ tenant_id int not null,+ size int not null,+ content_type varchar(200) not null,+ file bytea not null,+ created_on timestamptz not null default now(),+ primary key (id),+ foreign key (tenant_id) references tenants(id)+);\ No newline at end of filediff --git a/public/assets/styles/main.scss b/public/assets/styles/main.scssindex 6a2582100..111d50cee 100644--- a/public/assets/styles/main.scss+++ b/public/assets/styles/main.scss@@ -29,7 +29,7 @@ body {}body, h1, h2, h3, h4, h5, .ui, input {- font-family: 'Ubuntu', sans-serif !important;+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Helvetica Neue", Helvetica, sans-serif;text-rendering: optimizeLegibility;-webkit-font-smoothing: antialiased;}@@ -43,8 +43,9 @@ body, h1, h2, h3, h4, h5, .ui, input {margin-top: 0px;background-color: $menu-color;margin-bottom: 30px;- height: 40px;+ height: 50px;border-radius: 0px;+ border: none;.unread-dot {width: 10px;@@ -60,8 +61,16 @@ body, h1, h2, h3, h4, h5, .ui, input {min-width: 150px;}+ .title {+ font-size: 18px;+ margin: 0 0 0 0;+ }+div, a {color: textColorFor($menu-color);+ &:hover {+ background: $menu-color;+ }}}diff --git a/public/assets/styles/variables.scss b/public/assets/styles/variables.scssindex 9dc5dd6f7..84ac48693 100644--- a/public/assets/styles/variables.scss+++ b/public/assets/styles/variables.scss@@ -7,8 +7,8 @@ $font-size-big: 18px;$main-color: #0069ff;$admin-color: #365899;-$bg-color: #fff;-$menu-color: #f9f9f9;+$bg-color: #fdfdfd;+$menu-color: #fff;$text-color: #333;$link-color: #07C;diff --git a/public/components/common/Header.tsx b/public/components/common/Header.tsxindex 5e406ee43..21bd06c0d 100644--- a/public/components/common/Header.tsx+++ b/public/components/common/Header.tsx@@ -83,7 +83,7 @@ export class Header extends React.Component<HeaderProps, HeaderState> {<div id="menu" className="ui small borderless menu"><div className="ui container"><a href="/" className="header item">- {this.props.tenant.name}+ <span className="title">{this.props.tenant.name}</span></a>{showRightMenu && (<divdiff --git a/views/base.html b/views/base.htmlindex 7d936a136..0b2d82b57 100644--- a/views/base.html+++ b/views/base.html@@ -5,7 +5,6 @@<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"><link rel="icon" type="image/x-icon" href="/favicon.ico"><link rel="stylesheet" href="/assets/css/{{ .__StyleBundle }}" />- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,700&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext"><title>{{ template "title" .}}</title><meta property="og:title" content="{{template "title" .}}" /><meta property="og:description" content="We'd love to hear what you're thinking about. What can we do better? This is the place for you to vote, discuss and share ideas." />