diff --git a/.github/auto_assign.yml b/.github/auto_assign.yml index 654953049..e7baed3a9 100644 --- a/.github/auto_assign.yml +++ b/.github/auto_assign.yml @@ -11,7 +11,7 @@ assignees: - johnnadeluy # - annesiri - Carl-OW - - michaelpande +# - michaelpande # A number of assignees to add to the pull request # Set to 0 to add all of the assignees. diff --git a/src/main/resources/lib/ssb/dataset/publishOld.ts b/src/main/resources/lib/ssb/dataset/publishOld.ts index a0cd2e0d6..dd322229e 100644 --- a/src/main/resources/lib/ssb/dataset/publishOld.ts +++ b/src/main/resources/lib/ssb/dataset/publishOld.ts @@ -3,6 +3,7 @@ import { get as getContent, Content } from '/lib/xp/content' import { NodeQueryResultHit } from '/lib/xp/node' import { send } from '/lib/xp/event' import { executeFunction, sleep } from '/lib/xp/task' +import { run, type ContextParams } from '/lib/xp/context' import { isSameOrBefore } from '/lib/ssb/utils/dateUtils' import { isSameDay } from '/lib/vendor/dateFns' @@ -111,7 +112,18 @@ export function publishDataset(): void { status: JobStatus.STARTED, dataSources: [], } - const dataSourceIds: Array = getDataSourceIdsFromStatistics(stat) + const draftContext: ContextParams = { + branch: 'draft', + } + const statisticDraft: Content | null = run(draftContext, () => { + return getContent({ key: stat._id }) + }) + const dataSourceIdsMaster: Array = getDataSourceIdsFromStatistics(stat) + const dataSourceIdsDraft: Array = statisticDraft ? getDataSourceIdsFromStatistics(statisticDraft) : [] + const uniqueDatasourceDraft: Array = dataSourceIdsDraft.filter( + (item) => !dataSourceIdsMaster.includes(item) + ) + const dataSourceIds: Array = dataSourceIdsMaster.concat(uniqueDatasourceDraft) const dataSources: Array | null> = dataSourceIds.map((key) => { return getContent({ key,