Skip to content

Commit

Permalink
ticket type on attendee list filters
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 13, 2024
1 parent 538ad7e commit c024602
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
5 changes: 4 additions & 1 deletion src/actions/attendee-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ const parseFilters = (filters, term = null) => {
Array.isArray(filters.ticketTypeFilter) &&
filters.ticketTypeFilter.length > 0
) {
filter.push(`ticket_type_id==${filters.ticketTypeFilter.join("||")}`);
const ticketTypesIds = filters.ticketTypeFilter.map((tt) =>
tt.hasOwnProperty("id") ? tt.id : tt
);
filter.push(`ticket_type_id==${ticketTypesIds.join("||")}`);
}

if (filters?.companyFilter?.length > 0) {
Expand Down
24 changes: 11 additions & 13 deletions src/pages/attendees/summit-attendees-list-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import {
SelectableTable,
DateTimePicker,
TagInput,
CompanyInput
CompanyInput,
TicketTypesInput
} from "openstack-uicore-foundation/lib/components";
import { epochToMomentTimeZone } from "openstack-uicore-foundation/lib/utils/methods";
import { SegmentedControl } from "segmented-control";
Expand Down Expand Up @@ -160,7 +161,7 @@ class SummitAttendeeListPage extends React.Component {
}

handleChangeFlowEvent(ev) {
const { value, id } = ev.target;
const { value } = ev.target;
this.props.setCurrentFlowEvent(value);
}

Expand Down Expand Up @@ -298,7 +299,7 @@ class SummitAttendeeListPage extends React.Component {
);
}

handleSort(index, key, dir, func) {
handleSort(index, key, dir) {
const { page, perPage, term } = this.props;
const { attendeeFilters, selectedColumns } = this.state;
key = key === "name" ? "full_name" : key;
Expand Down Expand Up @@ -327,7 +328,7 @@ class SummitAttendeeListPage extends React.Component {
);
}

handleNewAttendee(ev) {
handleNewAttendee() {
const { currentSummit, history } = this.props;
history.push(`/app/summits/${currentSummit.id}/attendees/new`);
}
Expand Down Expand Up @@ -490,8 +491,7 @@ class SummitAttendeeListPage extends React.Component {
currentFlowEvent,
selectedAll,
badgeFeatures,
badgeTypes,
sendEmails
badgeTypes
} = this.props;

const {
Expand Down Expand Up @@ -605,10 +605,6 @@ class SummitAttendeeListPage extends React.Component {
}
];

const ticketTypesDDL = [
...currentSummit.ticket_types.map((t) => ({ label: t.name, value: t.id }))
];

const featuresTypesDDL = [
...badgeFeatures.map((bf) => ({ label: bf.name, value: bf.id }))
];
Expand Down Expand Up @@ -922,15 +918,17 @@ class SummitAttendeeListPage extends React.Component {
className="col-md-6"
style={{ minHeight: "61px", paddingTop: "8px" }}
>
<Dropdown
<TicketTypesInput
id="ticketTypeFilter"
value={attendeeFilters.ticketTypeFilter}
onChange={this.handleExtraFilterChange}
options={ticketTypesDDL}
isClearable
placeholder={T.translate(
"attendee_list.placeholders.ticket_type"
)}
version="v2"
summitId={currentSummit.id}
optionsLimit={100}
defaultOptions
isMulti
/>
</div>
Expand Down

0 comments on commit c024602

Please sign in to comment.