Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mandatory items #19

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
5ef010e
Fixed OSF stuff
smarcet Sep 25, 2020
d7b8af9
enable pres atachment on openstack
santipalenque Sep 25, 2020
cbcadf5
fix filename on upload input
santipalenque Sep 28, 2020
300c09f
change Title to JobTitle
santipalenque Sep 30, 2020
85b7fcf
fix missing media uploads on edit pres
santipalenque Oct 20, 2020
1da7733
new uploads tab
santipalenque Oct 21, 2020
bf2249a
bugfixes on upload
santipalenque Oct 21, 2020
302ff40
bugifx
santipalenque Oct 21, 2020
e761ec5
fix back button
santipalenque Oct 21, 2020
202ef4f
hide add button
santipalenque Oct 21, 2020
28b8532
bigfix
santipalenque Oct 23, 2020
46ac2be
disable title edit
santipalenque Oct 27, 2020
912d641
CAUTION - upload input upgrade
santipalenque Oct 28, 2020
52f647d
upoad input fix
santipalenque Oct 28, 2020
8079497
adjustments to upload process
santipalenque Nov 2, 2020
f208c1e
remove error when file uploads
santipalenque Nov 2, 2020
5f99028
update upload input - uicore
santipalenque Nov 9, 2020
3084398
update nav according to uploads
santipalenque Dec 2, 2020
520fc20
Refactoring on AUTH
smarcet Jan 28, 2021
e98aab1
Fixed op filter condition
smarcet Feb 16, 2021
4e839e2
fix tab navigation
santipalenque Apr 16, 2021
73547db
fix bug on tab navigation
santipalenque Apr 16, 2021
6588efe
nav fix again
santipalenque Apr 16, 2021
4181627
fix summit docs
santipalenque Apr 19, 2021
efc8475
update uicore
santipalenque Apr 20, 2021
27ab022
update dropzone
santipalenque Apr 20, 2021
84aeb78
roll back and fix dropzone version
santipalenque Apr 20, 2021
43f2610
remove levels if not allowed on type, do not validate speakers or mod…
santipalenque Apr 21, 2021
539bc49
add speakers attend question
santipalenque Apr 29, 2021
387a27a
adding default value to will_speakers_attend
santipalenque Apr 29, 2021
176a8db
Update presentation-summary-form.js
smarcet Apr 29, 2021
051e59e
Fixed languages edition on speaker form
smarcet Apr 30, 2021
1180d79
ui tweaks
smarcet May 20, 2021
97e9dca
Added selection plan extra questions
smarcet May 27, 2021
fe7e647
Added checkbox disclaimmer
smarcet May 28, 2021
b708c69
Removed social description validation rule
smarcet May 28, 2021
e67d68b
Fixed UX on speakers selection form
smarcet May 28, 2021
4eddfcf
Added html support to extra question labels
smarcet Jun 2, 2021
0feb542
Fixed title and dates on landing screen
smarcet Jun 3, 2021
6e12fda
Fixed date format
smarcet Jun 3, 2021
5d5d92e
add alpha sorting on track names
smarcet Jun 4, 2021
36e09fc
Fix on presentation form
smarcet Jun 7, 2021
57e3731
Fix on new speaker creation
smarcet Jun 14, 2021
7eac015
Add new speaker tweaks
smarcet Jun 14, 2021
0c85e48
Addition of asterisks for mandatory items in proposal submission
romanetar Jun 20, 2021
0456943
Fix on get all summits query
smarcet Jun 21, 2021
a4737ca
Addition of asterisks for mandatory items in proposal submission
romanetar Jun 20, 2021
6e6a6a0
Addition of asterisks for mandatory items in proposal submission
romanetar Jul 7, 2021
fafdda3
Merge branch 'master' into feature/mandatory-items
romanetar Jul 7, 2021
6b96783
Addition of asterisks for mandatory items in proposal submission
romanetar Jul 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,688 changes: 2,259 additions & 2,429 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"clean-webpack-plugin": "^3.0.0",
"css-loader": "^3.1.0",
"dotenv-webpack": "^1.7.0",
"dropzone": "5.7.2",
"file-loader": "^4.1.0",
"file-saver": "^2.0.2",
"font-awesome": "^4.7.0",
Expand All @@ -39,7 +40,7 @@
"moment": "^2.22.2",
"moment-timezone": "^0.5.21",
"node-sass": "^4.11.0",
"openstack-uicore-foundation": "2.0.53",
"openstack-uicore-foundation": "2.1.2",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"postcss-loader": "^2.1.6",
"react": "^16.6.3",
Expand Down
36 changes: 5 additions & 31 deletions src/actions/auth-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@
import {
createAction,
getRequest,
showMessage,
startLoading,
stopLoading,
authErrorHandler,
initLogOut
initLogOut,
getUserInfo,
} from "openstack-uicore-foundation/lib/methods";

