Skip to content

Commit b17727b

Browse files
authored
Merge pull request #479 from gitroomhq/feat/plugs
Plugs
2 parents d826a3b + f8703e0 commit b17727b

File tree

22 files changed

+1484
-49
lines changed

22 files changed

+1484
-49
lines changed

apps/backend/src/api/routes/integrations.controller.ts

+33-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
import {
2-
Body,
3-
Controller,
4-
Delete,
5-
Get,
6-
Param,
7-
Post,
8-
Put,
9-
Query,
10-
UseFilters,
2+
Body, Controller, Delete, Get, Param, Post, Put, Query, UseFilters
113
} from '@nestjs/common';
124
import { ioRedis } from '@gitroom/nestjs-libraries/redis/redis.service';
135
import { ConnectIntegrationDto } from '@gitroom/nestjs-libraries/dtos/integrations/connect.integration.dto';
@@ -30,6 +22,7 @@ import { PostsService } from '@gitroom/nestjs-libraries/database/prisma/posts/po
3022
import { IntegrationTimeDto } from '@gitroom/nestjs-libraries/dtos/integrations/integration.time.dto';
3123
import { AuthService } from '@gitroom/helpers/auth/auth.service';
3224
import { AuthTokenDetails } from '@gitroom/nestjs-libraries/integrations/social/social.integrations.interface';
25+
import { PlugDto } from '@gitroom/nestjs-libraries/dtos/plugs/plug.dto';
3326
import {
3427
NotEnoughScopes,
3528
RefreshToken,
@@ -538,4 +531,35 @@ export class IntegrationsController {
538531

539532
return this._integrationService.deleteChannel(org.id, id);
540533
}
534+
535+
@Get('/plug/list')
536+
async getPlugList() {
537+
return { plugs: this._integrationManager.getAllPlugs() };
538+
}
539+
540+
@Get('/:id/plugs')
541+
async getPlugsByIntegrationId(
542+
@Param('id') id: string,
543+
@GetOrgFromRequest() org: Organization
544+
) {
545+
return this._integrationService.getPlugsByIntegrationId(org.id, id);
546+
}
547+
548+
@Post('/:id/plugs')
549+
async postPlugsByIntegrationId(
550+
@Param('id') id: string,
551+
@GetOrgFromRequest() org: Organization,
552+
@Body() body: PlugDto
553+
) {
554+
return this._integrationService.createOrUpdatePlug(org.id, id, body);
555+
}
556+
557+
@Put('/plugs/:id/activate')
558+
async changePlugActivation(
559+
@Param('id') id: string,
560+
@GetOrgFromRequest() org: Organization,
561+
@Body('status') status: boolean
562+
) {
563+
return this._integrationService.changePlugActivation(org.id, id, status);
564+
}
541565
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Plugs } from '@gitroom/frontend/components/plugs/plugs';
2+
3+
export const dynamic = 'force-dynamic';
4+
5+
import { Metadata } from 'next';
6+
import { isGeneralServerSide } from '@gitroom/helpers/utils/is.general.server.side';
7+
8+
export const metadata: Metadata = {
9+
title: `${isGeneralServerSide() ? 'Postiz' : 'Gitroom'} Plugs`,
10+
description: '',
11+
};
12+
13+
export default async function Index() {
14+
return (
15+
<>
16+
<Plugs />
17+
</>
18+
);
19+
}

apps/frontend/src/components/layout/top.menu.tsx

+3-8
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,9 @@ export const useMenuItems = () => {
4444
]
4545
: []),
4646
{
47-
name: 'Marketplace',
48-
icon: 'marketplace',
49-
path: '/marketplace',
50-
},
51-
{
52-
name: 'Messages',
53-
icon: 'messages',
54-
path: '/messages',
47+
name: 'Plugs',
48+
icon: 'plugs',
49+
path: '/plugs',
5550
},
5651
{
5752
name: 'Billing',

0 commit comments

Comments
 (0)