Skip to content

Commit

Permalink
fix(foxy-store-form): fix logo url v8n
Browse files Browse the repository at this point in the history
Closes #152
  • Loading branch information
pheekus committed Jan 30, 2024
1 parent b29642e commit c289797
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/elements/public/StoreForm/StoreForm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,13 @@ describe('StoreForm', () => {
expect(form.errors).to.not.include('country:v8n_required');
});

it('produces the logo-url:v8n_too_long error if logo url is longer than 100 characters', () => {
it('produces the logo-url:v8n_too_long error if logo url is longer than 200 characters', () => {
const form = new Form();

form.edit({ logo_url: 'A'.repeat(101) });
form.edit({ logo_url: 'A'.repeat(201) });
expect(form.errors).to.include('logo-url:v8n_too_long');

form.edit({ logo_url: 'A'.repeat(100) });
form.edit({ logo_url: 'A'.repeat(200) });
expect(form.errors).to.not.include('logo-url:v8n_too_long');
});

Expand Down
2 changes: 1 addition & 1 deletion src/elements/public/StoreForm/StoreForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export class StoreForm extends Base<Data> {

({ country: v }) => !!v || 'country:v8n_required',

({ logo_url: v }) => !v || v.length <= 100 || 'logo-url:v8n_too_long',
({ logo_url: v }) => !v || v.length <= 200 || 'logo-url:v8n_too_long',

({ webhook_url: v, use_webhook }) => !use_webhook || !!v || 'webhook-url:v8n_required',

Expand Down
2 changes: 1 addition & 1 deletion src/static/schemas/store-form.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
},
"v8n_too_long": {
"type": "string",
"default": "Please shorten this link to 100 characters of less"
"default": "Please shorten this link to 200 characters of less"
}
},
"required": ["label", "placeholder", "helper_text", "v8n_too_long"]
Expand Down
2 changes: 1 addition & 1 deletion src/static/translations/store-form/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"label": "Logo",
"placeholder": "https://example.com/logo.png",
"helper_text": "URL to your store's logo that may be used in your store's templates.",
"v8n_too_long": "Please shorten this link to 100 characters of less"
"v8n_too_long": "Please shorten this link to 200 characters of less"
},
"timezone": {
"label": "Timezone",
Expand Down

0 comments on commit c289797

Please sign in to comment.