Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/course-outline/data/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export async function configureCourseSubsection(
*/
export async function configureCourseUnit(variables: ConfigureUnitData): Promise<object> {
const body = {
publish: variables.groupAccess ? null : variables.type,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@navinkarkera, I am not sure if this was an intentional change in 806135e#diff-d8acab706381e84f07184d02fabb56bdd3c592155995f442f50fdd56493fba52R313. Could you please confirm?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Anas12091101 Actually, I updated this to match and remove duplicate configure course unit visibility api function: here

This means that before it was not consistent, changing visibility from unit page required a publish while changing visibility from outline did not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@navinkarkera, has there been a decision to require publishing from the outline page? If so, could you point me to the relevant discussion or reference?

Also, the check variables.groupAccess ? null : variables.type will evaluate to null even when groupAccess is an empty object ({}). Is that intentional?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has there been a decision to require publishing from the outline page? If so, could you point me to the relevant discussion or reference?

@Anas12091101 Nope, I just shared why this change came into picture. I don't mind it in either way (auto publish or not), so no objections to this PR.

Also, the check variables.groupAccess ? null : variables.type will evaluate to null even when groupAccess is an empty object ({}). Is that intentional?

No, like I said, it was copied/moved over from duplicate function from unit page.

publish: variables.type,
...(variables.type === PUBLISH_TYPES.republish ?
{
metadata: {
Expand Down
2 changes: 1 addition & 1 deletion src/course-unit/CourseUnit.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ describe('<CourseUnit />', () => {

axiosMock
.onPost(getXBlockBaseApiUrl(courseSectionVerticalMock.xblock_info.id), {
publish: null,
publish: 'republish',
metadata: { visible_to_staff_only: true, group_access: { 50: [2] }, discussion_enabled: true },
})
.reply(200, { dummy: 'value' });
Expand Down