Skip to content

4591 - Original Data Point Comments Separation - Activity logs - #5218

Merged
mergify[bot] merged 11 commits into
4591-original-data-point---comments-area-separation-for-1a-and-1bfrom
4591-original-data-point---comments-area-separation-activity-logs
Nov 7, 2025
Merged

4591 - Original Data Point Comments Separation - Activity logs#5218
mergify[bot] merged 11 commits into
4591-original-data-point---comments-area-separation-for-1a-and-1bfrom
4591-original-data-point---comments-area-separation-activity-logs

Conversation

@yaguzmang

Copy link
Copy Markdown
Contributor

No description provided.

@yaguzmang yaguzmang changed the title 4591 - Original Data Point Comments Separation - Activity logs & topics 4591 - Original Data Point Comments Separation - Activity logs Oct 30, 2025
Comment on lines +44 to +45
export const ODP_COMMENT_COLUMN_EXTENT = `comments_${TableNames.extentOfForest.toLocaleLowerCase()}`
export const ODP_COMMENT_COLUMN_FOREST_CHARACTERISTICS = `comments_${TableNames.forestCharacteristics.toLocaleLowerCase()}`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better a Record and in src/server/db/repository/assessmentCycle/originalDataPoint since they are used only there?

Comment on lines +36 to +40
const message =
field === TableNames.extentOfForest
? ActivityLogMessage.originalDataPointUpdateCommentExtentOfForest
: ActivityLogMessage.originalDataPointUpdateCommentForestCharacteristics

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even here a record ?

user: User
}

const ACTIVITY_LOG_MESSAGE_BY_FIELD: Record<OriginalDataPointCommentKey, ActivityLogMessage> = {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Activities

import { OriginalDataPoint, OriginalDataPointComments } from 'meta/assessment/originalDataPoint'
import { TableNames } from 'meta/assessment/table'

import { ODP_COMMENT_COLUMNS_RECORD } from 'server/repository/assessmentCycle/originalDataPoint/commentColumns'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ODPCommentColums


import { ODP_COMMENT_COLUMNS_RECORD } from 'server/repository/assessmentCycle/originalDataPoint/commentColumns'

type OriginalDataPointDB = Record<string, unknown>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this must specify the columns

})

if (!hasForestCharacteristicsComments) {
await DB.none(`alter table ${tableName} add column ${commentColumnForestCharacteristics} text`)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default comments should be empty string.

DDL is missing

Comment on lines +22 to +28
if (!Objects.isNil(commentsExtentOfForest)) {
comments[TableNames.extentOfForest] = commentsExtentOfForest as string
}

if (!Objects.isNil(commentsForestCharacteristics)) {
comments[TableNames.forestCharacteristics] = commentsForestCharacteristics as string
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default these values should not be null

Comment thread src/server/repository/adapter/index.ts Outdated
export { ColAdapter } from './col'
export type { FileDB } from './file'
export { FileAdapter } from './file'
export { OriginalDataPointAdapter } from './originalDataPoint'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets start not exporting from barrel files

@yaguzmang yaguzmang self-assigned this Nov 6, 2025
@yaguzmang
yaguzmang marked this pull request as ready for review November 6, 2025 02:02
@yaguzmang
yaguzmang requested a review from sorja as a code owner November 6, 2025 02:02
Comment thread src/meta/assessment/activityLogs/index.ts
] as ODPCommentColName<TableNames.forestCharacteristics>

export const OriginalDataPointAdapter = (row: OriginalDataPointDB): OriginalDataPoint => {
if (Objects.isNil(row)) return null

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When can this be bull ?

@yaguzmang yaguzmang Nov 7, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be null when a query returns no rows, so some tests fail without this check

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange . Which query ? Do we use oneRoNone or map ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check this in the next pr @yaguzmang we merge this now . It was too big this pr to handle it properly

@mergify mergify Bot added the queued label Nov 7, 2025
@mergify
mergify Bot merged commit c91be1e into 4591-original-data-point---comments-area-separation-for-1a-and-1b Nov 7, 2025
5 checks passed
@mergify
mergify Bot deleted the 4591-original-data-point---comments-area-separation-activity-logs branch November 7, 2025 05:18
@mergify mergify Bot removed the queued label Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants