Skip to content

Commit

Permalink
Merge branch 'master' of github.com:crossroads/admin.goodcity
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas098 committed Dec 23, 2020
2 parents 911c504 + 1d089b9 commit 5773db3
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 24 deletions.
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -16,16 +16,16 @@ 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)
jmespath (~> 1.0)
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)
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions app/controllers/companies/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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"));
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/companies/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -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") &&
Expand All @@ -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");
Expand Down
14 changes: 13 additions & 1 deletion app/styles/templates/components/_canned-messages-overlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
}

Expand Down
10 changes: 6 additions & 4 deletions app/templates/companies/edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
<div class="row">
<div class="{{if isMobileApp 'small-7 large-8' 'small-12'}} columns">
{{#form-control}}
{{input type='text' value=model.company.name required='true' pattern=".*\S.*" class='company-input'}}
<div class='input-error'>
{{t 'donor_details.company.company_name_validation'}}
</div>
{{input type='text' value=model.company.name required='true' class='company-input'}}
{{#if isInvalidCompanyName}}
<div class='empty-name-error'>
{{t 'donor_details.company.company_name_validation'}}
</div>
{{/if}}
{{/form-control}}
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/templates/companies/new.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
</div>
<div class="row">
<div class="{{if isMobileApp 'small-7 large-8' 'small-12'}} columns">
{{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}}
<div class ="empty-name-error">
{{t 'donor_details.company.company_name_validation'}}
</div>
{{/unless}}
{{/if}}
</div>
</div>

Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 5773db3

Please sign in to comment.