Skip to content

Commit f7708b7

Browse files
authored
chore: remove is contribution from code [IN-708] (#3538)
1 parent ab434fb commit f7708b7

51 files changed

Lines changed: 14 additions & 371 deletions

File tree

Some content is hidden

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

backend/src/api/member/memberActiveList.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import PermissionChecker from '../../services/user/permissionChecker'
1717
* @queryParam {string} [filter[isOrganization]] - If true we will return just members who are organizations (such as linkedin organizations that post), if false we will return just non-organization members, if undefined we will return both.
1818
* @queryParam {string} [filter[activityTimestampFrom]] - Filter by activity timestamp from (required)
1919
* @queryParam {string} [filter[activityTimestampTo]] - Filter by activity timestamp to (required)
20-
* @queryParam {string} [filter[activityIsContribution]] - Filter by activities that are contributions
2120
* @queryParam {string} [orderBy] - How to sort results. Available values: activityCount_DESC, activityCount_ASC, activeDaysCount_DESC, activeDaysCount_ASC (default activityCount_DESC)
2221
* @queryParam {number} [offset] - Skip the first n results. Default 0.
2322
* @queryParam {number} [limit] - Limit the number of results. Default 20.
@@ -61,7 +60,6 @@ export default async (req, res) => {
6160
: req.query.filter?.isOrganization === 'true',
6261
activityTimestampFrom: req.query.filter?.activityTimestampFrom,
6362
activityTimestampTo: req.query.filter?.activityTimestampTo,
64-
activityIsContribution: req.query.filter?.activityIsContribution === 'true',
6563
}
6664

6765
const orderBy = req.query.orderBy || 'activityCount_DESC'

backend/src/database/repositories/activityRepository.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class ActivityRepository {
5151
{
5252
type: data.type,
5353
timestamp: data.timestamp,
54-
isContribution: data.isContribution,
5554
score: data.score,
5655
parentId: data.parent || undefined,
5756
sourceId: data.sourceId,

backend/src/database/repositories/memberRepository.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,6 @@ class MemberRepository {
12651265
const activeMemberResults = await getActiveMembers(qx, {
12661266
timestampFrom: new Date(Date.parse(filter.activityTimestampFrom)).toISOString(),
12671267
timestampTo: new Date(Date.parse(filter.activityTimestampTo)).toISOString(),
1268-
isContribution: filter.activityIsContribution === true ? true : undefined,
12691268
platforms: filter.platforms ? filter.platforms : undefined,
12701269
segmentIds: segments,
12711270
limit: 10000,

backend/src/database/repositories/types/memberTypes.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export interface IActiveMemberFilter {
1515
isBot?: boolean
1616
isTeamMember?: boolean
1717
isOrganization?: boolean
18-
activityIsContribution?: boolean
1918
activityTimestampFrom: string
2019
activityTimestampTo: string
2120
}

backend/src/serverless/integrations/types/messageTypes.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export type AddActivitiesSingle = {
8484
url?: string
8585
channel?: string
8686
score?: number
87-
isContribution?: boolean
8887
}
8988

9089
export type AddActivities = Array<AddActivitiesSingle>

backend/src/serverless/integrations/webhooks/__tests__/events.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ export default class TestEvents {
922922
type: 'User',
923923
site_admin: false,
924924
},
925-
body: '# Changes proposed ✍️\r\nBug: Due to this previous change ([PR](https://github.com/CrowdDotDev/crowd.dev/pull/823/files#diff-987f06572bad79c47ef62d518a7a4e419dda775d942d365da55dc5509acf5291R44)), the `activityType` and `platform` were being stored in lowerCase in all activities. However, in the settings object it remained with the original value. So currently there is an inconsistency between custom activity type keys in activities and settings.\r\nTo fix this I\'m lowerCasing custom activity type and platform keys on their creation and migrating the existing ones to lowerCase as well.\r\n\r\nExample of problem:\r\nTenant settings:\r\n```\r\n{\r\n "Conference": {\r\n "Registered to a conference": {\r\n "display": {\r\n "short": "Registered to a conference",\r\n "channel": "",\r\n "default": "Registered to a conference"\r\n },\r\n "isContribution": false\r\n },\r\n },\r\n "other": {\r\n "This is a test": {\r\n "display": {\r\n "short": "This is a test",\r\n "channel": "",\r\n "default": "This is a test"\r\n },\r\n "isContribution": false\r\n }\r\n }\r\n}\r\n```\r\nActivity payload:\r\n`platform` and `activityType` fields:\r\n```\r\nplatform: \'luma\',\r\nactivityType: \'registered to a conference\'\r\n\r\nor\r\n\r\nplatform: \'other\',\r\nactivityType: \'this is a test\'\r\n```\r\n\r\nWith these changes the activity payload should remain the same but the tenant settings should be fixed to:\r\n```\r\n{\r\n "conference": {\r\n "registered to a conference": {\r\n "display": {\r\n "short": "Registered to a conference",\r\n "channel": "",\r\n "default": "Registered to a conference"\r\n },\r\n "isContribution": false\r\n },\r\n },\r\n "other": {\r\n "this is a test": {\r\n "display": {\r\n "short": "This is a test",\r\n "channel": "",\r\n "default": "This is a test"\r\n },\r\n "isContribution": false\r\n }\r\n }\r\n}\r\n```\r\n\r\n### What\r\n<!--\r\ncopilot:summary\r\n-->\r\n### <samp>🤖 Generated by Copilot at b11dfa1</samp>\r\n\r\nThe pull request standardizes the keys for custom activity types to use lowercase in the `settings` table and the `SettingsService` class. This avoids case sensitivity issues and improves data consistency across the application.\r\n​\r\n<!--\r\ncopilot:poem\r\n-->\r\n### <samp>🤖 Generated by Copilot at b11dfa1</samp>\r\n\r\n> _`customActivityTypes`_\r\n> _Lowercase keys for all seasons_\r\n> _`typeKey` follows_\r\n\r\n### Why\r\n\r\n\r\n### How\r\n<!--\r\ncopilot:walkthrough\r\n-->\r\n### <samp>🤖 Generated by Copilot at b11dfa1</samp>\r\n\r\n* Standardize the keys for custom activity types to use lowercase in the database and the service layer ([link](https://github.com/CrowdDotDev/crowd.dev/pull/843/files?diff=unified&w=0#diff-a9626422cfa5c6888ed594d5114bffc0c4113699b7f39d1c4c456da8bd72c812L1-R13), [link](https://github.com/CrowdDotDev/crowd.dev/pull/843/files?diff=unified&w=0#diff-2908c7bb18ca4494942ee153161abc5555bdd9516fc2d225a406d785b5787711L24-R24))\r\n* Update the `customActivityTypes` column in the `settings` table using the SQL script `V1683627959__customActivityTypesKeys.sql` ([link](https://github.com/CrowdDotDev/crowd.dev/pull/843/files?diff=unified&w=0#diff-a9626422cfa5c6888ed594d5114bffc0c4113699b7f39d1c4c456da8bd72c812L1-R13))\r\n* Modify the `typeKey` variable in the `SettingsService` class to match the database format ([link](https://github.com/CrowdDotDev/crowd.dev/pull/843/files?diff=unified&w=0#diff-2908c7bb18ca4494942ee153161abc5555bdd9516fc2d225a406d785b5787711L24-R24))\r\n\r\n## Checklist ✅\r\n- [x] Label appropriately with `Feature`, `Improvement`, or `Bug`.\r\n- [ ] Add screehshots to the PR description for relevant FE changes\r\n- [ ] New backend functionality has been unit-tested.\r\n- [ ] API documentation has been updated (if necessary) (see [docs on API documentation](https://docs.crowd.dev/docs/updating-api-documentation)).\r\n- [ ] [Quality standards](https://github.com/CrowdDotDev/crowd-github-test-public/blob/main/CONTRIBUTING.md#quality-standards) are met.\r\n',
925+
body: '# Changes proposed ✍️\r\nBug: Due to this previous change ([PR](https://github.com/CrowdDotDev/crowd.dev/pull/823/files#diff-987f06572bad79c47ef62d518a7a4e419dda775d942d365da55dc5509acf5291R44)), the `activityType` and `platform` were being stored in lowerCase in all activities. However, in the settings object it remained with the original value. So currently there is an inconsistency between custom activity type keys in activities and settings.\r\nTo fix this I\'m lowerCasing custom activity type and platform keys on their creation and migrating the existing ones to lowerCase as well.\r\n\r\nExample of problem:\r\nTenant settings:\r\n```\r\n{\r\n "Conference": {\r\n "Registered to a conference": {\r\n "display": {\r\n "short": "Registered to a conference",\r\n "channel": "",\r\n "default": "Registered to a conference"\r\n },\r\n },\r\n },\r\n "other": {\r\n "This is a test": {\r\n "display": {\r\n "short": "This is a test",\r\n "channel": "",\r\n "default": "This is a test"\r\n },\r\n }\r\n }\r\n}\r\n```\r\nActivity payload:\r\n`platform` and `activityType` fields:\r\n```\r\nplatform: \'luma\',\r\nactivityType: \'registered to a conference\'\r\n\r\nor\r\n\r\nplatform: \'other\',\r\nactivityType: \'this is a test\'\r\n```\r\n\r\nWith these changes the activity payload should remain the same but the tenant settings should be fixed to:\r\n```\r\n{\r\n "conference": {\r\n "registered to a conference": {\r\n "display": {\r\n "short": "Registered to a conference",\r\n "channel": "",\r\n "default": "Registered to a conference"\r\n },\r\n },\r\n },\r\n "other": {\r\n "this is a test": {\r\n "display": {\r\n "short": "This is a test",\r\n "channel": "",\r\n "default": "This is a test"\r\n },\r\n }\r\n }\r\n}\r\n```\r\n\r\n### What\r\n<!--\r\ncopilot:summary\r\n-->\r\n### <samp>🤖 Generated by Copilot at b11dfa1</samp>\r\n\r\nThe pull request standardizes the keys for custom activity types to use lowercase in the `settings` table and the `SettingsService` class. This avoids case sensitivity issues and improves data consistency across the application.\r\n​\r\n<!--\r\ncopilot:poem\r\n-->\r\n### <samp>🤖 Generated by Copilot at b11dfa1</samp>\r\n\r\n> _`customActivityTypes`_\r\n> _Lowercase keys for all seasons_\r\n> _`typeKey` follows_\r\n\r\n### Why\r\n\r\n\r\n### How\r\n<!--\r\ncopilot:walkthrough\r\n-->\r\n### <samp>🤖 Generated by Copilot at b11dfa1</samp>\r\n\r\n* Standardize the keys for custom activity types to use lowercase in the database and the service layer ([link](https://github.com/CrowdDotDev/crowd.dev/pull/843/files?diff=unified&w=0#diff-a9626422cfa5c6888ed594d5114bffc0c4113699b7f39d1c4c456da8bd72c812L1-R13), [link](https://github.com/CrowdDotDev/crowd.dev/pull/843/files?diff=unified&w=0#diff-2908c7bb18ca4494942ee153161abc5555bdd9516fc2d225a406d785b5787711L24-R24))\r\n* Update the `customActivityTypes` column in the `settings` table using the SQL script `V1683627959__customActivityTypesKeys.sql` ([link](https://github.com/CrowdDotDev/crowd.dev/pull/843/files?diff=unified&w=0#diff-a9626422cfa5c6888ed594d5114bffc0c4113699b7f39d1c4c456da8bd72c812L1-R13))\r\n* Modify the `typeKey` variable in the `SettingsService` class to match the database format ([link](https://github.com/CrowdDotDev/crowd.dev/pull/843/files?diff=unified&w=0#diff-2908c7bb18ca4494942ee153161abc5555bdd9516fc2d225a406d785b5787711L24-R24))\r\n\r\n## Checklist ✅\r\n- [x] Label appropriately with `Feature`, `Improvement`, or `Bug`.\r\n- [ ] Add screehshots to the PR description for relevant FE changes\r\n- [ ] New backend functionality has been unit-tested.\r\n- [ ] API documentation has been updated (if necessary) (see [docs on API documentation](https://docs.crowd.dev/docs/updating-api-documentation)).\r\n- [ ] [Quality standards](https://github.com/CrowdDotDev/crowd-github-test-public/blob/main/CONTRIBUTING.md#quality-standards) are met.\r\n',
926926
created_at: '2023-05-09T16:52:03Z',
927927
updated_at: '2023-05-10T14:15:25Z',
928928
closed_at: null,

backend/src/services/activityService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ export default class ActivityService extends LoggerBase {
196196
)
197197

198198
data.member.identities = ActivityService.processMemberIdentities(data.member, data.platform)
199-
data.isContribution = data.isContribution || false
200199

201200
// prepare objectMember for dataSinkWorker
202201
if (data.objectMember) {

backend/src/services/segmentService.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ export default class SegmentService extends LoggerBase {
321321
short: data.type,
322322
channel: '',
323323
},
324-
isContribution: false,
325324
calculateSentiment: false,
326325
}
327326

@@ -390,7 +389,6 @@ export default class SegmentService extends LoggerBase {
390389
short: data.type,
391390
channel: '',
392391
},
393-
isContribution: false,
394392
calculateSentiment: false,
395393
}
396394

frontend/src/modules/dashboard/store/actions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ export default {
148148
return MemberService.listActive({
149149
platform: platform !== 'all' ? [{ value: platform }] : [],
150150
isTeamMember: false,
151-
activityIsContribution: null,
152151
activityTimestampFrom: dateHelper()
153152
.utc()
154153
.subtract(period.value - 1, period.granularity)

frontend/src/modules/member/member-service.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ export class MemberService {
168168
isTeamMember,
169169
activityTimestampFrom,
170170
activityTimestampTo,
171-
activityIsContribution,
172171
orderBy,
173172
offset,
174173
limit,
@@ -181,9 +180,6 @@ export class MemberService {
181180
...(isTeamMember === false && {
182181
'filter[isTeamMember]': isTeamMember,
183182
}),
184-
...(activityIsContribution && {
185-
'filter[activityIsContribution]': activityIsContribution,
186-
}),
187183
'filter[isOrganization]': false,
188184
'filter[isBot]': false,
189185
'filter[activityTimestampFrom]': activityTimestampFrom,

0 commit comments

Comments
 (0)