Skip to content

Commit

Permalink
remove text fit mode fields, add shrink at line fields
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Castillo <[email protected]>
  • Loading branch information
tomrndom committed Nov 7, 2024
1 parent be8d382 commit c493a41
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 41 deletions.
83 changes: 50 additions & 33 deletions src/components/forms/badge-settings-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,6 @@ class BadgeSettingsForm extends React.Component {
{ label: "Uppercase", value: "UPPERCASE" }
];

const ddlTextFitMode = [
{ label: "Single", value: "SINGLE" },
{ label: "Multi", value: "MULTI" }
];

const ddlNameDisplayMode = [
{ label: "Full Name", value: "FULL_NAME" },
{ label: "Stacked", value: "STACKED" },
Expand Down Expand Up @@ -543,16 +538,23 @@ class BadgeSettingsForm extends React.Component {
<div className="col-md-6">
<label>
{T.translate(
"badge_settings.badge_template_first_name_text_fit_mode"
)}
"badge_settings.badge_template_first_name_shrink_at_line"
)}{" "}
&nbsp;{" "}
<i
className="fa fa-info-circle"
aria-hidden="true"
title={T.translate("badge_settings.shrink_info")}
/>
</label>
<br />
<Dropdown
id="BADGE_TEMPLATE_FIRST_NAME_TEXT_FIT_MODE"
value={entity?.BADGE_TEMPLATE_FIRST_NAME_TEXT_FIT_MODE?.value}
<Input
className="form-control"
id="BADGE_TEMPLATE_FIRST_NAME_SHRINK_AT_LINE"
value={
entity?.BADGE_TEMPLATE_FIRST_NAME_SHRINK_AT_LINE?.value
}
onChange={this.handleChange}
options={ddlTextFitMode}
isClearable
/>
</div>
</div>
Expand Down Expand Up @@ -695,16 +697,21 @@ class BadgeSettingsForm extends React.Component {
<div className="col-md-6">
<label>
{T.translate(
"badge_settings.badge_template_last_name_text_fit_mode"
)}
"badge_settings.badge_template_last_name_shrink_at_line"
)}{" "}
&nbsp;{" "}
<i
className="fa fa-info-circle"
aria-hidden="true"
title={T.translate("badge_settings.shrink_info")}
/>
</label>
<br />
<Dropdown
id="BADGE_TEMPLATE_LAST_NAME_TEXT_FIT_MODE"
value={entity?.BADGE_TEMPLATE_LAST_NAME_TEXT_FIT_MODE?.value}
<Input
className="form-control"
id="BADGE_TEMPLATE_LAST_NAME_SHRINK_AT_LINE"
value={entity?.BADGE_TEMPLATE_LAST_NAME_SHRINK_AT_LINE?.value}
onChange={this.handleChange}
options={ddlTextFitMode}
isClearable
/>
</div>
</div>
Expand Down Expand Up @@ -843,16 +850,21 @@ class BadgeSettingsForm extends React.Component {
<div className="col-md-6">
<label>
{T.translate(
"badge_settings.badge_template_company_text_fit_mode"
)}
"badge_settings.badge_template_company_shrink_at_line"
)}{" "}
&nbsp;{" "}
<i
className="fa fa-info-circle"
aria-hidden="true"
title={T.translate("badge_settings.shrink_info")}
/>
</label>
<br />
<Dropdown
id="BADGE_TEMPLATE_COMPANY_TEXT_FIT_MODE"
value={entity?.BADGE_TEMPLATE_COMPANY_TEXT_FIT_MODE?.value}
<Input
className="form-control"
id="BADGE_TEMPLATE_COMPANY_SHRINK_AT_LINE"
value={entity?.BADGE_TEMPLATE_COMPANY_SHRINK_AT_LINE?.value}
onChange={this.handleChange}
options={ddlTextFitMode}
isClearable
/>
</div>
</div>
Expand Down Expand Up @@ -1008,16 +1020,21 @@ class BadgeSettingsForm extends React.Component {
<div className="col-md-6">
<label>
{T.translate(
"badge_settings.badge_template_title_text_fit_mode"
)}
"badge_settings.badge_template_title_shrink_at_line"
)}{" "}
&nbsp;{" "}
<i
className="fa fa-info-circle"
aria-hidden="true"
title={T.translate("badge_settings.shrink_info")}
/>
</label>
<br />
<Dropdown
id="BADGE_TEMPLATE_TITLE_TEXT_FIT_MODE"
value={entity?.BADGE_TEMPLATE_TITLE_TEXT_FIT_MODE?.value}
<Input
className="form-control"
id="BADGE_TEMPLATE_TITLE_SHRINK_AT_LINE"
value={entity?.BADGE_TEMPLATE_TITLE_SHRINK_AT_LINE?.value}
onChange={this.handleChange}
options={ddlTextFitMode}
isClearable
/>
</div>
</div>
Expand Down
9 changes: 5 additions & 4 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2366,28 +2366,28 @@
"badge_template_title_font_casing": "BADGE_TEMPLATE_TITLE_FONT_CASING",
"badge_template_title_font_size_min": "BADGE_TEMPLATE_TITLE_FONT_SIZE_MIN",
"badge_template_title_font_size_max": "BADGE_TEMPLATE_TITLE_FONT_SIZE_MAX",
"badge_template_title_text_fit_mode": "BADGE_TEMPLATE_TITLE_TEXT_FIT_MODE",
"badge_template_title_text_fit_mode": "BADGE_TEMPLATE_TITLE_SHRINK_AT_LINE",
"badge_template_title_font_family": "BADGE_TEMPLATE_TITLE_FONT_FAMILY",
"badge_template_first_name_padding": "BADGE_TEMPLATE_FIRST_NAME_PADDING",
"badge_template_first_name_text_align": "BADGE_TEMPLATE_FIRST_NAME_TEXT_ALIGN",
"badge_template_first_name_font_casing": "BADGE_TEMPLATE_FIRST_NAME_FONT_CASING",
"badge_template_first_name_font_size_min": "BADGE_TEMPLATE_FIRST_NAME_FONT_SIZE_MIN",
"badge_template_first_name_font_size_max": "BADGE_TEMPLATE_FIRST_NAME_FONT_SIZE_MAX",
"badge_template_first_name_text_fit_mode": "BADGE_TEMPLATE_FIRST_NAME_TEXT_FIT_MODE",
"badge_template_first_name_shrink_at_line": "BADGE_TEMPLATE_FIRST_NAME_SHRINK_AT_LINE",
"badge_template_first_name_font_family": "BADGE_TEMPLATE_FIRST_NAME_FONT_FAMILY",
"badge_template_last_name_padding": "BADGE_TEMPLATE_LAST_NAME_PADDING",
"badge_template_last_name_text_align": "BADGE_TEMPLATE_LAST_NAME_TEXT_ALIGN",
"badge_template_last_name_font_casing": "BADGE_TEMPLATE_LAST_NAME_FONT_CASING",
"badge_template_last_name_font_size_min": "BADGE_TEMPLATE_LAST_NAME_FONT_SIZE_MIN",
"badge_template_last_name_font_size_max": "BADGE_TEMPLATE_LAST_NAME_FONT_SIZE_MAX",
"badge_template_last_name_text_fit_mode": "BADGE_TEMPLATE_LAST_NAME_TEXT_FIT_MODE",
"badge_template_last_name_shrink_at_line": "BADGE_TEMPLATE_LAST_NAME_SHRINK_AT_LINE",
"badge_template_last_name_font_family": "BADGE_TEMPLATE_LAST_NAME_FONT_FAMILY",
"badge_template_company_padding": "BADGE_TEMPLATE_COMPANY_PADDING",
"badge_template_company_text_align": "BADGE_TEMPLATE_COMPANY_TEXT_ALIGN",
"badge_template_company_font_casing": "BADGE_TEMPLATE_COMPANY_FONT_CASING",
"badge_template_company_font_size_min": "BADGE_TEMPLATE_COMPANY_FONT_SIZE_MIN",
"badge_template_company_font_size_max": "BADGE_TEMPLATE_COMPANY_FONT_SIZE_MAX",
"badge_template_company_text_fit_mode": "BADGE_TEMPLATE_COMPANY_TEXT_FIT_MODE",
"badge_template_company_text_fit_mode": "BADGE_TEMPLATE_COMPANY_SHRINK_AT_LINE",
"badge_template_company_font_family": "BADGE_TEMPLATE_COMPANY_FONT_FAMILY",
"badge_template_font_family": "BADGE_TEMPLATE_FONT_FAMILY",
"badge_template_qr_display": "BADGE_TEMPLATE_QR_DISPLAY",
Expand All @@ -2414,6 +2414,7 @@
"css_length_info": "a CSS length (e.g., px, %, mm)",
"margin_padding_info": "Enter 1 to 4 CSS lengths (e.g., 8mm for all sides, 5mm 2mm for top/bottom and left/right, 86mm 5mm 0px for top, left/right, bottom, or 10mm 5mm 8mm 5mm for top, right, bottom, left). Use units like mm, px, or %.",
"integer_value_info": "Integer value only (represents pixels, e.g., 20 for 20px)",
"shrink_info": "Sets the maximum number of lines allowed before text size starts to shrink.",
"url_info": "URL to file image at a CDN",
"badge_template_settings_updated": "Badge settings updated."
},
Expand Down
8 changes: 4 additions & 4 deletions src/reducers/badges/badge-settings-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,28 @@ const DEFAULT_BADGE_SETTINGS = {
BADGE_TEMPLATE_TITLE_FONT_CASING: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_TITLE_FONT_SIZE_MIN: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_TITLE_FONT_SIZE_MAX: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_TITLE_TEXT_FIT_MODE: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_TITLE_SHRINK_AT_LINE: { id: 0, value: "1", type: "TEXT" },
BADGE_TEMPLATE_TITLE_FONT_FAMILY: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_FIRST_NAME_PADDING: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_FIRST_NAME_TEXT_ALIGN: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_FIRST_NAME_FONT_CASING: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_FIRST_NAME_FONT_SIZE_MIN: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_FIRST_NAME_FONT_SIZE_MAX: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_FIRST_NAME_TEXT_FIT_MODE: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_FIRST_NAME_SHRINK_AT_LINE: { id: 0, value: "1", type: "TEXT" },
BADGE_TEMPLATE_FIRST_NAME_FONT_FAMILY: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_LAST_NAME_PADDING: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_LAST_NAME_TEXT_ALIGN: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_LAST_NAME_FONT_CASING: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_LAST_NAME_FONT_SIZE_MIN: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_LAST_NAME_FONT_SIZE_MAX: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_LAST_NAME_TEXT_FIT_MODE: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_LAST_NAME_SHRINK_AT_LINE: { id: 0, value: "1", type: "TEXT" },
BADGE_TEMPLATE_LAST_NAME_FONT_FAMILY: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_COMPANY_PADDING: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_COMPANY_TEXT_ALIGN: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_COMPANY_FONT_CASING: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_COMPANY_FONT_SIZE_MIN: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_COMPANY_FONT_SIZE_MAX: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_COMPANY_TEXT_FIT_MODE: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_COMPANY_SHRINK_AT_LINE: { id: 0, value: "1", type: "TEXT" },
BADGE_TEMPLATE_COMPANY_FONT_FAMILY: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_FONT_FAMILY: { id: 0, value: "", type: "TEXT" },
BADGE_TEMPLATE_QR_DISPLAY: { id: 0, value: "", type: "TEXT" },
Expand Down

0 comments on commit c493a41

Please sign in to comment.