Skip to content

Commit d2b2e31

Browse files
authored
fix: add new filter for no promo code tickets (#673)
* fix: add new filter for no promo code tickets Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com> * fix: update no promo code filter param Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com> --------- Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
1 parent 792d75e commit d2b2e31

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

src/actions/ticket-actions.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ const parseFilters = (filters, term = null) => {
192192
filter.push("exclude_is_printable_free_unassigned==1");
193193
}
194194

195+
if (filters?.noPromocodeFilter) {
196+
filter.push("has_promo_code==0");
197+
}
198+
195199
if (filters?.hasOwnerFilter) {
196200
if (filters.hasOwnerFilter === "HAS_OWNER") filter.push("has_owner==1");
197201
if (filters.hasOwnerFilter === "HAS_NO_OWNER") filter.push("has_owner==0");

src/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,7 @@
16211621
"show_printable": "Show Printable Tickets",
16221622
"show_printable_info": "Active assigned ticket with the access level of IN_PERSON",
16231623
"exclude_free_unassigned": "Exclude ALL free unassigned tickets?",
1624+
"no_promo_code": "Exclude ALL tickets with promo codes?",
16241625
"items_qty": "Selected {qty} Tickets",
16251626
"select_view_2_print": "Select a View Type to Print",
16261627
"select_fields": "Show Columns",

src/pages/tickets/ticket-list-page.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ const defaultFilters = {
131131
isActiveFilter: null,
132132
showOnlyPrintable: false,
133133
excludeFreeUnassigned: false,
134+
noPromocodeFilter: false,
134135
promocodesFilter: [],
135136
promocodeTagsFilter: [],
136137
accessLevelFilter: [],
@@ -412,6 +413,7 @@ class TicketListPage extends React.Component {
412413
isActiveFilter: null,
413414
showOnlyPrintable: false,
414415
excludeFreeUnassigned: false,
416+
noPromocodeFilter: false,
415417
promocodesFilter: [],
416418
promocodeTagsFilter: [],
417419
badgeTypesFilter: [],
@@ -732,6 +734,10 @@ class TicketListPage extends React.Component {
732734
label: T.translate("ticket_list.exclude_free_unassigned"),
733735
value: "excludeFreeUnassigned"
734736
},
737+
{
738+
label: T.translate("ticket_list.no_promo_code"),
739+
value: "noPromocodeFilter"
740+
},
735741
{
736742
label: T.translate("ticket_list.badge_type"),
737743
value: "badgeTypesFilter"
@@ -1259,6 +1265,30 @@ class TicketListPage extends React.Component {
12591265
</div>
12601266
</div>
12611267
)}
1268+
{enabledFilters.includes("noPromocodeFilter") && (
1269+
<div className="col-md-6">
1270+
<div className="form-check abc-checkbox">
1271+
<input
1272+
type="checkbox"
1273+
id="noPromocodeFilter"
1274+
checked={ticketFilters.noPromocodeFilter}
1275+
onChange={(ev) =>
1276+
this.handleFilterChange(
1277+
"noPromocodeFilter",
1278+
ev.target.checked
1279+
)
1280+
}
1281+
className="form-check-input"
1282+
/>
1283+
<label
1284+
className="form-check-label"
1285+
htmlFor="noPromocodeFilter"
1286+
>
1287+
{T.translate("ticket_list.no_promo_code")} &nbsp;
1288+
</label>
1289+
</div>
1290+
</div>
1291+
)}
12621292
{enabledFilters.includes("badgeTypesFilter") && (
12631293
<div className="col-md-6">
12641294
<Select

0 commit comments

Comments
 (0)