import {REQUEST_USER_INFO, RECEIVE_USER_INFO} from 'openstack-uicore-foundation/lib/actions';


import history from '../history'
import T from "i18n-react/dist/i18n-react";
import Swal from "sweetalert2";
Expand Down Expand Up @@ -64,40 +61,17 @@ export const speakerErrorHandler = (err, res) => (dispatch, getState) => {

if (code == 404) {
// speaker not found
//try to get member

Swal.fire({
title: T.translate("landing.speaker_profile_required"),
text: T.translate("landing.speaker_profile_required_text"),
type: "warning",
});

return getRequest(
createAction(REQUEST_USER_INFO),
createAction(RECEIVE_USER_INFO),
`${window.API_BASE_URL}/api/v1/members/me?expand=groups&access_token=${accessToken}`,
authErrorHandler
)({})(dispatch, getState).then(() => {
dispatch(stopLoading());

let { member } = getState().loggedUserState;
if( member == null || member == undefined){
let error_message = {
title: 'ERROR',
html: T.translate("errors.user_not_set"),
type: 'error'
};

dispatch(showMessage( error_message, initLogOut ));
return;
}

const redirectUrl = baseState.summit ? `/app/${baseState.summit.slug}/profile` : '/app/profile';
history.push(redirectUrl);
});

const backUrl = baseState.summit ? `/app/${baseState.summit.slug}/profile` : '/app/profile';
//try to get member
return getUserInfo('groups', backUrl, history)(dispatch, getState);
}
dispatch(authErrorHandler(err, res));

}

94 changes: 61 additions & 33 deletions src/actions/base-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ export const RECEIVE_SUMMIT = 'RECEIVE_SUMMIT';
export const RECEIVE_SELECTION_PLAN = 'RECEIVE_SELECTION_PLAN';
export const RECEIVE_MARKETING_SETTINGS = 'RECEIVE_MARKETING_SETTINGS';
export const RECEIVE_AVAILABLE_SUMMITS = 'RECEIVE_AVAILABLE_SUMMITS';
export const SUMMIT_DOCS_RECEIVED = 'SUMMIT_DOCS_RECEIVED';
export const ERROR_RECEIVE_SUMMIT = 'ERROR_RECEIVE_SUMMIT';
export const CLEAR_SUMMIT = 'CLEAR_SUMMIT';
export const BASE_LOADED = 'BASE_LOADED';


