remove autofilled title value from contentNode#2675
remove autofilled title value from contentNode#2675rtibbles merged 2 commits intolearningequality:developfrom
Conversation
There was a problem hiding this comment.
I saw the related discussion and it makes sense to remove automatically filled title. Though it doesn't seem to be the primary cause of issues described in #2565.
The following seems to be happening:
createContentNodeaction is called with an auto filled title value in its payload- This payload gets merged after the default content node data here but
completefield stays set to defaultfalsevalue even though there might be data in the payload that make the new node valid.
Although this PR helps, I assume that it's because when the topic title is left empty, complete should indeed be false because that's not a valid state for a topic, so it's not a problem that default false value for complete is used. When someone updates the topic later, updateContentNode is called and in it, complete field is updated.
I'd suggest fixing this issue in createContentNode so that we can be sure that validation is up to date whenever we call this action. Doing something like:
const contentNodeData = {
title: '',
description: '',
kind,
tags: {},
extra_fields: {},
[NEW_OBJECT]: true,
changed: true,
language: session.preferences ? session.preferences.language : session.currentLanguage,
parent,
...contentDefaults,
role_visibility: contentDefaults.role_visibility || RolesNames.LEARNER,
...payload,
};
contentNodeData.complete = isNodeComplete({ nodeDetails: contentNodeData, assessmentItems: [], files: [] })
should help.
I didn't read the requested changes closely enough
|
@marcellamaki and I took a look at this today and found some funny stuff going on that might point to other underlying issues. Since it's not super high stakes, we decided it'd be best to leave this as is until @MisRob gets a chance to take a look. |
|
Since the UX part of the issue that the PR addresses is no longer reproducible on develop, I don't think these changes need to be merged prior to Studio relaunch. I am going to pause on this PR and put back as a draft/WIP, and reconnect with @MisRob to review her suggestions/comments about potential underlying improvements that could be made and decide how to proceed after that. |
Codecov Report
@@ Coverage Diff @@
## develop #2675 +/- ##
===========================================
- Coverage 85.14% 84.94% -0.21%
===========================================
Files 299 309 +10
Lines 15077 15367 +290
===========================================
+ Hits 12838 13054 +216
- Misses 2239 2313 +74
Continue to review full report at Codecov.
|
Addresses #2565
Before/After Screenshots (if applicable)
Before:

After:

Steps to Test