Skip to content

Commit

Permalink
Merge branch 'main' into add-data-provider-to-manage-images
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexITC committed Sep 5, 2024
2 parents 00dbce6 + 4fc38d1 commit d645f56
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build the app

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]

concurrency:
# Only run once for latest commit per ref and cancel other (previous) runs.
Expand Down Expand Up @@ -36,4 +36,4 @@ jobs:
run: CI=true sbt +compile

- name: Run tests
run: CI=true sbt +test
run: CI=true sbt +test
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ val sttp = "3.5.0"
val anorm = "2.7.0"
val scalaTestPlusPlay = "6.0.0-M6"
val scalaTestPlusMockito = "3.2.15.0"
val reactAdmin = "4.14.3"
val reactAdmin = "4.14.4"

val consoleDisabledOptions = Seq("-Xfatal-warnings", "-Ywarn-unused", "-Ywarn-unused-import")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object ListGuesser {
val component: FunctionalComponent[Props] = FunctionalComponent[Props] { props =>
val fields = ResponseGuesser.getTypesFromResponse(props.response)

def defaultField(reference: String, source: String)(children: ReactElement*): ReactElement =
def defaultField(reference: String, source: String)(children: ReactElement): ReactElement =
ReferenceField(reference = reference, source = source)(children)

val widgetFields: Seq[ReactElement] = fields.map { field =>
Expand Down Expand Up @@ -49,7 +49,14 @@ object ListGuesser {
case ColumnType.Image => Fragment()
case ColumnType.Number => NumberInput(source = field.name)
case ColumnType.Reference(reference, source) =>
defaultField(reference, field.name)(TextField(source = source))
ReferenceInput(
source = field.name,
reference = reference
)(
SelectInput(
optionText = props.response.referenceDisplayField.getOrElse(source)
)
)
}
}

Expand Down

0 comments on commit d645f56

Please sign in to comment.