Skip to content

Commit a5d944c

Browse files
authored
Merge pull request #57 from gitcomteam/feature/50-project-posts
Feature/50 project posts
2 parents bc5c7ae + 5172e00 commit a5d944c

File tree

15 files changed

+845
-225
lines changed

15 files changed

+845
-225
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"react-dom": "^16.12.0",
2020
"react-facebook-login": "^4.1.1",
2121
"react-google-login": "^5.0.7",
22+
"react-markdown": "^4.3.1",
2223
"react-router-dom": "^5.0.1",
2324
"react-scripts": "3.0.1",
2425
"sentry": "^0.1.2",

src/client/bindings.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,12 @@ export interface Repository {
165165
origin_id?: string;
166166
created_at?: string;
167167
}
168+
169+
export class ProjectPost {
170+
guid?: string;
171+
title?: string;
172+
content?: string;
173+
project_guid?: string;
174+
created_at?: string;
175+
updated_at?: string;
176+
}

src/client/models/index.ts

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,17 @@ export interface ProjectProduct {
235235
updatedAt?: string;
236236
}
237237

238+
/**
239+
* An interface representing ProjectPost.
240+
*/
241+
export interface ProjectPost {
242+
guid?: string;
243+
title?: string;
244+
content?: string;
245+
createdAt?: string;
246+
updatedAt?: string;
247+
}
248+
238249
/**
239250
* An interface representing WithdrawalRequest.
240251
*/
@@ -501,6 +512,34 @@ export interface GetProjectBoardsOKResponse {
501512
data?: GetProjectBoardsOKResponseData;
502513
}
503514

515+
/**
516+
* An interface representing GetLatestProjectsPostsOKResponseData.
517+
*/
518+
export interface GetLatestProjectsPostsOKResponseData {
519+
posts?: ProjectPost;
520+
}
521+
522+
/**
523+
* An interface representing GetLatestProjectsPostsOKResponse.
524+
*/
525+
export interface GetLatestProjectsPostsOKResponse {
526+
data?: GetLatestProjectsPostsOKResponseData;
527+
}
528+
529+
/**
530+
* An interface representing GetProjectPostsOKResponseData.
531+
*/
532+
export interface GetProjectPostsOKResponseData {
533+
posts?: ProjectPost;
534+
}
535+
536+
/**
537+
* An interface representing GetProjectPostsOKResponse.
538+
*/
539+
export interface GetProjectPostsOKResponse {
540+
data?: GetProjectPostsOKResponseData;
541+
}
542+
504543
/**
505544
* An interface representing GetBoardOKResponseData.
506545
*/
@@ -1518,6 +1557,46 @@ export type GetProjectBoardsResponse = GetProjectBoardsOKResponse & {
15181557
};
15191558
};
15201559

1560+
/**
1561+
* Contains response data for the getLatestProjectsPosts operation.
1562+
*/
1563+
export type GetLatestProjectsPostsResponse = GetLatestProjectsPostsOKResponse & {
1564+
/**
1565+
* The underlying HTTP response.
1566+
*/
1567+
_response: msRest.HttpResponse & {
1568+
/**
1569+
* The response body as text (string format)
1570+
*/
1571+
bodyAsText: string;
1572+
1573+
/**
1574+
* The response body as parsed JSON or XML
1575+
*/
1576+
parsedBody: GetLatestProjectsPostsOKResponse;
1577+
};
1578+
};
1579+
1580+
/**
1581+
* Contains response data for the getProjectPosts operation.
1582+
*/
1583+
export type GetProjectPostsResponse = GetProjectPostsOKResponse & {
1584+
/**
1585+
* The underlying HTTP response.
1586+
*/
1587+
_response: msRest.HttpResponse & {
1588+
/**
1589+
* The response body as text (string format)
1590+
*/
1591+
bodyAsText: string;
1592+
1593+
/**
1594+
* The response body as parsed JSON or XML
1595+
*/
1596+
parsedBody: GetProjectPostsOKResponse;
1597+
};
1598+
};
1599+
15211600
/**
15221601
* Contains response data for the getBoard operation.
15231602
*/

src/client/models/mappers.ts

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,46 @@ export const ProjectProduct: msRest.CompositeMapper = {
762762
}
763763
};
764764

