Skip to content

Commit

Permalink
fix: isInReadOnlyDataset should be true for SystemRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
olovy committed Nov 25, 2024
1 parent 66432e0 commit 938f473
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class DatasetImporter {
} else if (givenDsData != null) {
System.err.println("Using given dataset description")
setDatasetInfo(datasetUri, givenDsData)
dsRecord = completeRecord(givenDsData, 'SystemRecord')
dsRecord = completeRecord(givenDsData, JsonLd.SYSTEM_RECORD_TYPE)
createOrUpdateDocument(dsRecord)
dsId = dsRecord.getShortId()
} else if (useExistingDatasetDescription) {
Expand Down
2 changes: 1 addition & 1 deletion whelk-core/src/main/groovy/whelk/Document.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class Document {
// FIXME: don't hardcode
// see also https://github.com/libris/lxlviewer/blob/5dc7807b3434cd1e29943d14d73e3f6f251e3c1b/cataloging/src/components/inspector/toolbar.vue#L312
boolean isInReadOnlyDataset() {
getRecord()[JsonLd.TYPE_KEY] == JsonLd.CACHE_RECORD_TYPE
getRecord()[JsonLd.TYPE_KEY] != JsonLd.RECORD_TYPE
|| getInDataset().any {
var id = (String) it[JsonLd.ID_KEY] ?: ''
id.startsWith('https://id.kb.se/dataset/') || id.startsWith('https://libris.kb.se/dataset/')
Expand Down
1 change: 1 addition & 0 deletions whelk-core/src/main/groovy/whelk/JsonLd.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class JsonLd {

public static final String RECORD_TYPE = 'Record'
public static final String CACHE_RECORD_TYPE = 'CacheRecord'
public static final String SYSTEM_RECORD_TYPE = 'SystemRecord'
public static final String VIRTUAL_RECORD_TYPE = 'VirtualRecord'

public static final String SEARCH_KEY = "_str"
Expand Down

0 comments on commit 938f473

Please sign in to comment.