Skip to content

Commit

Permalink
Fix whitespace replace, update data from API on save
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 21, 2024
1 parent 5d09179 commit a13d194
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/forms/summit-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class SummitForm extends React.Component {

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

render() {
Expand Down Expand Up @@ -400,7 +400,7 @@ class SummitForm extends React.Component {
/>
</div>
<div className="col-md-4">
<label> {T.translate("edit_summit.registration_slug")}</label>
<label> {T.translate("edit_summit.registration_slug")} *</label>
<Input
className="form-control"
error={this.hasErrors('registration_slug_prefix')}
Expand Down
3 changes: 2 additions & 1 deletion src/reducers/summits/current-summit-reducer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import{ VALIDATE } from 'openstack-uicore-foundation/lib/utils/actions';
import{ LOGOUT_USER } from 'openstack-uicore-foundation/lib/security/actions';
import { SET_CURRENT_SUMMIT, REQUEST_SUMMIT,RECEIVE_SUMMIT, UPDATE_SUMMIT, SUMMIT_ADDED, RESET_SUMMIT_FORM, SUMMIT_LOGO_ATTACHED,
import { SET_CURRENT_SUMMIT, REQUEST_SUMMIT,RECEIVE_SUMMIT, UPDATE_SUMMIT, SUMMIT_ADDED, SUMMIT_UPDATED, RESET_SUMMIT_FORM, SUMMIT_LOGO_ATTACHED,
SUMMIT_LOGO_DELETED, CLEAR_SUMMIT, REGISTRATION_KEY_GENERATED, RECEIVE_LEAD_REPORT_SETTINGS_META, LEAD_REPORT_SETTINGS_UPDATED } from '../../actions/summit-actions';
import { EVENT_CATEGORY_UPDATED, EVENT_CATEGORY_ADDED, EVENT_CATEGORY_DELETED, EVENT_CATEGORIES_SEEDED, UNLINK_SUBTRACK } from '../../actions/event-category-actions';
import { EVENT_TYPE_UPDATED, EVENT_TYPE_ADDED, EVENT_TYPE_DELETED, EVENT_TYPES_SEEDED } from '../../actions/event-type-actions';
Expand Down Expand Up @@ -191,6 +191,7 @@ const currentSummitReducer = (state = DEFAULT_STATE, action) => {
return DEFAULT_STATE;
}
case SUMMIT_ADDED:
case SUMMIT_UPDATED:
case RECEIVE_SUMMIT: {
let entity = {...payload.response};

Expand Down

0 comments on commit a13d194

Please sign in to comment.