765+
export const ProjectPost: msRest.CompositeMapper = {
766+
serializedName: "ProjectPost",
767+
type: {
768+
name: "Composite",
769+
className: "ProjectPost",
770+
modelProperties: {
771+
guid: {
772+
serializedName: "guid",
773+
type: {
774+
name: "String"
775+
}
776+
},
777+
title: {
778+
serializedName: "title",
779+
type: {
780+
name: "String"
781+
}
782+
},
783+
content: {
784+
serializedName: "content",
785+
type: {
786+
name: "String"
787+
}
788+
},
789+
createdAt: {
790+
serializedName: "created_at",
791+
type: {
792+
name: "String"
793+
}
794+
},
795+
updatedAt: {
796+
serializedName: "updated_at",
797+
type: {
798+
name: "String"
799+
}
800+
}
801+
}
802+
}
803+
};
804+
765805
export const WithdrawalRequest: msRest.CompositeMapper = {
766806
serializedName: "WithdrawalRequest",
767807
type: {
@@ -1441,6 +1481,74 @@ export const GetProjectBoardsOKResponse: msRest.CompositeMapper = {
14411481
}
14421482
};
14431483

1484+
export const GetLatestProjectsPostsOKResponseData: msRest.CompositeMapper = {
1485+
serializedName: "GetLatestProjectsPostsOKResponse_data",
1486+
type: {
1487+
name: "Composite",
1488+
className: "GetLatestProjectsPostsOKResponseData",
1489+
modelProperties: {
1490+
posts: {
1491+
serializedName: "posts",
1492+
type: {
1493+
name: "Composite",
1494+
className: "ProjectPost"
1495+
}
1496+
}
1497+
}
1498+
}
1499+
};
1500+
1501+
export const GetLatestProjectsPostsOKResponse: msRest.CompositeMapper = {
1502+
serializedName: "GetLatestProjectsPostsOKResponse",
1503+
type: {
1504+
name: "Composite",
1505+
className: "GetLatestProjectsPostsOKResponse",
1506+
modelProperties: {
1507+
data: {
1508+
serializedName: "data",
1509+
type: {
1510+
name: "Composite",
1511+
className: "GetLatestProjectsPostsOKResponseData"
1512+
}
1513+
}
1514+
}
1515+
}
1516+
};
1517+
1518+
export const GetProjectPostsOKResponseData: msRest.CompositeMapper = {
1519+
serializedName: "GetProjectPostsOKResponse_data",
1520+
type: {
1521+
name: "Composite",
1522+
className: "GetProjectPostsOKResponseData",
1523+
modelProperties: {
1524+
posts: {
1525+
serializedName: "posts",
1526+
type: {
1527+
name: "Composite",
1528+
className: "ProjectPost"
1529+
}
1530+
}
1531+
}
1532+
}
1533+
};
1534+
1535+
export const GetProjectPostsOKResponse: msRest.CompositeMapper = {
1536+
serializedName: "GetProjectPostsOKResponse",
1537+
type: {
1538+
name: "Composite",
1539+
className: "GetProjectPostsOKResponse",
1540+
modelProperties: {
1541+
data: {
1542+
serializedName: "data",
1543+
type: {
1544+
name: "Composite",
1545+
className: "GetProjectPostsOKResponseData"
1546+
}
1547+
}
1548+
}
1549+
}
1550+
};
1551+
14441552
export const GetBoardOKResponseData: msRest.CompositeMapper = {
14451553
serializedName: "GetBoardOKResponse_data",
14461554
type: {

src/client/supportHubApi.ts

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,56 @@ class SupportHubApi extends SupportHubApiContext {
430430
callback) as Promise<Models.GetProjectBoardsResponse>;
431431
}
432432

433+
/**
434+
* @param [options] The optional parameters
435+
* @returns Promise<Models.GetLatestProjectsPostsResponse>
436+
*/
437+
getLatestProjectsPosts(options?: msRest.RequestOptionsBase): Promise<Models.GetLatestProjectsPostsResponse>;
438+
/**
439+
* @param callback The callback
440+
*/
441+
getLatestProjectsPosts(callback: msRest.ServiceCallback<Models.GetLatestProjectsPostsOKResponse>): void;
442+
/**
443+
* @param options The optional parameters
444+
* @param callback The callback
445+
*/
446+
getLatestProjectsPosts(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.GetLatestProjectsPostsOKResponse>): void;
447+
getLatestProjectsPosts(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.GetLatestProjectsPostsOKResponse>, callback?: msRest.ServiceCallback<Models.GetLatestProjectsPostsOKResponse>): Promise<Models.GetLatestProjectsPostsResponse> {
448+
return this.sendOperationRequest(
449+
{
450+
options
451+
},
452+
getLatestProjectsPostsOperationSpec,
453+
callback) as Promise<Models.GetLatestProjectsPostsResponse>;
454+
}
455+
456+
/**
457+
* @param projectGuid
458+
* @param [options] The optional parameters
459+
* @returns Promise<Models.GetProjectPostsResponse>
460+
*/
461+
getProjectPosts(projectGuid: string, options?: msRest.RequestOptionsBase): Promise<Models.GetProjectPostsResponse>;
462+
/**
463+
* @param projectGuid
464+
* @param callback The callback
465+
*/
466+
getProjectPosts(projectGuid: string, callback: msRest.ServiceCallback<Models.GetProjectPostsOKResponse>): void;
467+
/**
468+
* @param projectGuid
469+
* @param options The optional parameters
470+
* @param callback The callback
471+
*/
472+
getProjectPosts(projectGuid: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.GetProjectPostsOKResponse>): void;
473+
getProjectPosts(projectGuid: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.GetProjectPostsOKResponse>, callback?: msRest.ServiceCallback<Models.GetProjectPostsOKResponse>): Promise<Models.GetProjectPostsResponse> {
474+
return this.sendOperationRequest(
475+
{
476+
projectGuid,
477+
options
478+
},
479+
getProjectPostsOperationSpec,
480+
callback) as Promise<Models.GetProjectPostsResponse>;
481+
}
482+
433483
/**
434484
* @param boardGuid Board Guid
435485
* @param [options] The optional parameters
@@ -1746,6 +1796,33 @@ const getProjectBoardsOperationSpec: msRest.OperationSpec = {
17461796
serializer
17471797
};
17481798

1799+
const getLatestProjectsPostsOperationSpec: msRest.OperationSpec = {
1800+
httpMethod: "GET",
1801+
path: "api/v1/all_projects/posts/latest/get",
1802+
responses: {
1803+
200: {
1804+
bodyMapper: Mappers.GetLatestProjectsPostsOKResponse
1805+
},
1806+
default: {}
1807+
},
1808+
serializer
1809+
};
1810+
1811+
const getProjectPostsOperationSpec: msRest.OperationSpec = {
1812+
httpMethod: "GET",
1813+
path: "api/v1/project/posts/get",
1814+
queryParameters: [
1815+
Parameters.projectGuid
1816+
],
1817+
responses: {
1818+
200: {
1819+
bodyMapper: Mappers.GetProjectPostsOKResponse
1820+
},
1821+
default: {}
1822+
},
1823+
serializer
1824+
};
1825+
17491826
const getBoardOperationSpec: msRest.OperationSpec = {
17501827
httpMethod: "GET",
17511828
path: "api/v1/board/get",

src/components/entity/board/single/card/BoardCart.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import {Card} from "antd";
33
import {BoardModel} from "../../../../../client/bindings";
44
import {Link} from "react-router-dom";
5+
import moment from "moment";
56

67
interface IProps {
78
fullProjectName: string|null,
@@ -23,7 +24,8 @@ class BoardCard extends React.Component<IProps, IState> {
2324
<p>{this.props.board.description}</p>
2425

2526
<div className="text-left margin-sm-top">
26-
<b>Last updated at: </b> {this.props.board.updated_at}
27+
<b>Last updated at: </b> <br/>
28+
{moment(this.props.board.updated_at).format('MMMM Do YYYY')}
2729
</div>
2830
</Card>
2931
</Link>

src/components/entity/project/many/cards_list/ProjectCardList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class ProjectCardList extends React.Component<IProps, IState> {
6363
{ this.state.isLoaded ?
6464
<Row type={"flex"}>
6565
{projectsList && projectsList.map((project: ProjectModel, i: number) => {
66-
return <Col className="padding-sm" md={8} sm={12} xs={24} key={i}>
66+
return <Col className="padding-sm" sm={12} xs={24} key={i}>
6767
<ProjectCard project={project}/>
6868
</Col>;
6969
})}

0 commit comments

Comments
 (0)