Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge/frontend #157

Merged
merged 18 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
5c9e4e9
fix(ChannelApi): rename 'type' field to 'channelType' for match with …
Ro0t-set May 20, 2024
5c4c2d9
fix(frontendApi): rename 'message' property to 'content' for matching…
Ro0t-set May 20, 2024
9e5cf3f
build(kubernetes): update frontend and micronaut container images to …
Ro0t-set May 20, 2024
a0f766e
feat(deploy): increase CPU limit to 700 for strimzi-cluster-operator …
Ro0t-set May 21, 2024
a7c0546
fix(frontend): change CreateChannelApi request params in order to mat…
luigi-borriello00 May 21, 2024
e82ccbc
fix(frontend): change getChannels response in order to match backend one
luigi-borriello00 May 21, 2024
3adc1d8
refactor(server-controller-impl): update endpoint paths from /partici…
Ro0t-set May 21, 2024
0d30e19
fix(api): update property names in Channel and Server interface
Ro0t-set May 21, 2024
85f60e7
refactor(api): rename 'channelType' property to 'type' in GetServersApi
Ro0t-set May 21, 2024
d7b0005
fix(servers-service): rename 'to' parameter to 'limit'.
Ro0t-set May 21, 2024
5696fc4
feat(servers-service): modify request object structure in ChannelApi …
Ro0t-set May 21, 2024
4133170
fix(pinia-stores): update channelType property to type for consistenc…
Ro0t-set May 21, 2024
4f8e6d1
fix(channel-service): fix addMessage into channel
luigi-borriello00 May 21, 2024
dc4289a
fix(vue): change multimedia to MULTIMEDIA. Remove unnecessary usePhot…
Ro0t-set May 21, 2024
56d502f
fix(channel-service): fix getMessage sublist returned
luigi-borriello00 May 21, 2024
039e71f
fix(components): update 'participants' to 'users' in ServerMenu
Ro0t-set May 21, 2024
31e6055
refactor(login-vue): refactor useUserStore to handle whoami response …
Ro0t-set May 24, 2024
38a44eb
fix(api): change error property to message
Ro0t-set May 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
kubectl create namespace piper-kt
kubectl apply -f kubernetes/auth.yml
helm repo add mongodb https://mongodb.github.io/helm-charts
helm install strimzi-cluster-operator --set replicas=1 --set resources.limits.cpu=500 oci://quay.io/strimzi-helm/strimzi-kafka-operator --namespace piper-kt
helm install strimzi-cluster-operator --set replicas=1 --set resources.limits.cpu=700 oci://quay.io/strimzi-helm/strimzi-kafka-operator --namespace piper-kt
kubectl apply -f kubernetes/kafka.yml --namespace piper-kt
helm install --set image.tag=0.9.0-arm64 community-operator mongodb/community-operator --namespace piper-kt \
--set watchNamespaces=piper-kt\
--values kubernetes/operator-values.yaml


microservice_list=("friendships-service" "users-service" "servers-service" "multimedia-service")
#microservice_list=("users-service")
for microservice in "${microservice_list[@]}"
do
helm install $microservice kubernetes/helm-chart/piper-chart --values $microservice/helm-values/micronaut-values.yaml
Expand Down
6 changes: 3 additions & 3 deletions frontend-service/src/main/vue/api/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ErrorResponse } from "./response";

