Skip to content

Commit

Permalink
Merge pull request #229 from alkem-io/develop
Browse files Browse the repository at this point in the history
Release: Renamings
  • Loading branch information
valentinyanakiev authored Jun 27, 2023
2 parents 593588f + b5349d7 commit c0ba22e
Show file tree
Hide file tree
Showing 51 changed files with 292 additions and 294 deletions.
4 changes: 2 additions & 2 deletions lib/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alkemio/notifications-lib",
"version": "0.4.3",
"version": "0.5.3",
"description": "Library for interacting with Alkemio notifications service",
"author": "Alkemio Foundation",
"private": false,
Expand Down
20 changes: 10 additions & 10 deletions lib/src/common/alkemio-url-generator/alkemio.url.generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ export const createJourneyURL = (
webclientEndpoint: string,
journey: JourneyPayload
): string => {
const baseURL = `${webclientEndpoint}/${journey.hubNameID}`;
const baseURL = `${webclientEndpoint}/${journey.spaceNameID}`;
switch (journey.type) {
case JourneyType.HUB:
case JourneyType.SPACE:
return baseURL;
case JourneyType.CHALLENGE:
return `${baseURL}/challenges/${journey.challenge?.nameID}`;
Expand All @@ -22,9 +22,9 @@ export const createJourneyAdminCommunityURL = (
webclientEndpoint: string,
journey: JourneyPayload
): string => {
const baseURL = `${webclientEndpoint}/admin/hubs/${journey.hubNameID}`;
const baseURL = `${webclientEndpoint}/admin/spaces/${journey.spaceNameID}`;
switch (journey.type) {
case JourneyType.HUB:
case JourneyType.SPACE:
return `${baseURL}/community`;
case JourneyType.CHALLENGE:
return `${baseURL}/challenges/${journey.challenge?.nameID}/community`;
Expand All @@ -49,20 +49,20 @@ export const createCalloutURL = (
return `${journeyURL}/collaboration/${calloutNameID}`;
};

export const createCardURL = (
export const createPostURL = (
journeyURL: string,
calloutNameID: string,
cardNameID: string
postNameID: string
): string => {
return `${journeyURL}/collaboration/${calloutNameID}/aspects/${cardNameID}`;
return `${journeyURL}/collaboration/${calloutNameID}/posts/${postNameID}`;
};

export const createCanvasURL = (
export const createWhiteboardURL = (
journeyURL: string,
calloutNameID: string,
canvasNameID: string
whiteboardNameID: string
): string => {
return `${journeyURL}/collaboration/${calloutNameID}/canvases/${canvasNameID}`;
return `${journeyURL}/collaboration/${calloutNameID}/whiteboardes/${whiteboardNameID}`;
};

export const createOrganizationURL = (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/common/enums/journey.type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// todo: remove once notifications can use the types directly from
export enum JourneyType {
HUB = 'hub',
SPACE = 'space',
CHALLENGE = 'challenge',
OPPORTUNITY = 'opportunity',
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { JourneyBaseEventPayload } from './journey.base.event.payload';

export interface CollaborationCardCommentEventPayload extends JourneyBaseEventPayload {
export interface CollaborationPostCommentEventPayload extends JourneyBaseEventPayload {
callout: {
displayName: string;
nameID: string;
}
card: {
post: {
displayName: string;
createdBy: string;
nameID: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { JourneyBaseEventPayload } from './journey.base.event.payload';

export interface CollaborationCardCreatedEventPayload extends JourneyBaseEventPayload {
export interface CollaborationPostCreatedEventPayload extends JourneyBaseEventPayload {
callout: {
displayName: string;
nameID: string;
}
card: {
post: {
id: string;
createdBy: string;
displayName: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { JourneyBaseEventPayload } from './journey.base.event.payload';

export interface CollaborationCanvasCreatedEventPayload extends JourneyBaseEventPayload {
export interface CollaborationWhiteboardCreatedEventPayload extends JourneyBaseEventPayload {
callout: {
displayName: string;
nameID: string;
}
canvas: {
whiteboard: {
id: string;
createdBy: string;
displayName: string;
Expand Down
8 changes: 4 additions & 4 deletions lib/src/dto/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export * from './community.application.created.event.payload';
export * from './community.new.member.payload';
export * from './community.invitation.created.event.payload';
export * from './collaboration.interest.payload';
export * from './collaboration.canvas.created.event.payload';
export * from './collaboration.card.created.event.payload';
export * from './collaboration.context.review.submitted.payload';
export * from './collaboration.card.comment.event.payload';
export * from './collaboration.whiteboard.created.event.payload';
export * from './collaboration.post.created.event.payload';
export * from './collaboration.post.comment.event.payload';
export * from './collaboration.callout.published.event.payload';
export * from './collaboration.discussion.comment.event.payload';
export * from './collaboration.context.review.submitted.payload';
export * from './platform.user.registration.event.payload';
export * from './platform.user.removed.event.payload';
export * from './platform.forum.discussion.comment.event.payload';
Expand Down
4 changes: 2 additions & 2 deletions lib/src/dto/journey.payload.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { JourneyType } from "@src/common/enums/journey.type";

export type JourneyPayload = {
hubID: string;
hubNameID: string;
spaceID: string;
spaceNameID: string;
displayName: string;
type: JourneyType;
challenge?: {
Expand Down
6 changes: 3 additions & 3 deletions lib/src/notification.event.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export enum NotificationEventType {
COMMUNICATION_ORGANIZATION_MENTION = 'communicationOrganizationMention',
COLLABORATION_INTEREST = 'collaborationInterest',
COLLABORATION_CONTEXT_REVIEW_SUBMITTED = 'collaborationContextReviewSubmitted',
COLLABORATION_CANVAS_CREATED = 'collaborationCanvasCreated',
COLLABORATION_CARD_CREATED = 'collaborationCardCreated',
COLLABORATION_CARD_COMMENT = 'collaborationCommentOnCard',
COLLABORATION_WHITEBOARD_CREATED = 'collaborationWhiteboardCreated',
COLLABORATION_POST_CREATED = 'collaborationPostCreated',
COLLABORATION_POST_COMMENT = 'collaborationPostComment',
COLLABORATION_DISCUSSION_COMMENT = 'collaborationCommentOnDiscussion',
COLLABORATION_CALLOUT_PUBLISHED = 'collaborationCalloutPublished',
PLATFORM_USER_REGISTERED = 'platformUserRegistered',
Expand Down
6 changes: 3 additions & 3 deletions service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ To test the welcome (sample) template, you can use the following payload in Rabb
"name": "02 Zero Hunger",
"type": "challenge"
},
"hub": {
"space": {
"id": "32818605-ef2f-4395-bb49-1dc2835c23de",
"challenge": {
"id": "7b86f954-d8c3-4fac-a652-b922c80e5c20",
Expand All @@ -76,11 +76,11 @@ To test the welcome (sample) template, you can use the following payload in Rabb
}
```

Note: replace applicantionCreatorID, applicantID, and hub + challenge + opportunity IDs with IDs you have in your database. You can run the following gql queries to find them:
Note: replace applicantionCreatorID, applicantID, and space + challenge + opportunity IDs with IDs you have in your database. You can run the following gql queries to find them:

```gql
query {
hubs {
spaces {
id
displayName
challenges {
Expand Down
38 changes: 19 additions & 19 deletions service/notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ recipients:
type: OPPORTUNITY_ADMIN
resource_id: <opportunityID>
- rule:
type: HUB_ADMIN
resource_id: <hubID>
type: SPACE_ADMIN
resource_id: <spaceID>
- rule:
type: GLOBAL_ADMIN_COMMUNITY
resource_id:
Expand All @@ -113,8 +113,8 @@ recipients:
- name: admin
rules:
- rule:
type: HUB_ADMIN
resource_id: <hubID>
type: SPACE_ADMIN
resource_id: <spaceID>
- rule:
type: CHALLENGE_ADMIN
resource_id: <challengeID>
Expand Down Expand Up @@ -144,7 +144,7 @@ recipients:
- name: member
rules:
- rule:
type: HUB_MEMBER
type: SPACE_MEMBER
resource_id: <journeyID>
- rule:
type: CHALLENGE_MEMBER
Expand Down Expand Up @@ -183,7 +183,7 @@ recipients:
- name: receiver
rules:
- rule:
type: HUB_HOST
type: SPACE_HOST
resource_id: <journeyID>
- rule:
type: CHALLENGE_LEAD
Expand Down Expand Up @@ -225,12 +225,12 @@ recipients:
- rule:
type: USER_SELF_MANAGEMENT
resource_id: <userID>
collaboration_card_created:
collaboration_post_created:
- name: admin
rules:
- rule:
type: HUB_ADMIN
resource_id: <hubID>
type: SPACE_ADMIN
resource_id: <spaceID>
- rule:
type: CHALLENGE_ADMIN
resource_id: <challengeID>
Expand All @@ -240,20 +240,20 @@ recipients:
- name: user
rules:
- rule:
type: HUB_MEMBER
type: SPACE_MEMBER
resource_id: <journeyID>
- rule:
type: CHALLENGE_MEMBER
resource_id: <journeyID>
- rule:
type: OPPORTUNITY_MEMBER
resource_id: <journeyID>
collaboration_canvas_created:
collaboration_whiteboard_created:
- name: admin
rules:
- rule:
type: HUB_ADMIN
resource_id: <hubID>
type: SPACE_ADMIN
resource_id: <spaceID>
- rule:
type: CHALLENGE_ADMIN
resource_id: <challengeID>
Expand All @@ -263,15 +263,15 @@ recipients:
- name: user
rules:
- rule:
type: HUB_MEMBER
type: SPACE_MEMBER
resource_id: <journeyID>
- rule:
type: CHALLENGE_MEMBER
resource_id: <journeyID>
- rule:
type: OPPORTUNITY_MEMBER
resource_id: <journeyID>
collaboration_card_comment:
collaboration_post_comment:
- name: owner
rules:
- rule:
Expand All @@ -281,7 +281,7 @@ recipients:
- name: member
rules:
- rule:
type: HUB_MEMBER
type: SPACE_MEMBER
resource_id: <journeyID>
- rule:
type: CHALLENGE_MEMBER
Expand All @@ -293,7 +293,7 @@ recipients:
- name: user
rules:
- rule:
type: HUB_MEMBER
type: SPACE_MEMBER
resource_id: <journeyID>
- rule:
type: CHALLENGE_MEMBER
Expand All @@ -311,7 +311,7 @@ recipients:
type: GLOBAL_ADMIN
resource_id:
- rule:
type: GLOBAL_ADMIN_HUBS
type: GLOBAL_ADMIN_SPACES
resource_id:
- name: registrant
rules:
Expand All @@ -328,7 +328,7 @@ recipients:
type: GLOBAL_ADMIN
resource_id:
- rule:
type: GLOBAL_ADMIN_HUBS
type: GLOBAL_ADMIN_SPACES
resource_id:
platform_forum_discussion_comment:
- name: discussionCreator
Expand Down
32 changes: 16 additions & 16 deletions service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c0ba22e

Please sign in to comment.