Skip to content

Commit dff387f

Browse files
committed
Merge branch 'release/minor' into dev
2 parents 04ac80c + 205720f commit dff387f

File tree

50 files changed

+771
-64
lines changed

Some content is hidden

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

50 files changed

+771
-64
lines changed

.circleci/config.json.testing renamed to .circleci/config.testing.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111
"jwt": {
1212
"secret_key": "GQDsD21j8s2zdm12F1f1k12",
1313
"token_life_days": 7
14-
}
14+
},
15+
"schedule": {
16+
"token": "fk1092fk21"
17+
}
18+
},
19+
"schedule": {
20+
"token": "F2l901f"
1521
},
16-
"Logging": {
17-
"LogLevel": {
18-
"Default": "Debug",
19-
"System": "Information",
20-
"Microsoft": "Information"
22+
"user": {
23+
"registration": {
24+
"token_bonus": 500
2125
}
2226
}
23-
}
27+
}

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666

6767
- run:
6868
name: copy app config
69-
command: mkdir -p Tests/bin/Debug/netcoreapp2.2/config && cp .circleci/config.json.testing Tests/bin/Debug/netcoreapp2.2/config/config.json
69+
command: mkdir -p Tests/bin/Debug/netcoreapp2.2/config && cp .circleci/config.testing.json Tests/bin/Debug/netcoreapp2.2/config/config.json
7070

7171
- run:
7272
name: yum install dotnet core sdk 2.2

App/AL/Controller/Alias/Project/ProjectAliasController.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ public ProjectAliasController() {
2121
var alias = ProjectAliasRepository.FindByAlias(
2222
GetRequestStr("owner"), GetRequestStr("alias")
2323
);
24+
if (alias == null) return HttpResponse.Error(HttpStatusCode.NotFound, "Project not found");
2425

25-
if (alias == null) {
26-
return HttpResponse.Error(HttpStatusCode.NotFound, "Project not found");
27-
}
28-
2926
return HttpResponse.Item("project", new ProjectTransformer().Transform(alias.Project()));
3027
});
3128
}

App/AL/Controller/Auth/External/GitHub/GithubAuthController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public GithubAuthController() {
5959
"We're unable to get your access token, please try again");
6060
}
6161

62-
var githubClient = new GitHubClient(new ProductHeaderValue("SupportHub"));
62+
var githubClient = new GitHubClient(new ProductHeaderValue("GitCom"));
6363

6464
githubClient.Credentials = new Credentials(accessToken);
6565

App/AL/Controller/Auth/JwtAuthController.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ public JwtAuthController() {
3939
return HttpResponse.Error(
4040
new HttpError(HttpStatusCode.Unauthorized, "Your email / password combination is incorrect")
4141
);
42-
43-
var queuedItem = RegistrationQueueItemRepository.Find(user);
44-
if (queuedItem != null && !queuedItem.email_confirmed)
42+
43+
if (!user.EmailConfirmed())
4544
return HttpResponse.Error(HttpStatusCode.Forbidden, "You need to confirm your email");
4645

4746
return HttpResponse.Data(new JObject() {

App/AL/Controller/Card/CardController.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Micron.DL.Module.Controller;
88
using Micron.DL.Module.Http;
99
using Micron.DL.Module.Validator;
10+
using Newtonsoft.Json.Linq;
1011

1112
namespace App.AL.Controller.Card {
1213
public sealed class CardController : BaseController {
@@ -33,8 +34,21 @@ public CardController() {
3334
if (errors.Count > 0) return HttpResponse.Errors(errors);
3435

3536
var column = BoardColumnRepository.FindByGuid(GetRequestStr("column_guid"));
36-
37-
return HttpResponse.Item("cards", new CardTransformer().Many(column.Cards()));
37+
38+
var page = GetRequestInt("page");
39+
page = page > 0 ? page : 1;
40+
41+
var pageSize = 25;
42+
43+
return HttpResponse.Data(new JObject() {
44+
["data"] = new JObject() {
45+
["cards"] = new CardTransformer().Many(column.Cards(page, pageSize))
46+
},
47+
["meta"] = new JObject() {
48+
["pages_count"] = (column.CardsCount() / pageSize)+1,
49+
["current_page"] = page
50+
}
51+
});
3852
});
3953
}
4054
}

App/AL/Controller/External/MyIntegrationsController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public MyIntegrationsController() {
2121
JObject githubUser = null;
2222

2323
if (githubToken != null) {
24-
var githubClient = new GitHubClient(new ProductHeaderValue("SupportHub"));
24+
var githubClient = new GitHubClient(new ProductHeaderValue("GitCom"));
2525

2626
githubClient.Credentials = new Credentials(githubToken.access_token);
2727

App/AL/Controller/Funding/Balance/FundingBalanceController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using App.AL.Validation.Entity;
33
using App.DL.Enum;
44
using App.DL.Repository.Funding;
5-
using App.DL.Repository.User;
65
using App.PL.Transformer.Funding;
76
using Micron.AL.Validation.Basic;
87
using Micron.AL.Validation.String;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using App.DL.Repository.Project;
2+
using App.PL.Transformer.Image;
3+
using Micron.AL.Validation.Db;
4+
using Micron.DL.Middleware;
5+
using Micron.DL.Module.Controller;
6+
using Micron.DL.Module.Http;
7+
using Micron.DL.Module.Validator;
8+
9+
namespace App.AL.Controller.Project.Image {
10+
public class ProjectImageController : BaseController {
11+
protected override IMiddleware[] Middleware() => new IMiddleware[] { };
12+
13+
public ProjectImageController() {
14+
Get("/api/v1/project/images/get", _ => {
15+
var errors = ValidationProcessor.Process(Request, new IValidatorRule[] {
16+
new ExistsInTable("project_guid", "projects", "guid"),
17+
});
18+
if (errors.Count > 0) return HttpResponse.Errors(errors);
19+
20+
var project = ProjectRepository.FindByGuid(GetRequestStr("project_guid"));
21+
22+
return HttpResponse.Item("images", new ImageTransformer().Many(project.Images()));
23+
});
24+
}
25+
}
26+
}

App/AL/Controller/Project/ProjectController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace App.AL.Controller.Project {
1010
public sealed class ProjectController : BaseController {
11-
protected override IMiddleware[] Middleware() => new IMiddleware[] {};
11+
protected override IMiddleware[] Middleware() => new IMiddleware[] { };
1212

1313
public ProjectController() {
1414
Get("/api/v1/project/get", _ => {

0 commit comments

Comments
 (0)