-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial account page * admin page components * created pwa support, added account page, refactored api calls methods * added loading state in card components. changed main page content width * added pwa support files * fix response timeout * some improvements. account page navigation * created account page with profile and articles subpages * serverside updates for account page * account page improvements
- Loading branch information
Showing
141 changed files
with
3,122 additions
and
1,398 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
ScienceArchive.DB/functions/articles/get_articles_by_author_id.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
CREATE OR REPLACE FUNCTION "func_get_articles_by_author_id" ( | ||
"p_author_id" UUID | ||
) | ||
RETURNS TABLE ( | ||
"id" UUID, | ||
"categoryId" UUID, | ||
"title" VARCHAR(255), | ||
"description" TEXT, | ||
"creationDate" TIMESTAMP, | ||
"authorsIds" UUID[], | ||
"documents" JSONB | ||
) | ||
LANGUAGE plpgsql | ||
AS $$ | ||
BEGIN | ||
RETURN QUERY | ||
SELECT | ||
a."id", | ||
ac."subcategory_id", | ||
a."title", | ||
a."description", | ||
acr."created_timestamp" AS "creationDate", | ||
( | ||
SELECT | ||
array_agg(ac."author_id") | ||
FROM "articles_authors" as ac | ||
WHERE ac."article_id" = a."id" | ||
) AS "authorsIds", | ||
( | ||
SELECT | ||
jsonb_agg( | ||
json_build_object('document_path', ad."document_path") | ||
) | ||
FROM "articles_documents" AS ad | ||
WHERE ad."article_id" = a."id" | ||
) AS "documents" | ||
FROM "articles" AS a | ||
INNER JOIN "articles_categories" AS ac ON ac."article_id" = a."id" | ||
INNER JOIN "articles_creation" AS acr ON acr."article_id" = a."id" | ||
INNER JOIN "articles_authors" AS aa ON aa."article_id" = a."id" and aa."author_id" = "p_author_id"; | ||
END;$$ |
7 changes: 7 additions & 0 deletions
7
...Server/ScienceArchive.Application/Dtos/Article/Request/GetArticlesByAuthorIdRequestDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace ScienceArchive.Application.Dtos.Article.Request; | ||
|
||
/// <summary> | ||
/// DTO contract to get articles by author ID | ||
/// </summary> | ||
/// <param name="AuthorId">Author ID</param> | ||
public record GetArticlesByAuthorIdRequestDto(string AuthorId); |
7 changes: 7 additions & 0 deletions
7
...rver/ScienceArchive.Application/Dtos/Article/Response/GetArticlesByAuthorIdResponseDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace ScienceArchive.Application.Dtos.Article.Response; | ||
|
||
/// <summary> | ||
/// Response DTO of getting articles by author ID | ||
/// </summary> | ||
/// <param name="Articles">Result set of articles with specified author ID</param> | ||
public record GetArticlesByAuthorIdResponseDto(List<ArticleDto> Articles); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...hive.Server/ScienceArchive.BusinessLogic/UseCases/Article/GetArticlesByAuthorIdUseCase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using ScienceArchive.BusinessLogic.Interfaces; | ||
using ScienceArchive.Core.Domain.Aggregates.Article; | ||
using ScienceArchive.Core.Repositories; | ||
using ScienceArchive.Core.Services.ArticleContracts; | ||
|
||
namespace ScienceArchive.BusinessLogic.ArticleUseCases; | ||
|
||
public class GetArticlesByAuthorIdUseCase : IUseCase<List<Article>, GetArticlesByAuthorIdContract> | ||
{ | ||
private readonly IArticleRepository _articleRepository; | ||
|
||
public GetArticlesByAuthorIdUseCase(IArticleRepository articleRepository) | ||
{ | ||
_articleRepository = articleRepository ?? throw new ArgumentNullException(nameof(articleRepository)); | ||
} | ||
|
||
public async Task<List<Article>> Execute(GetArticlesByAuthorIdContract contract) | ||
{ | ||
return await _articleRepository.GetByAuthorId(contract.AuthorId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ve.Server/ScienceArchive.Core/Services/Article/Contracts/GetArticlesByAuthorIdContract.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using ScienceArchive.Core.Domain.Aggregates.User.ValueObjects; | ||
|
||
namespace ScienceArchive.Core.Services.ArticleContracts; | ||
|
||
/// <summary> | ||
/// Contract to get articles by user id | ||
/// </summary> | ||
/// <param name="AuthorId">Author ID</param> | ||
public record GetArticlesByAuthorIdContract(UserId AuthorId); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"$schema": "./node_modules/@angular/service-worker/config/schema.json", | ||
"index": "/index.html", | ||
"assetGroups": [ | ||
{ | ||
"name": "app", | ||
"installMode": "prefetch", | ||
"resources": { | ||
"files": [ | ||
"/favicon.ico", | ||
"/index.html", | ||
"/manifest.webmanifest", | ||
"/*.css", | ||
"/*.js" | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "assets", | ||
"installMode": "lazy", | ||
"updateMode": "prefetch", | ||
"resources": { | ||
"files": [ | ||
"/assets/**", | ||
"/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)" | ||
] | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.