Skip to content

Commit

Permalink
Add new field for registration slug prefix on summit form
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Castillo <[email protected]>
  • Loading branch information
tomrndom committed Jun 20, 2024
1 parent abb24d9 commit 5d09179
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/components/forms/summit-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class SummitForm extends React.Component {
this.handleAttributeTypeEdit = this.handleAttributeTypeEdit.bind(this);
this.handleNewAttributeType = this.handleNewAttributeType.bind(this);
this.getHelpUsersOptionLabel = this.getHelpUsersOptionLabel.bind(this);
this.handleSampleNumber = this.handleSampleNumber.bind(this);
}

componentDidUpdate(prevProps, prevState, snapshot) {
Expand Down Expand Up @@ -304,6 +305,11 @@ class SummitForm extends React.Component {
this.props.generateEncryptionKey();
}

handleSampleNumber(type) {
const {entity} = this.state;
return `${type}_${entity.registration_slug_prefix}_662A968F26820246192380`.trim().toUpperCase().replace(" ", "_");
}

render() {
const {entity, showSection, regLiteMarketingSettings, printAppMarketingSettings, regFeedMetadataListSettings} = this.state;
const {timezones, onSPlanDelete, onAttributeTypeDelete, onRegFeedMetadataDelete} = this.props;
Expand Down Expand Up @@ -393,7 +399,32 @@ class SummitForm extends React.Component {
onChange={this.handleChange}
/>
</div>
<div className="col-md-4">
<label> {T.translate("edit_summit.registration_slug")}</label>
<Input
className="form-control"
error={this.hasErrors('registration_slug_prefix')}
id="registration_slug_prefix"
value={entity.registration_slug_prefix}
disabled={entity.paid_tickets_count > 0}
onChange={this.handleChange}
/>
</div>
</div>
{entity.registration_slug_prefix &&
<div className="row form-group">
<div className="col-md-6">
<label> {T.translate("edit_summit.sample_order_qr_prefix")}</label>
<br/>
<span> {this.handleSampleNumber("order")}</span>
</div>
<div className="col-md-6">
<label> {T.translate("edit_summit.sample_ticket_qr_prefix")}</label>
<br/>
<span> {this.handleSampleNumber("ticket")}</span>
</div>
</div>
}
<div className="row form-group">
<div className="col-md-4">
<label> {T.translate("edit_summit.link")}</label>
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@
"external_summit_id": "External Id",
"max_submission_allowed_per_user": "Max. Submissions per User",
"slug": "Slug",
"registration_slug": "Registration Slug",
"sample_order_qr_prefix": "Sample Order Number",
"sample_ticket_qr_prefix": "Sample Ticket Number",
"link": "Event Page Link",
"registration_link": "Registration Link",
"registration_disclaimer_content": "Disclaimer",
Expand Down
1 change: 1 addition & 0 deletions src/reducers/summits/current-summit-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const DEFAULT_ENTITY = {
registration_link: '',
registration_disclaimer_content: '',
registration_disclaimer_mandatory: false,
registration_slug_prefix: '',
schedule_event_detail_url: '',
schedule_page_url: '',
schedule_start_date: 0,
Expand Down

0 comments on commit 5d09179

Please sign in to comment.