Skip to content

Commit

Permalink
learningpath-api: Adds madeAvailable field to learningpaths
Browse files Browse the repository at this point in the history
Currently a dumb field only extended the models.
Next patch needs to implement the actual setting of the field when
status is updated
  • Loading branch information
jnatten committed Nov 22, 2024
1 parent 000ebd9 commit eed8235
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ case class LearningPath(
owner: String,
copyright: LearningpathCopyright,
learningsteps: Option[Seq[LearningStep]] = None,
message: Option[Message] = None
message: Option[Message] = None,
madeAvailable: Option[NDLADate] = None
) extends Content {

def supportedLanguages: Seq[String] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ case class LearningPathV2(
@description("True if authenticated user may edit this learningpath") canEdit: Boolean,
@description("The supported languages for this learningpath") supportedLanguages: Seq[String],
@description("Visible if administrator or owner of LearningPath") ownerId: Option[String],
@description("Message set by administrator. Visible if administrator or owner of LearningPath") message: Option[Message]
@description("Message set by administrator. Visible if administrator or owner of LearningPath") message: Option[Message],
@description("The date when this learningpath was made available to the public.") madeAvailable: Option[NDLADate]
)

object LearningPathV2 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ trait ConverterService {
lp.canEdit(userInfo),
supportedLanguages,
owner,
message
message,
lp.madeAvailable
)
)
} else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class ConverterServiceTest extends UnitSuite with UnitTestEnvironment {
true,
List("nb"),
None,
None,
None
)
val domainLearningStep: LearningStep =
Expand Down Expand Up @@ -137,6 +138,7 @@ class ConverterServiceTest extends UnitSuite with UnitTestEnvironment {
canEdit = true,
List("nb", "en"),
None,
None,
None
)
)
Expand Down Expand Up @@ -188,6 +190,7 @@ class ConverterServiceTest extends UnitSuite with UnitTestEnvironment {
true,
List("nb", "en"),
None,
None,
None
)
)
Expand Down

0 comments on commit eed8235

Please sign in to comment.