Skip to content

Commit 36d22f5

Browse files
committed
Merge branch 'master' into language-code-param
2 parents 0fef9d5 + 17e22de commit 36d22f5

File tree

69 files changed

+507
-720
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+507
-720
lines changed

.github/workflows/typescript-generate.yml

+13
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: 'Generate typescript types'
22
on:
33
workflow_dispatch:
44
inputs: { }
5+
push:
6+
branches:
7+
- master
58
env:
69
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_CLIENT_ID }}
710
AWS_DEFAULT_REGION: eu-west-1
@@ -13,6 +16,16 @@ env:
1316
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
1417
NDLA_RELEASES: ${{ secrets.NDLA_RELEASES }}
1518
KNOWIT_EMAIL: ${{ secrets.KNOWIT_EMAIL }}
19+
# Env variables needed to be defined for servers to "start"
20+
BRIGHTCOVE_ACCOUNT_ID: ""
21+
BRIGHTCOVE_PLAYER_ID: ""
22+
META_USER_NAME: ""
23+
META_PASSWORD: ""
24+
META_RESOURCE: ""
25+
META_SERVER: ""
26+
META_PORT: 5432
27+
META_SCHEMA: ""
28+
META_MAX_CONNECTIONS: 1
1629
jobs:
1730
generate_typescript:
1831
name: Generate typescript types

article-api/src/main/scala/no/ndla/articleapi/ArticleApiProperties.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ class ArticleApiProperties extends BaseProps with DatabaseProps {
7171
).getOrElse(Environment, "https://h5p.ndla.no")
7272
)
7373

74-
private def BrightcoveAccountId: String = prop("NDLA_BRIGHTCOVE_ACCOUNT_ID")
75-
private def BrightcovePlayerId: String = prop("NDLA_BRIGHTCOVE_PLAYER_ID")
74+
private def BrightcoveAccountId: String = prop("BRIGHTCOVE_ACCOUNT_ID")
75+
private def BrightcovePlayerId: String = prop("BRIGHTCOVE_PLAYER_ID")
7676

7777
def BrightcoveVideoScriptUrl: String =
7878
s"//players.brightcove.net/$BrightcoveAccountId/${BrightcovePlayerId}_default/index.min.js"

