Skip to content

Commit

Permalink
Merge branch 'main' into 194-implement-automatic-status-refresh-on-co…
Browse files Browse the repository at this point in the history
…nnector-page
  • Loading branch information
illfixit authored Aug 14, 2024
2 parents 007b526 + 3caa145 commit 207dcf5
Show file tree
Hide file tree
Showing 210 changed files with 6,522 additions and 930 deletions.
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,23 @@ please see [changelog_updates.md](docs/dev/changelog_updates.md).

#### Minor

- Copyable contact email and subject fields on data offer detail dialogs
- Catalog: Organization filter is no longer split into ID and name
- Catalog: Connector filter is no longer split into ID and endpoint
- Catalog: Removed dataspace filter when only one dataspace is known
- Added a message when the CaaS request feature is not available

#### Patch

- Fixed user not being redirected to the correct URL after login
- Copyable contact email and subject fields on data offer detail dialogs
- Fixed the close button on the self-hosted/CaaS connector choice page [#258](https://github.com/sovity/authority-portal/issues/258)
- Fixed Dashboard showing uptimes of over 100%
- Organization list: Data offer and connector counts now show the correct numbers according to the active environment
- Fixed provider organization ID not showing up on CaaS connectors [#206](https://github.com/sovity/authority-portal/issues/206)
- Keep in mind that sovity needs to be registered in the portal for the ID to show up.
- Already registered connectors will be updated automatically, this process can take up to 24 hours
- Fixed the close button on the self-hosted/CaaS connector choice page [#258](https://github.com/sovity/authority-portal/issues/258)

### Known issues

Expand All @@ -24,7 +38,10 @@ please see [changelog_updates.md](docs/dev/changelog_updates.md).
Read the deployment migration notes carefully if you want to retain the portal's current behavior.
If you configure the optional variables incorrectly, you might end up with an inconsistent configuration.

#### Backend

Environment variable changes:

- Renamed variables:
- `authority-portal.caas.sovity.limit-per-mdsid` to `authority-portal.caas.sovity.limit-per-organization`
- New optional configuration variables - the values assigned here are the ones you should use to retain the current behavior:
Expand All @@ -34,6 +51,25 @@ Environment variable changes:
authority-portal.organization.id.prefix: "MDS"
authority-portal.organization.id.length: "4"
```
- New **mandatory** configuration variables:
- ```yaml
# Enables the client to connect to the CaaS service. If you weren't provided credentials for the feature by sovity, set this to false
quarkus.oidc-client.sovity.client-enabled: true
```
#### Frontend
Environment variable changes:
- New **mandantory** configuration variables - the values assigned here are the ones you should use to retain the current behavior:
- ```yaml
# UI Branding profile
AUTHORITY_PORTAL_FRONTEND_ACTIVE_PROFILE: mds-open-source
# Short Dataspace name, used in some explanatory texts
AUTHORITY_PORTAL_FRONTEND_DATASPACE_SHORT_NAME: MDS
# Portal name displayed in various texts
AUTHORITY_PORTAL_FRONTEND_PORTAL_DISPLAY_NAME: "MDS Portal"
```
#### Compatible Versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ data class DeploymentEnvironmentDto(
val dapsTokenUrl: String,
@field:Schema(description = "DAPS JWKS URL", requiredMode = Schema.RequiredMode.REQUIRED)
val dapsJwksUrl: String,
@field:Schema(description = "Logging House URL", requiredMode = Schema.RequiredMode.REQUIRED)
val loggingHouseUrl: String,
@field:Schema(description = "Logging House URL", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
val loggingHouseUrl: String?,
)
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ data class ProvidedConnectorOverviewEntryDto(
@field:Schema(description = "Connector status", requiredMode = Schema.RequiredMode.REQUIRED)
val status: ConnectorStatusDto,
@field:Schema(description = "Frontend link", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
val frontendUrl: String,
val frontendUrl: String?,
)
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ data class CnfFilterAttribute(
val id: String,
@field:Schema(description = "Attribute Title", example = "Language", requiredMode = Schema.RequiredMode.REQUIRED)
val title: String,
@field:Schema(description = "How should items of this filter be rendered in the UI", requiredMode = Schema.RequiredMode.REQUIRED)
val displayType: CnfFilterAttributeDisplayType,
@field:Schema(description = "Available values.", requiredMode = Schema.RequiredMode.REQUIRED)
val values: List<CnfFilterItem>,
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
* sovity GmbH - initial API and implementation
*
*/
package de.sovity.authorityportal.broker.dao.pages.catalog.models
package de.sovity.authorityportal.api.model.catalog

import io.swagger.v3.oas.annotations.media.Schema

@Schema(description = "How should filter items be rendered in the UI", enumAsRef = true)
enum class CnfFilterAttributeDisplayType {
TITLE_ONLY,
ID_AND_TITLE
}

data class CatalogQueryFilter(
val name: String,
val valueQuery: AvailableFilterValuesQuery,
val queryFilterClauseOrNull: CatalogQuerySelectedFilterQuery?
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import io.swagger.v3.oas.annotations.media.Schema
data class CnfFilterItem(
@field:Schema(
description = "Value ID",
example = "https://w3id.org/idsa/code/EN",
example = "MDSLXXXXX1",
requiredMode = Schema.RequiredMode.REQUIRED
)
val id: String,

@field:Schema(description = "Value Title", example = "English", requiredMode = Schema.RequiredMode.REQUIRED)
@field:Schema(description = "Value Title", example = "Example Organization", requiredMode = Schema.RequiredMode.REQUIRED)
val title: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package de.sovity.authorityportal.broker.dao.pages.catalog

import de.sovity.authorityportal.broker.dao.pages.catalog.models.CatalogQueryFilter
import de.sovity.authorityportal.broker.services.api.filtering.model.FilterAttributeApplied
import jakarta.enterprise.context.ApplicationScoped
import org.jooq.Field
import org.jooq.JSON
Expand All @@ -36,10 +36,10 @@ class CatalogQueryAvailableFilterFetcher(
environment: String,
fields: CatalogQueryFields,
searchQuery: String?,
filters: List<CatalogQueryFilter>
filters: List<FilterAttributeApplied>
): Field<JSON> {
val resultFields = filters.mapIndexed { i, currentFilter ->
// When querying a filter's values we apply all filters except for the current filter's values
// When querying a filter's values we apply all filters except for the current filter
val otherFilters = filters.filterIndexed { j, _ -> i != j }
queryFilterValues(environment, fields, currentFilter, searchQuery, otherFilters)
}
Expand All @@ -49,22 +49,31 @@ class CatalogQueryAvailableFilterFetcher(
private fun queryFilterValues(
environment: String,
parentQueryFields: CatalogQueryFields,
currentFilter: CatalogQueryFilter,
currentFilter: FilterAttributeApplied,
searchQuery: String?,
otherFilters: List<CatalogQueryFilter>
otherFilters: List<FilterAttributeApplied>
): Field<JSON> {
val fields = parentQueryFields.withSuffix("filter_" + currentFilter.name)

val value = currentFilter.valueQuery(fields)
val idField: Field<String> = currentFilter.idField(fields)
val nameField: Field<String>? = currentFilter.nameField?.invoke(fields)

val idNameArray = if (nameField == null) {
DSL.array(idField)
} else {
DSL.array(idField, nameField)
}

return DSL.select(
DSL.coalesce(
DSL.arrayAggDistinct(value),
DSL.value(arrayOf<String>()).cast<Array<String>>(SQLDataType.VARCHAR.array())
DSL.arrayAggDistinct(idNameArray),
emptyStringArray()
)
)
.fromCatalogQueryTables(fields)
.where(catalogQueryFilterService.filterDbQuery(environment, fields, searchQuery, otherFilters))
.asField()
}

private fun emptyStringArray() = DSL.value(arrayOf<String>()).cast<Array<String>>(SQLDataType.VARCHAR.array())
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
package de.sovity.authorityportal.broker.dao.pages.catalog

import de.sovity.authorityportal.api.model.catalog.CatalogPageSortingType
import de.sovity.authorityportal.broker.dao.pages.catalog.models.CatalogQueryFilter
import de.sovity.authorityportal.broker.services.api.filtering.model.FilterAttributeApplied
import de.sovity.authorityportal.broker.dao.pages.catalog.models.DataOfferListEntryRs
import de.sovity.authorityportal.broker.dao.pages.catalog.models.PageQuery
import de.sovity.authorityportal.broker.dao.utils.MultisetUtils
Expand Down Expand Up @@ -42,7 +42,7 @@ class CatalogQueryDataOfferFetcher(
environment: String,
fields: CatalogQueryFields,
searchQuery: String?,
filters: List<CatalogQueryFilter>,
filters: List<FilterAttributeApplied>,
sorting: CatalogPageSortingType,
pageQuery: PageQuery
): Field<List<DataOfferListEntryRs>> {
Expand Down Expand Up @@ -86,7 +86,7 @@ class CatalogQueryDataOfferFetcher(
environment: String,
fields: CatalogQueryFields,
searchQuery: String?,
filters: List<CatalogQueryFilter>
filters: List<FilterAttributeApplied>
): Field<Int> {
val query = DSL.select(DSL.count())
.fromCatalogQueryTables(fields)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package de.sovity.authorityportal.broker.dao.pages.catalog

import de.sovity.authorityportal.broker.dao.pages.catalog.models.CatalogQueryFilter
import de.sovity.authorityportal.broker.services.api.filtering.model.FilterAttributeApplied
import de.sovity.authorityportal.broker.services.api.filtering.CatalogSearchService
import de.sovity.authorityportal.db.jooq.enums.ConnectorOnlineStatus
import de.sovity.authorityportal.db.jooq.tables.Connector
Expand All @@ -33,13 +33,13 @@ class CatalogQueryFilterService(
environment: String,
fields: CatalogQueryFields,
searchQuery: String?,
filters: List<CatalogQueryFilter>
filters: List<FilterAttributeApplied>
): Condition {
val conditions = ArrayList<Condition>()
conditions.add(fields.connectorTable.ENVIRONMENT.eq(environment))
conditions.add(visibleConnectorsOfEnvironment(environment, fields.connectorTable))
conditions.add(catalogSearchService.filterBySearch(fields, searchQuery))
conditions.addAll(filters.mapNotNull { it.queryFilterClauseOrNull }.map { it(fields) })
conditions.addAll(filters.mapNotNull { it.filterConditionOrNull }.map { it(fields) })
return DSL.and(conditions)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package de.sovity.authorityportal.broker.dao.pages.catalog

import de.sovity.authorityportal.api.model.catalog.CatalogPageSortingType
import de.sovity.authorityportal.broker.dao.pages.catalog.models.CatalogPageRs
import de.sovity.authorityportal.broker.dao.pages.catalog.models.CatalogQueryFilter
import de.sovity.authorityportal.broker.services.api.filtering.model.FilterAttributeApplied
import de.sovity.authorityportal.broker.dao.pages.catalog.models.PageQuery
import de.sovity.authorityportal.db.jooq.Tables
import de.sovity.authorityportal.web.environment.CatalogDataspaceConfigService
Expand All @@ -42,7 +42,7 @@ class CatalogQueryService(
fun queryCatalogPage(
environment: String,
searchQuery: String?,
filters: List<CatalogQueryFilter>,
filters: List<FilterAttributeApplied>,
sorting: CatalogPageSortingType,
pageQuery: PageQuery
): CatalogPageRs {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ import com.fasterxml.jackson.databind.ObjectMapper
*/
object JsonDeserializationUtils {
private val objectMapper: ObjectMapper = ObjectMapper()
private val TYPE_STRING_LIST_2: TypeReference<List<List<String>>> = object : TypeReference<List<List<String>>>() {}
private val TYPE_STRING_LIST_3: TypeReference<List<List<List<String>>>> = object : TypeReference<List<List<List<String>>>>() {}

fun read2dStringList(json: String): List<List<String>> {
return objectMapper.readValue(json, TYPE_STRING_LIST_2)
fun read3dStringList(json: String): List<List<List<String>>> {
return objectMapper.readValue(json, TYPE_STRING_LIST_3)
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,51 @@
*/
package de.sovity.authorityportal.broker.services.api.filtering

import de.sovity.authorityportal.api.model.catalog.CnfFilterAttributeDisplayType
import de.sovity.authorityportal.broker.dao.pages.catalog.CatalogQueryFields
import de.sovity.authorityportal.broker.dao.utils.eqAny
import de.sovity.authorityportal.broker.services.api.filtering.model.FilterAttributeDefinition
import jakarta.enterprise.context.ApplicationScoped
import org.jooq.Field

@ApplicationScoped
class CatalogFilterAttributeDefinitionService {
fun forField(
fun forIdOnlyField(
fieldExtractor: (CatalogQueryFields) -> Field<String>,
name: String,
label: String
): CatalogFilterAttributeDefinition {
return CatalogFilterAttributeDefinition(
): FilterAttributeDefinition {
return FilterAttributeDefinition(
name = name,
label = label,
valueGetter = fieldExtractor
displayType = CnfFilterAttributeDisplayType.TITLE_ONLY,
idField = fieldExtractor,
nameField = null
) { fields, values -> fieldExtractor(fields).eqAny(values) }
}

fun buildDataSpaceFilter(): CatalogFilterAttributeDefinition {
return CatalogFilterAttributeDefinition(
fun forIdNameProperty(
idFieldExtractor: (CatalogQueryFields) -> Field<String>,
nameFieldExtractor: (CatalogQueryFields) -> Field<String>,
name: String,
label: String
): FilterAttributeDefinition {
return FilterAttributeDefinition(
name = name,
label = label,
displayType = CnfFilterAttributeDisplayType.ID_AND_TITLE,
idField = idFieldExtractor,
nameField = nameFieldExtractor
) { fields, values -> idFieldExtractor(fields).eqAny(values) }
}

fun buildDataSpaceFilter(): FilterAttributeDefinition {
return FilterAttributeDefinition(
name = "dataSpace",
label = "Data Space",
valueGetter = CatalogQueryFields::dataSpace
displayType = CnfFilterAttributeDisplayType.TITLE_ONLY,
idField = CatalogQueryFields::dataSpace,
nameField = null
) { fields, values -> fields.dataSpace.eqAny(values) }
}
}
Loading

0 comments on commit 207dcf5

Please sign in to comment.