export const resetLoading = () => (dispatch, getState) => {
Expand All @@ -51,7 +53,7 @@ export const clearCurrentSummit = () => (dispatch, getState) => {
export const getCurrentSelectionPlanPublic = (summit_id) => (dispatch, getState) => {

let params = {
expand: 'summit,track_groups'
expand: 'summit,track_groups,extra_questions,extra_questions.values'
};

return getRequest(
Expand All @@ -65,38 +67,19 @@ export const getCurrentSelectionPlanPublic = (summit_id) => (dispatch, getState)

export const getAllFromSummit = (summitSlug) => (dispatch, getState) => {
dispatch(startLoading());
dispatch(createAction(BASE_LOADED)({loaded: false}));
return getCurrentSummitPublic(summitSlug)(dispatch, getState)
.then(({response}) => {
getMarketingSettings(response.id)(dispatch, getState);
return response.id;
})
.then((summitId) => getCurrentSelectionPlanPublic(summitId)(dispatch, getState))
.then(() => { dispatch(stopLoading()); });
}

const currentSummitErrorHandler = (err, res) => (dispatch, state) => {
let code = err.status;
let msg = '';
const marketing = getMarketingSettings(response.id)(dispatch, getState);
const summitDocs = getAllSummitDocs(response.id)(dispatch, getState);
const selPlan = getCurrentSelectionPlanPublic(response.id)(dispatch, getState)

dispatch(stopLoading());

switch (code) {
case 404:
msg = "";
if (err.response.body && err.response.body.message) msg = err.response.body.message;
else if (err.response.error && err.response.error.message) msg = err.response.error.message;
else msg = err.message;
// clear state
dispatch(createAction(ERROR_RECEIVE_SUMMIT)({}));
Swal.fire("Not Found", msg, "warning");
// back selection page
history.push('/');
break;
default:
Swal.fire("ERROR", T.translate("errors.server_error"), "error");
break
}
}
return Promise.all([marketing, selPlan, summitDocs]).then(() => {
dispatch(createAction(BASE_LOADED)({loaded: true}));
dispatch(stopLoading());
});
});
};

export const getCurrentSummitPublic = (id) => (dispatch, getState) => {

Expand All @@ -120,7 +103,8 @@ export const getAvailableSummits = () => (dispatch, getState) => {
const secondsSinceEpoch = Math.round(Date.now() / 1000);

let filters = [
`start_date=>${secondsSinceEpoch}`,
`submission_begin_date<=${secondsSinceEpoch}`,
`submission_end_date>=${secondsSinceEpoch}`,
'selection_plan_enabled==1'
];

Expand Down Expand Up @@ -185,7 +169,7 @@ export const loadEventCategory = () => (dispatch, getState) => {
dispatch(startLoading());

let params = {
expand : "allowed_tags,extra_questions",
expand : "allowed_tags",
access_token : accessToken,
};

Expand Down Expand Up @@ -216,6 +200,50 @@ export const getMarketingSettings = (summitId) => (dispatch, getState) => {
};


export const getAllSummitDocs = (summitId) => (dispatch, getState) => {


let { loggedUserState } = getState();
let { accessToken } = loggedUserState;

if (!accessToken) return;

let params = {
access_token : accessToken,
};

return getRequest(
null,
createAction(SUMMIT_DOCS_RECEIVED),
`${window.API_BASE_URL}/api/v1/summits/${summitId}/summit-documents`,
authErrorHandler
)(params)(dispatch);
};

const currentSummitErrorHandler = (err, res) => (dispatch, state) => {
let code = err.status;
let msg = '';

dispatch(stopLoading());

switch (code) {
case 404:
msg = "";
if (err.response.body && err.response.body.message) msg = err.response.body.message;
else if (err.response.error && err.response.error.message) msg = err.response.error.message;
else msg = err.message;
// clear state
dispatch(createAction(ERROR_RECEIVE_SUMMIT)({}));
Swal.fire("Not Found", msg, "warning");
// back selection page
history.push('/');
break;
default:
Swal.fire("ERROR", T.translate("errors.server_error"), "error");
break
}
};

export const selectionPlanErrorHandler = (err, res) => (dispatch) => {
let code = err.status;
dispatch(stopLoading());
Expand Down Expand Up @@ -251,5 +279,5 @@ export const selectionPlanErrorHandler = (err, res) => (dispatch) => {
default:
Swal.fire("ERROR", T.translate("errors.server_error"), "error");
}
}
};

Loading