export class InternalServerError extends ErrorResponse {
statusCode = 500;
error = "Internal Server Error" as const;
message = "Internal Server Error" as const;
errorMessage: unknown;
constructor(e: unknown = "") {
super();
Expand All @@ -12,7 +12,7 @@ export class InternalServerError extends ErrorResponse {

export class BadRequest extends ErrorResponse {
statusCode = 400;
error = "Bad Request" as const;
message = "Bad Request" as const;
missingParams: string[];
missingBody: string[];
missingQuery?: string[];
Expand All @@ -26,5 +26,5 @@ export class BadRequest extends ErrorResponse {

export class JwtTokenMissingOrInvalid extends ErrorResponse {
statusCode = 401;
error = "JWT Token Missing or Invalid" as const;
message = "JWT Token Missing or Invalid" as const;
}
12 changes: 6 additions & 6 deletions frontend-service/src/main/vue/api/messages/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ export module GetChannelMessagesApi {
export module Errors {
export class ChannelNotFound extends ErrorResponse {
statusCode = 404;
error = "Channel not found" as const;
message = "Channel not found" as const;
}
export class ServerNotFound extends ErrorResponse {
statusCode = 404;
error = "Server not found" as const;
message = "Server not found" as const;
}

export class UserNotAuthorized extends ErrorResponse {
statusCode = 403;
error = "User not authorized" as const;
message = "User not authorized" as const;
}

export type Type = ChannelNotFound | ServerNotFound | UserNotAuthorized;
Expand Down Expand Up @@ -91,15 +91,15 @@ export module SendMessageInChannelApi {
export module Errors {
export class ChannelNotFound extends ErrorResponse {
statusCode = 404;
error = "Channel not found" as const;
message = "Channel not found" as const;
}
export class ServerNotFound extends ErrorResponse {
statusCode = 404;
error = "Server not found" as const;
message = "Server not found" as const;
}
export class UserNotAuthorized extends ErrorResponse {
statusCode = 403;
error = "User not authorized" as const;
message = "User not authorized" as const;
}
export type Type = ChannelNotFound | ServerNotFound | UserNotAuthorized;
}
Expand Down
8 changes: 4 additions & 4 deletions frontend-service/src/main/vue/api/messages/direct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export module GetDirectMessagesApi {
export module Errors {
export class DirectNotFound extends ErrorResponse {
statusCode = 404;
error = "Direct not found" as const;
message = "Direct not found" as const;
}
export type Type = DirectNotFound;
}
Expand All @@ -56,7 +56,7 @@ export module SendDirectMessageApi {
username: string;
};
export type Body = {
message: string;
content: string;
};
export type Query = Empty;
export const Schema: RequestSchema = {
Expand All @@ -78,11 +78,11 @@ export module SendDirectMessageApi {
export module Errors {
export class DirectNotFound extends ErrorResponse {
statusCode = 404;
error = "Direct not found" as const;
message = "Direct not found" as const;
}
export class CannotSendDirectMessageToYourself extends ErrorResponse {
statusCode = 400;
error = "Cannot send direct message to yourself" as const;
message = "Cannot send direct message to yourself" as const;
}
export type Type = DirectNotFound | CannotSendDirectMessageToYourself;
}
Expand Down
65 changes: 43 additions & 22 deletions frontend-service/src/main/vue/api/piperchat/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,37 @@ export module GetChannelsApi {
Body: {},
};
}

export module Responses {
interface Channel {
id: string;
name: string;
createdAt: Date;
channelType: string;
type: string;
description?: string;
}

export class Success extends Response {
statusCode = 200;
message = "Channels retrieved successfully";

constructor(public channels: Channel[]) {
super();
}
}

export type Type = Success;
}
export module Errors {
export class ServerNotFound extends ErrorResponse {
statusCode = 404;
error = "Server not found" as const;
message = "Server not found" as const;
}

export class UserNotAuthorized extends ErrorResponse {
statusCode = 403;
error = "User not authorized" as const;
message = "User not authorized" as const;
}

export type Type = ServerNotFound | UserNotAuthorized;
}
export type Response = Responses.Type | Errors.Type;
Expand All @@ -65,32 +70,35 @@ export module GetChannelByIdApi {
export interface Channel {
id: string;
name: string;
createdAt: Date;
channelType: string;
type: string;
description?: string;
}

export class Success extends Response {
statusCode = 200;
message = "Channels retrieved successfully";

constructor(public channel: Channel) {
super();
}
}

export type Type = Success;
}
export module Errors {
export class ChannelNotFound extends ErrorResponse {
statusCode = 404;
error = "Channel not found" as const;
message = "Channel not found" as const;
}

export class UserNotAuthorized extends ErrorResponse {
statusCode = 403;
error = "User not authorized" as const;
message = "User not authorized" as const;
}

export class ServerNotFound extends ErrorResponse {
statusCode = 404;
error = "Server not found" as const;
message = "Server not found" as const;
}

export type Type = ChannelNotFound | UserNotAuthorized | ServerNotFound;
Expand All @@ -100,9 +108,10 @@ export module GetChannelByIdApi {

export module CreateChannelApi {
export enum ChannelType {
Messages = "messages",
Multimedia = "multimedia",
Messages = "TEXT",
Multimedia = "MULTIMEDIA",
}

export module Request {
export type Type = Body & Params;
export type Params = {
Expand Down Expand Up @@ -132,35 +141,39 @@ export module CreateChannelApi {
channelType: string;
description?: string;
}

export class Success extends Response {
statusCode = 200;
message = "Channel created successfully";
channel: Channel;

constructor(channel: Channel) {
super();
this.channel = channel;
}
}

export type Type = Success;
}
export module Errors {
export class ServerNotFound extends ErrorResponse {
statusCode = 404;
error = "Server not found" as const;
message = "Server not found" as const;
}

export class UserNotAuthorized extends ErrorResponse {
statusCode = 403;
error = "User not authorized" as const;
message = "User not authorized" as const;
}

export class ChannelAlreadyExists extends ErrorResponse {
statusCode = 409;
error = "Channel already exists" as const;
message = "Channel already exists" as const;
}

export class InvalidChannelType extends ErrorResponse {
statusCode = 400;
error = "Invalid channel type" as const;
message = "Invalid channel type" as const;
}

export type Type =
Expand Down Expand Up @@ -199,26 +212,30 @@ export module UpdateChannelApi {
statusCode = 200;
message = "Channel updated successfully";
}

export type Type = Success;
}
export module Errors {
export class ServerNotFound extends ErrorResponse {
statusCode = 404;
error = "Server not found" as const;
message = "Server not found" as const;
}

export class ChannelNotFound extends ErrorResponse {
statusCode = 404;
error = "Channel not found" as const;
message = "Channel not found" as const;
}

export class UserNotAuthorized extends ErrorResponse {
statusCode = 403;
error = "User not authorized" as const;
message = "User not authorized" as const;
}

export class ChannelAlreadyExists extends ErrorResponse {
statusCode = 409;
error = "Channel already exists" as const;
message = "Channel already exists" as const;
}

export type Type =
| ServerNotFound
| ChannelNotFound
Expand Down Expand Up @@ -249,21 +266,25 @@ export module DeleteChannelApi {
statusCode = 200;
message = "Channel deleted successfully";
}

export type Type = Success;
}
export module Errors {
export class ServerNotFound extends ErrorResponse {
statusCode = 404;
error = "Server not found" as const;
message = "Server not found" as const;
}

export class ChannelNotFound extends ErrorResponse {
statusCode = 404;
error = "Channel not found" as const;
message = "Channel not found" as const;
}

export class UserNotAuthorized extends ErrorResponse {
statusCode = 403;
error = "User not authorized" as const;
message = "User not authorized" as const;
}

export type Type = ServerNotFound | ChannelNotFound | UserNotAuthorized;
}
export type Response = Responses.Type | Errors.Type;
Expand Down
Loading
Loading