Removed unused brand color field from Profile (#18370)

* Minimal changes for removing brand-color-2

* Removed brand color 2 only for profile

* Updated test
This commit is contained in:
Rajat Talesra 2022-08-30 16:48:48 +05:30 committed by GitHub
parent 6ef1968377
commit f482e60581
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 28 deletions

View file

@ -160,32 +160,18 @@
<h2><%= t("views.settings.group.Branding") %></h2>
<div class="crayons-field ">
<label class="crayons-field__label" for="users_setting[brand_color1]">
<%= t("views.logo.color_1.label") %>
<%= t("views.profile.color.label") %>
</label>
<p class="crayons-field__description"><%= t("views.logo.color_1.description") %></p>
<p class="crayons-field__description"><%= t("views.profile.color.description") %></p>
<div class="flex items-center w-100 m:w-50">
<%= f.public_send(:text_field, "users_setting[brand_color1]",
value: users_setting.public_send(:brand_color1),
placeholder: "#000000",
class: "crayons-textfield",
data: { color_picker: "true", label_text: t("views.logo.color_1.label") }) %>
data: { color_picker: "true", label_text: t("views.profile.color.label") }) %>
</div>
</div>
<div class="crayons-field ">
<label class="crayons-field__label" for="users_setting[brand_color2]">
<%= t("views.logo.color_2.label") %>
</label>
<p class="crayons-field__description"><%= t("views.logo.color_2.description_html") %></p>
<div class="flex items-center w-100 m:w-50">
<%= f.public_send(:text_field, "users_setting[brand_color2]",
value: users_setting.public_send(:brand_color2),
placeholder: "#000000",
class: "crayons-textfield",
data: { color_picker: "true", label_text: t("views.logo.color_2.label") }) %>
</div>
</div>
</div>
<div class="save-footer crayons-card crayons-card--content-rows">

View file

@ -60,6 +60,10 @@ en:
pinned: "📌 Pinned! (pinned posts display chronologically, 5 max)"
removed: "🗑 Pin removed"
error: You can only have five pins
profile:
color:
label: Brand color
description: Used for backgrounds, borders etc.
reading_list:
meta:
title: Reading List

View file

@ -60,6 +60,10 @@ fr:
pinned: "📌 Pinned! (pinned posts display chronologically, 5 max)"
removed: "🗑 Pin removed"
error: You can only have five pins
profile:
color:
label: Brand color
description: Used for backgrounds, borders etc.
reading_list:
meta:
title: Reading List

View file

@ -10,26 +10,18 @@ describe('Update profile settings', () => {
it('updates brand colors', () => {
// Verify both a button and an input exist to update both colors
cy.findByRole('button', { name: 'Brand color 1' });
cy.findByRole('textbox', { name: 'Brand color 1' }).as('brandColor1');
cy.findByRole('button', { name: 'Brand color 2' });
cy.findByRole('textbox', { name: 'Brand color 2' }).as('brandColor2');
cy.findByRole('button', { name: 'Brand color' });
cy.findByRole('textbox', { name: 'Brand color' }).as('brandColor1');
// Verify that changing the value saves properly
cy.get('@brandColor1').enterIntoColorInput('ababab');
cy.get('@brandColor2').enterIntoColorInput('d22a2a');
cy.findByRole('button', { name: 'Save Profile Information' }).click();
cy.findByText('Your profile has been updated');
cy.findByRole('textbox', { name: 'Brand color 1' }).should(
cy.findByRole('textbox', { name: 'Brand color' }).should(
'have.value',
'#ababab',
);
cy.findByRole('textbox', { name: 'Brand color 2' }).should(
'have.value',
'#d22a2a',
);
});
});