diff --git a/Gemfile.lock b/Gemfile.lock index bd710ccfa..fbe0a0f03 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.2) + CFPropertyList (3.0.3) activesupport (4.2.11.3) i18n (~> 0.7) minitest (~> 5.1) @@ -16,8 +16,8 @@ GEM json (>= 1.5.1) atomos (0.1.3) aws-eventstream (1.1.0) - aws-partitions (1.399.0) - aws-sdk-core (3.109.3) + aws-partitions (1.402.0) + aws-sdk-core (3.110.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) @@ -25,7 +25,7 @@ GEM aws-sdk-kms (1.39.0) aws-sdk-core (~> 3, >= 3.109.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.85.0) + aws-sdk-s3 (1.86.0) aws-sdk-core (~> 3, >= 3.109.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) @@ -87,7 +87,7 @@ GEM dotenv (2.7.6) emoji_regex (3.2.1) escape (0.0.4) - excon (0.78.0) + excon (0.78.1) faraday (1.1.0) multipart-post (>= 1.2, < 3) ruby2_keywords @@ -97,7 +97,7 @@ GEM faraday_middleware (1.0.0) faraday (~> 1.0) fastimage (2.2.0) - fastlane (2.168.0) + fastlane (2.170.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.3, < 3.0.0) aws-sdk-s3 (~> 1.0) diff --git a/app/controllers/companies/edit.js b/app/controllers/companies/edit.js index d99067b28..ee9aecbdf 100644 --- a/app/controllers/companies/edit.js +++ b/app/controllers/companies/edit.js @@ -2,6 +2,11 @@ import Ember from "ember"; export default Ember.Controller.extend({ messageBox: Ember.inject.service(), + + isInvalidCompanyName: Ember.computed("model.company.name", function() { + return this.get("model.company.name").trim().length === 0; + }), + actions: { back() { this.get("model.company").rollbackAttributes(); @@ -10,7 +15,12 @@ export default Ember.Controller.extend({ this.get("model.id") ); }, + updateCompany() { + if (this.get("isInvalidCompanyName")) { + return; + } + let company = this.get("model.company"); let offer = this.get("model"); company.set("name", this.get("model.company.name")); diff --git a/app/controllers/companies/new.js b/app/controllers/companies/new.js index 9f64847a4..59f828218 100644 --- a/app/controllers/companies/new.js +++ b/app/controllers/companies/new.js @@ -4,6 +4,10 @@ export default Ember.Controller.extend({ offerId: Ember.computed.alias("model.id"), messageBox: Ember.inject.service(), + isInvalidCompanyName: Ember.computed("name", function() { + return this.get("name").trim().length === 0; + }), + actions: { back() { this.get("model.company") && @@ -13,8 +17,9 @@ export default Ember.Controller.extend({ this.get("model.id") ); }, + saveCompanyAndOffer() { - if (!this.get("name")) { + if (this.get("isInvalidCompanyName")) { return; } let offer = this.get("model"); diff --git a/app/styles/templates/components/_canned-messages-overlay.scss b/app/styles/templates/components/_canned-messages-overlay.scss index d42d37c86..2512c3653 100644 --- a/app/styles/templates/components/_canned-messages-overlay.scss +++ b/app/styles/templates/components/_canned-messages-overlay.scss @@ -21,7 +21,19 @@ } .clear-search { - margin-right: 5%; + width: 1.5rem; + padding: 0.5rem; + margin-top: -0.5rem; + padding-right: 3rem; + + @media #{$small-only} { + padding-right: 1.5rem; + } + + @media #{$medium-only} { + padding-right: 2rem; + } + } } diff --git a/app/templates/companies/edit.hbs b/app/templates/companies/edit.hbs index 8005b337a..bf6af33a3 100644 --- a/app/templates/companies/edit.hbs +++ b/app/templates/companies/edit.hbs @@ -19,10 +19,12 @@
{{#form-control}} - {{input type='text' value=model.company.name required='true' pattern=".*\S.*" class='company-input'}} -
- {{t 'donor_details.company.company_name_validation'}} -
+ {{input type='text' value=model.company.name required='true' class='company-input'}} + {{#if isInvalidCompanyName}} +
+ {{t 'donor_details.company.company_name_validation'}} +
+ {{/if}} {{/form-control}}
diff --git a/app/templates/companies/new.hbs b/app/templates/companies/new.hbs index 8c1c77ee6..e4b3cc8a5 100644 --- a/app/templates/companies/new.hbs +++ b/app/templates/companies/new.hbs @@ -19,12 +19,12 @@
- {{input type='text' value=name required='true' autofocus ="true" pattern=".*\S.*" class='company-input' placeholder=(t 'donor_details.company.enter_name')}} - {{#unless name}} + {{input type='text' value=name required='true' autofocus ="true" class='company-input' placeholder=(t 'donor_details.company.enter_name')}} + {{#if isInvalidCompanyName}}
{{t 'donor_details.company.company_name_validation'}}
- {{/unless}} + {{/if}}
diff --git a/yarn.lock b/yarn.lock index 92640f8d5..7a7c0f80d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8572,10 +8572,10 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.1.0.tgz#a4cc031d9b1aca63eecbd18a650e13cb4eeab946" - integrity sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA== +is-core-module@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.2.0.tgz#97037ef3d52224d85163f5597b2b63d9afed981a" + integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== dependencies: has "^1.0.3" @@ -12831,11 +12831,11 @@ resolve@^0.6.3: integrity sha1-3ZV5gufnNt699TtYpN2RdUV13UY= resolve@^1.1.2, resolve@^1.1.6, resolve@^1.10.0: - version "1.18.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.18.1.tgz#018fcb2c5b207d2a6424aee361c5a266da8f4130" - integrity sha512-lDfCPaMKfOJXjy0dPayzPdF1phampNWr3qFCjAu+rw/qbQmr5jWH5xN2hwh9QKfw9E5v4hwV7A+jrCmL8yjjqA== + version "1.19.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c" + integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== dependencies: - is-core-module "^2.0.0" + is-core-module "^2.1.0" path-parse "^1.0.6" resolve@^1.1.3, resolve@^1.1.4, resolve@^1.11.1, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.3.0, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1: @@ -13254,7 +13254,7 @@ sha@~2.0.1: "shared-goodcity@git://github.com/crossroads/shared.goodcity.git#master": version "0.0.0" - resolved "git://github.com/crossroads/shared.goodcity.git#583a9ef385249c82fdc4235427fe583e1f1c5d60" + resolved "git://github.com/crossroads/shared.goodcity.git#0b47e2298a66d18f9867c8429291ee8831f80e29" dependencies: cryptiles "^4.1.2" ember-cli-babel "^5.1.6"