article-api/src/test/scala/no/ndla/articleapi/UnitSuite.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ trait UnitSuite extends UnitTestSuite {
2626
setProp("IMAGE_API_HOST", "localhost:30001")
2727
setProp("DRAFT_API_HOST", "localhost:30022")
2828

29-
setProp("NDLA_BRIGHTCOVE_ACCOUNT_ID", "some-account-id")
30-
setProp("NDLA_BRIGHTCOVE_PLAYER_ID", "some-player-id")
29+
setProp("BRIGHTCOVE_ACCOUNT_ID", "some-account-id")
30+
setProp("BRIGHTCOVE_PLAYER_ID", "some-player-id")
3131
setProp("BRIGHTCOVE_API_CLIENT_ID", "some-client-id")
3232
setProp("BRIGHTCOVE_API_CLIENT_SECRET", "some-secret")
3333
setProp("SEARCH_INDEX_NAME", "article-integration-test-index")

common/src/main/scala/no/ndla/common/model/domain/concept/Concept.scala

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ case class Concept(
2424
created: NDLADate,
2525
updated: NDLADate,
2626
updatedBy: Seq[String],
27-
metaImage: Seq[ConceptMetaImage],
2827
tags: Seq[Tag],
2928
status: Status,
3029
visualElement: Seq[VisualElement],
@@ -34,7 +33,7 @@ case class Concept(
3433
editorNotes: Seq[ConceptEditorNote]
3534
) extends Content {
3635
def supportedLanguages: Set[String] =
37-
getSupportedLanguages(title, content, tags, visualElement, metaImage).toSet
36+
getSupportedLanguages(title, content, tags, visualElement).toSet
3837
}
3938

4039
object Concept {

common/src/main/scala/no/ndla/common/model/domain/concept/ConceptMetaImage.scala

-24
This file was deleted.

common/src/main/scala/no/ndla/common/model/domain/frontpage/MovieTheme.scala

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,10 @@
88

99
package no.ndla.common.model.domain.frontpage
1010

11+
import no.ndla.language.model.LanguageField
12+
1113
case class MovieTheme(name: Seq[MovieThemeName], movies: Seq[String])
12-
case class MovieThemeName(name: String, language: String)
14+
case class MovieThemeName(name: String, language: String) extends LanguageField[String] {
15+
override def value: String = name
16+
override def isEmpty: Boolean = name.isEmpty
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
update conceptdata set document = document - 'metaImage';
2+
update publishedconceptdata set document = document - 'metaImage';

concept-api/src/main/scala/no/ndla/conceptapi/ComponentRegistry.scala

-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ package no.ndla.conceptapi
1111
import com.typesafe.scalalogging.StrictLogging
1212
import com.zaxxer.hikari.HikariDataSource
1313
import no.ndla.conceptapi.controller.*
14-
import no.ndla.conceptapi.integration.TaxonomyApiClient
1514
import no.ndla.conceptapi.model.api.ErrorHandling
1615
import no.ndla.conceptapi.model.search.{DraftSearchSettingsHelper, SearchSettingsHelper}
1716
import no.ndla.conceptapi.repository.{DraftConceptRepository, PublishedConceptRepository}
@@ -60,7 +59,6 @@ class ComponentRegistry(properties: ConceptApiProperties)
6059
with ErrorHandling
6160
with SearchSettingsHelper
6261
with DraftSearchSettingsHelper
63-
with TaxonomyApiClient
6462
with SwaggerDocControllerConfig
6563
with ConceptControllerHelpers {
6664
override val props: ConceptApiProperties = properties
@@ -81,8 +79,6 @@ class ComponentRegistry(properties: ConceptApiProperties)
8179
lazy val publishedConceptIndexService = new PublishedConceptIndexService
8280
lazy val publishedConceptSearchService = new PublishedConceptSearchService
8381

84-
lazy val taxonomyApiClient: TaxonomyApiClient = new TaxonomyApiClient
85-
8682
var e4sClient: NdlaE4sClient = Elastic4sClientFactory.getClient(props.SearchServer)
8783

8884
lazy val ndlaClient = new NdlaClient

concept-api/src/main/scala/no/ndla/conceptapi/integration/TaxonomyApiClient.scala

-47
This file was deleted.

concept-api/src/main/scala/no/ndla/conceptapi/integration/model/TaxonomySubject.scala

-48
This file was deleted.

concept-api/src/main/scala/no/ndla/conceptapi/model/api/ConceptDTO.scala

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ case class ConceptDTO(
2828
copyright: Option[DraftCopyrightDTO],
2929
@description("URL for the source of the concept")
3030
source: Option[String],
31-
@description("A meta image for the concept")
32-
metaImage: Option[ConceptMetaImageDTO],
3331
@description("Search tags the concept is tagged with")
3432
tags: Option[ConceptTagsDTO],
3533
@description("When the concept was created")

concept-api/src/main/scala/no/ndla/conceptapi/model/api/ConceptMetaImageDTO.scala

-26
This file was deleted.

concept-api/src/main/scala/no/ndla/conceptapi/model/api/ConceptSummaryDTO.scala

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ case class ConceptSummaryDTO(
2222
title: ConceptTitleDTO,
2323
@description("The content of the concept in available languages")
2424
content: ConceptContent,
25-
@description("The metaImage of the concept")
26-
metaImage: ConceptMetaImageDTO,
2725
@description("Search tags the concept is tagged with")
2826
tags: Option[ConceptTagsDTO],
2927
@description("All available languages of the current concept")

concept-api/src/main/scala/no/ndla/conceptapi/model/api/NewConceptDTO.scala

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ case class NewConceptDTO(
2323
content: Option[String],
2424
@description("Describes the copyright information for the concept")
2525
copyright: Option[DraftCopyrightDTO],
26-
@description("An image-api ID for the concept meta image")
27-
metaImage: Option[NewConceptMetaImageDTO],
2826
@description("A list of searchable tags")
2927
tags: Option[Seq[String]],
3028
@description("A visual element for the concept. May be anything from an image to a video or H5P")

concept-api/src/main/scala/no/ndla/conceptapi/model/api/NewConceptMetaImageDTO.scala

-23
This file was deleted.

concept-api/src/main/scala/no/ndla/conceptapi/model/api/UpdatedConceptDTO.scala

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ case class UpdatedConceptDTO(
2121
title: Option[String],
2222
@description("The content of the concept")
2323
content: Option[String],
24-
@description("An image-api ID for the concept meta image")
25-
metaImage: UpdateOrDelete[NewConceptMetaImageDTO],
2624
@description("Describes the copyright information for the concept")
2725
copyright: Option[DraftCopyrightDTO],
2826
@description("A list of searchable tags")

concept-api/src/main/scala/no/ndla/conceptapi/model/domain/DBConcept.scala

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ object DBConcept extends SQLSyntaxSupport[Concept] {
3535
meta.created,
3636
meta.updated,
3737
meta.updatedBy,
38-
meta.metaImage,
3938
meta.tags,
4039
meta.status,
4140
meta.visualElement,

concept-api/src/main/scala/no/ndla/conceptapi/model/search/SearchableConcept.scala

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ import no.ndla.common.model.domain.Responsible
1414
import no.ndla.search.model.domain.EmbedValues
1515
import no.ndla.search.model.{SearchableLanguageList, SearchableLanguageValues}
1616
import no.ndla.common.model.NDLADate
17-
import no.ndla.common.model.domain.concept.{Concept, ConceptMetaImage}
17+
import no.ndla.common.model.domain.concept.Concept
1818

1919
case class SearchableConcept(
2020
id: Long,
2121
conceptType: String,
2222
title: SearchableLanguageValues,
2323
content: SearchableLanguageValues,
24-
metaImage: Seq[ConceptMetaImage],
2524
defaultTitle: Option[String],
2625
tags: SearchableLanguageList,
2726
lastUpdated: NDLADate,

0 commit comments

Comments
 (0)