-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat: hide 2U specific fields #797
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
NODE_ENV='production' | ||
IDENTIFIER_2U='2U' | ||
BASE_URL=null | ||
LMS_BASE_URL=null | ||
STUDIO_BASE_URL=null | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,4 +1,5 @@ | ||||||
NODE_ENV='development' | ||||||
IDENTIFIER_2U='2U' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
PORT=18400 | ||||||
BASE_URL='localhost:18400' | ||||||
LMS_BASE_URL='http://localhost:18000' | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,3 +5,4 @@ LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg | |||||
LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg | ||||||
FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico | ||||||
SITE_NAME='edX' | ||||||
IDENTIFIER_2U='2U' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,6 +6,7 @@ import { | |||||
import { Link } from 'react-router-dom'; | ||||||
import { connect } from 'react-redux'; | ||||||
import { compose } from 'redux'; | ||||||
import { getConfig } from '@edx/frontend-platform'; | ||||||
import { getAuthenticatedUser } from '@edx/frontend-platform/auth'; | ||||||
import { Icon, Hyperlink, Chip } from '@edx/paragon'; | ||||||
import { CloseSmall } from '@edx/paragon/icons'; | ||||||
|
@@ -226,6 +227,10 @@ export class BaseEditCourseForm extends React.Component { | |||||
this.setCollapsible(true); | ||||||
} | ||||||
|
||||||
filterCourseTypes2U(courseType) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we remove "2U" from the object and parameter names we can avoid confusion in the future, making this a truly generic feature.
Suggested change
|
||||||
return courseType.label.includes(getConfig().IDENTIFIER_2U); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
render() { | ||||||
const { | ||||||
handleSubmit, | ||||||
|
@@ -306,6 +311,7 @@ export class BaseEditCourseForm extends React.Component { | |||||
priceLabels, | ||||||
runTypeModes, | ||||||
} = parsedTypeOptions; | ||||||
const courseTypes2U = courseTypeOptions.filter(this.filterCourseTypes2U); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
const disabled = courseInReview || !editable; | ||||||
const showMarketingFields = !currentFormValues.type || !courseTypes[currentFormValues.type] | ||||||
|| courseTypes[currentFormValues.type].course_run_types.some((crt) => crt.is_marketable); | ||||||
|
@@ -1046,34 +1052,38 @@ export class BaseEditCourseForm extends React.Component { | |||||
className="course-skill" | ||||||
/> | ||||||
)} | ||||||
<Field | ||||||
name="organization_short_code_override" | ||||||
component={RenderInputTextField} | ||||||
label={ | ||||||
<FieldLabel text="Organization Short Code Override" optional /> | ||||||
} | ||||||
extraInput={{ onInvalid: this.openCollapsible }} | ||||||
disabled={disabled} | ||||||
optional | ||||||
/> | ||||||
<Field | ||||||
name="organization_logo_override_url" | ||||||
component={ImageUpload} | ||||||
label={( | ||||||
<FieldLabel | ||||||
id="organization_logo_override.label" | ||||||
text="Organization Logo Override" | ||||||
{courseTypes2U?.length > 0 && ( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<> | ||||||
<Field | ||||||
name="organization_short_code_override" | ||||||
component={RenderInputTextField} | ||||||
label={ | ||||||
<FieldLabel text="Organization Short Code Override" optional /> | ||||||
} | ||||||
extraInput={{ onInvalid: this.openCollapsible }} | ||||||
disabled={disabled} | ||||||
optional | ||||||
/> | ||||||
)} | ||||||
extraInput={{ onInvalid: this.openCollapsible }} | ||||||
id="organization-logo-override" | ||||||
className="course-image" | ||||||
maxImageSizeKilo={256} | ||||||
requiredWidth={110} | ||||||
requiredHeight={110} | ||||||
disabled={disabled} | ||||||
optional | ||||||
/> | ||||||
<Field | ||||||
name="organization_logo_override_url" | ||||||
component={ImageUpload} | ||||||
label={( | ||||||
<FieldLabel | ||||||
id="organization_logo_override.label" | ||||||
text="Organization Logo Override" | ||||||
/> | ||||||
)} | ||||||
extraInput={{ onInvalid: this.openCollapsible }} | ||||||
id="organization-logo-override" | ||||||
className="course-image" | ||||||
maxImageSizeKilo={256} | ||||||
requiredWidth={110} | ||||||
requiredHeight={110} | ||||||
disabled={disabled} | ||||||
optional | ||||||
/> | ||||||
</> | ||||||
)} | ||||||
{administrator && ( | ||||||
<> | ||||||
<FieldLabel text="Merchandising Location Restriction" className="mb-2" /> | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename this as well, and remove the "2U" default setting which does not make sense for all use cases.