forked from OpenStackweb/summit-admin
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ticket type input on promocodes and attendee ticket modal
Signed-off-by: Tomás Castillo <[email protected]>
- Loading branch information
Showing
5 changed files
with
70 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 23 additions & 27 deletions
50
src/components/forms/promocode-form/forms/generic-base-pc-form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
import React from "react"; | ||
import T from "i18n-react"; | ||
import { TicketTypesInput } from "openstack-uicore-foundation/lib/components"; | ||
import BasePCForm from "./base-pc-form"; | ||
import { Dropdown } from "openstack-uicore-foundation/lib/components"; | ||
|
||
const GenericBasePCForm = (props) => { | ||
let ticket_types_ddl = props.summit.ticket_types.map((f) => ({ | ||
label: f.name, | ||
value: f.id | ||
})); | ||
|
||
return ( | ||
<> | ||
<BasePCForm {...props} /> | ||
<div className="row form-group"> | ||
<div className="col-md-6"> | ||
<label> {T.translate("edit_promocode.allowed_ticket_types")}</label> | ||
<Dropdown | ||
id="allowed_ticket_types" | ||
value={props.entity.allowed_ticket_types} | ||
onChange={props.handleChange} | ||
placeholder={T.translate( | ||
"edit_promocode.placeholders.select_ticket_types" | ||
)} | ||
options={ticket_types_ddl} | ||
isMulti | ||
/> | ||
</div> | ||
const GenericBasePCForm = (props) => ( | ||
<> | ||
<BasePCForm {...props} /> | ||
<div className="row form-group"> | ||
<div className="col-md-6"> | ||
<label> {T.translate("edit_promocode.allowed_ticket_types")}</label> | ||
<TicketTypesInput | ||
id="allowed_ticket_types" | ||
value={props.entity.allowed_ticket_types} | ||
onChange={props.handleChange} | ||
placeholder={T.translate( | ||
"edit_promocode.placeholders.select_ticket_types" | ||
)} | ||
summitId={props.summit.id} | ||
version="v2" | ||
defaultOptions | ||
optionsLimit={100} | ||
isMulti | ||
/> | ||
</div> | ||
</> | ||
); | ||
}; | ||
</div> | ||
</> | ||
); | ||
|
||
export default GenericBasePCForm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters