Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
40ff841
Blog module created.
thebishaldeb Dec 15, 2019
966e6f0
medium-draft added.
thebishaldeb Dec 15, 2019
c9b2df9
medium-draft imagwe file to base64.
thebishaldeb Dec 15, 2019
ec6007b
RenderUpload fixed and added in blog form.
thebishaldeb Dec 19, 2019
092e032
RenderUpload title and card in blog form.
thebishaldeb Dec 19, 2019
2855877
Blog view component done.
thebishaldeb Dec 20, 2019
3d7a161
Blog route done.
thebishaldeb Dec 20, 2019
9d824f7
Merge branch 'master' of https://github.com/beingtmk/nodejs-starter-kit
thebishaldeb Dec 21, 2019
5d4882f
Icon for like added.
thebishaldeb Dec 21, 2019
a9fa3bf
RenderSelect modified
thebishaldeb Dec 23, 2019
61d4faa
User and Model Details Card added below the blog details.
thebishaldeb Dec 23, 2019
84e5b5c
BlogDetails Views done!
thebishaldeb Dec 24, 2019
9e83582
Blog Form error handled!
thebishaldeb Dec 24, 2019
9d6b1d9
Model in form created.
thebishaldeb Dec 26, 2019
e13a496
renderTagsField added
thebishaldeb Dec 26, 2019
059d124
Status added and blog form completed
thebishaldeb Dec 26, 2019
36cd353
Bookmark and dropdown added.
thebishaldeb Dec 28, 2019
4548b51
Bookmark page added.
thebishaldeb Dec 28, 2019
d0e9d88
MyBlogs page added.
thebishaldeb Dec 28, 2019
501e7de
Some changes.
thebishaldeb Dec 28, 2019
a3bc242
Some changes 2.0
thebishaldeb Dec 28, 2019
87d9299
Blog List done!
thebishaldeb Jan 1, 2020
25bfb70
Image component extracted.
thebishaldeb Jan 1, 2020
70b3250
Blog Actions component extracted.
thebishaldeb Jan 1, 2020
4a6d122
Blog User Page added.
thebishaldeb Jan 2, 2020
7c67b2b
Image height handled in background for the cards.
thebishaldeb Jan 2, 2020
3468c1e
Comment module added.
thebishaldeb Jan 5, 2020
5334634
Blog DropDOwn added and few other changes made.
thebishaldeb Jan 7, 2020
6895f9f
Demo Data for comments
thebishaldeb Jan 8, 2020
740ced1
Collapse added.
thebishaldeb Jan 8, 2020
2f3fab9
Comment form added.
thebishaldeb Jan 10, 2020
a199901
Add and Delete Comment added and working.
thebishaldeb Jan 10, 2020
8a1f718
Comment modal added.
thebishaldeb Jan 12, 2020
02c0231
Reply and Edit forms added.
thebishaldeb Jan 12, 2020
54b55c0
Reply and Edit working using state change
thebishaldeb Jan 12, 2020
8ac0e51
Edit Form added.
thebishaldeb Jan 21, 2020
00390d8
Admin blog list table created.
thebishaldeb Jan 24, 2020
f4691bc
Admin blog list table created 2.0.
thebishaldeb Jan 24, 2020
19bfe7b
Admin blog list table created 3.0.
thebishaldeb Jan 24, 2020
e37b05f
Blog Backend - Migration table created.
thebishaldeb Jan 26, 2020
dfaebe7
Objection js added
thebishaldeb Jan 29, 2020
eddabf6
Blog backend schema added and sql settings done
thebishaldeb Jan 29, 2020
1951bd6
Blog Query added
thebishaldeb Jan 29, 2020
7032230
Blog Mutations added
thebishaldeb Jan 29, 2020
ab2655a
AuthRoute added.
thebishaldeb Jan 31, 2020
f904d92
Model frontend and queries and add and delete mutation added.
thebishaldeb Jan 31, 2020
f9ed082
Subscription of model added.
thebishaldeb Feb 2, 2020
20dbdf8
Subscription of blogs added.
thebishaldeb Feb 2, 2020
0ea3f59
Update model added.
thebishaldeb Feb 2, 2020
cd13002
Models retrieved dynamically from database in blog forms.
thebishaldeb Feb 3, 2020
ff916ab
Blog Add done.
thebishaldeb Feb 3, 2020
d780517
Merge with upstream.
thebishaldeb Feb 3, 2020
556d37b
Blog edit done.
thebishaldeb Feb 4, 2020
43b1c9a
blogs admin done.
thebishaldeb Feb 12, 2020
c539af0
all blogs done.
thebishaldeb Feb 12, 2020
7a31054
my blogs done.
thebishaldeb Feb 12, 2020
a74754d
blog details done.
thebishaldeb Feb 12, 2020
6890522
Blog seeds added.
thebishaldeb Feb 17, 2020
7c32bf3
changes.
thebishaldeb Feb 17, 2020
77721e8
Comment backend 1.0
thebishaldeb Apr 8, 2020
560b711
Seeds added.
thebishaldeb Apr 8, 2020
c424c07
Comment backend 2.0
thebishaldeb Apr 8, 2020
fec583c
Comment backend 3.0
thebishaldeb Apr 8, 2020
6e0b82b
Comment frontend 1.0.
thebishaldeb Apr 8, 2020
4203f24
Comment frontend 2.0.
thebishaldeb Apr 8, 2020
5a99f64
Likes backend 1.0.
thebishaldeb Apr 8, 2020
bbde665
Likes module complete.
thebishaldeb Apr 8, 2020
c411bc9
Likes module bugs removed.
thebishaldeb Apr 8, 2020
6402e6a
Bookmark module done!
thebishaldeb Apr 11, 2020
c7f47ce
like nav removed!
thebishaldeb Apr 11, 2020
37a3b03
bookmark nav removed!
thebishaldeb Apr 11, 2020
5209b6c
Bookmark done.
thebishaldeb Apr 12, 2020
dc5b426
Undefined name handled.
thebishaldeb Apr 12, 2020
c7facd7
Read buttons added.
thebishaldeb Apr 12, 2020
6321551
undefineds replaced
thebishaldeb Apr 12, 2020
ef0731d
Fork update.
thebishaldeb Apr 29, 2020
df6299b
remote update.
thebishaldeb May 3, 2020
ba16f1b
yarn.lock
thebishaldeb May 3, 2020
448f01e
Geolocation module.
thebishaldeb May 6, 2020
460dbc4
Blog redesigned according to edgenus.
thebishaldeb May 9, 2020
b52a2b4
Blog details page.
thebishaldeb May 9, 2020
bd0ea94
Bookmarks cards
thebishaldeb May 9, 2020
21c5b81
Tag module done
thebishaldeb May 10, 2020
f05a7bd
linting
thebishaldeb May 11, 2020
0fbb1b8
Interfaces added, subsriptions modified
thebishaldeb May 12, 2020
68285ff
fork update
thebishaldeb May 12, 2020
089091d
knex error fix
thebishaldeb May 14, 2020
3bee95c
Backend of group
thebishaldeb May 14, 2020
80673e1
Backend of group done!
thebishaldeb May 14, 2020
2125de6
Blog filter backend
thebishaldeb May 15, 2020
9440775
Blog filter frontend.
thebishaldeb May 15, 2020
9ecd6a4
Infinite scroll 1.0
thebishaldeb May 15, 2020
3fda11c
Inifinite scroll 2.0
thebishaldeb May 15, 2020
381e94b
Inifinite scroll 3.0
thebishaldeb May 15, 2020
db372e5
React dependencies
thebishaldeb May 16, 2020
bc3d41d
React dependences - 2
thebishaldeb May 16, 2020
c2d3e50
Blog section navbar
thebishaldeb May 18, 2020
5fe22d8
Group add and edit forms
thebishaldeb May 18, 2020
5efd477
Group details
thebishaldeb May 18, 2020
a1efbd4
Group Detail Page.
thebishaldeb May 18, 2020
48d466b
Admin list with filter and infinite scroll
thebishaldeb May 18, 2020
8534edd
MyGroups Section
thebishaldeb May 18, 2020
24e1abd
Seeds added
thebishaldeb May 18, 2020
a73fa0f
Filters modifiedd
thebishaldeb May 18, 2020
9d209bc
Mailer added
thebishaldeb May 18, 2020
21da7c3
Table format
thebishaldeb May 19, 2020
6236957
Update
thebishaldeb Jun 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
463 changes: 463 additions & 0 deletions demo.txt

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions modules/authentication/server-ts/access/jwt/resolvers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@ import createTokens from './createTokens';

export default () => ({
Mutation: {
async refreshTokens(
obj,
{ refreshToken: inputRefreshToken },
{
getIdentity,
getHash,
req: { t }
}
) {
async refreshTokens(obj, { refreshToken: inputRefreshToken }, { getIdentity, getHash, req: { t } }) {
const decodedToken = jwt.decode(inputRefreshToken);
const isValidToken = decodedToken && decodedToken.id;

Expand Down
19 changes: 19 additions & 0 deletions modules/blog/client-react/__tests__/Blog.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { expect } from 'chai';

import { updateContent, Renderer } from '@gqlapp/testing-client-react';

describe('Blog UI works', () => {
const renderer = new Renderer({});
const app = renderer.mount();
renderer.history.push('/Blog');
const content = updateContent(app.container);

it('Blog page renders on mount', () => {
// tslint:disable:no-unused-expression
expect(content).to.not.be.empty;
});

it('Blog page has title', async () => {
expect(content.textContent).to.include('Hello, This is the Blog module');
});
});
156 changes: 156 additions & 0 deletions modules/blog/client-react/components/AdminBlogsComponent.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
/* eslint-disable react/display-name */
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import { Table, Loading } from '@gqlapp/look-client-react';
import { Popconfirm, Button, message, Tooltip, Spin, Divider } from 'antd';
import InfiniteScroll from 'react-infinite-scroll-component';

class AdminBlogsComponent extends React.Component {
fetchMoreData = async () => {
let hasMore = this.props.blogs.pageInfo.hasNextPage;
const endCursor = this.props.blogs.pageInfo.endCursor;
if (!hasMore) return;
await this.props.loadData(endCursor + 1, 'add');
};

render() {
const { blogs, deleteBlog, blogLoading } = this.props;

const cancel = () => {
message.error('Task cancelled');
};

const columns = [
{
title: <a href="#">{'Id'}</a>,
dataIndex: 'id',
key: 'id',
sorter: (a, b) => a.id - b.id,
sortDirections: ['descend', 'ascend']
},
{
title: <a href="#">{'Title'}</a>,
dataIndex: 'title',
key: 'title',
sorter: (a, b) => a.title.length - b.title.length,
sortDirections: ['descend', 'ascend']
},
{
title: <a href="#">{'Author'}</a>,
dataIndex: 'author',
key: 'author',
sorter: (a, b) => a.author.username.length - b.author.username.length,
sortDirections: ['descend', 'ascend'],
render: text =>
// <Tooltip title="See Profile">
// <Link to={`/blog/@${text.username}`}>
// {
// text.id === currentUser.id ? "You" :
text.username
// }
// </Link>
// </Tooltip>
},
{
title: <a href="#">{'Model'}</a>,
dataIndex: 'model',
key: 'model',
sorter: (a, b) => a.model.name.length - b.model.name.length,
sortDirections: ['descend', 'ascend'],
render: text => <span>{text.name}</span>
},
{
title: 'Actions',
dataIndex: 'id',
key: 'actions',
render: text => (
<>
<Tooltip title="Read">
{' '}
<Link to={`/blog/${text}`}>
<Button
shape="circle"
icon="eye"
type="primary"
size="small"
style={{ marginBottom: '10px', marginRight: '3px' }}
/>
</Link>
</Tooltip>
<Tooltip title="Edit">
<Link to={`/blog/edit/${text}`}>
<Button
shape="circle"
icon="edit"
type="primary"
size="small"
style={{ marginBottom: '10px', marginRight: '3px' }}
ghost
/>
</Link>
</Tooltip>
<Tooltip title="Delete">
<Popconfirm
title="Delete blog?"
onConfirm={() => deleteBlog(text)}
onCancel={cancel}
okText="Yes"
cancelText="No"
>
<Button
shape="circle"
icon="delete"
type="danger"
size="small"
style={{ marginBottom: '10px', marginRight: '3px' }}
/>
</Popconfirm>
</Tooltip>
</>
)
}
];

return (
<>
{blogLoading && !blogs ? (
<Loading text="Loading... " />
) : (
<Fragment>
<InfiniteScroll
scrollThreshold={0.9}
style={{ overflow: 'none' }}
dataLength={blogs.edges.length}
next={this.fetchMoreData}
hasMore={blogs.pageInfo.hasNextPage}
loader={
<div align="center">
<Spin />
</div>
}
endMessage={
<Divider>
<p style={{ textAlign: 'center', marginTop: '25px' }}>
<b>End of Blogs</b>
</p>
</Divider>
}
>
<Table dataSource={blogs.edges.map(({ node }) => node)} columns={columns} />
</InfiniteScroll>
</Fragment>
)}
</>
);
}
}

AdminBlogsComponent.propTypes = {
blogLoading: PropTypes.bool.isRequired,
blogs: PropTypes.object,
loadData: PropTypes.object,
deleteBlog: PropTypes.func
};

export default AdminBlogsComponent;
50 changes: 50 additions & 0 deletions modules/blog/client-react/components/AdminBlogsView.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import React from 'react';
import Helmet from 'react-helmet';
import PropTypes from 'prop-types';
import { PageLayout, Loading, Button } from '@gqlapp/look-client-react';
import settings from '@gqlapp/config';
import { Link } from 'react-router-dom';
// import { message } from 'antd';
import AdminBlogsComponent from './AdminBlogsComponent';
import BlogsFilterComponent from './BlogsFilterComponent';

const renderMetaData = t => (
<Helmet
title={`${settings.app.name} - ${t('title')}`}
meta={[{ name: 'description', content: `${settings.app.name} - ${t('meta')}` }]}
/>
);

class AdminBlogsView extends React.Component {
state = { flag: false };
componentDidMount() {
this.setState({ flag: true });
}
render() {
return (
<PageLayout>
{renderMetaData(this.props.t)}
{this.props.models && this.props.filter && (
<>
<Link to="/blog/new">
<Button color="primary">{'Add New Blog'}</Button>
</Link>
<br />
<hr />
<BlogsFilterComponent {...this.props} />
<hr />
</>
)}
{this.state.flag && !this.props.blogLoading ? <AdminBlogsComponent {...this.props} /> : <Loading />}
</PageLayout>
);
}
}
AdminBlogsView.propTypes = {
t: PropTypes.func,
blogLoading: PropTypes.bool,
filter: PropTypes.object,
models: PropTypes.array
};

export default AdminBlogsView;
128 changes: 128 additions & 0 deletions modules/blog/client-react/components/AdminModelsListComponent.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/* eslint-disable react/display-name */

import React from 'react';
import PropTypes from 'prop-types';
import { Table, Loading } from '@gqlapp/look-client-react';
import { Popconfirm, Button, message } from 'antd';

import ModelsFormComponent from './ModelsFormComponent';

const ModelsComponent = ({
// orderBy,
// onOrderBy,
loading,
models,
// currentUser,
addModel,
deleteModel,
updateModel
}) => {
const cancel = () => {
message.error('Task cancelled');
};

// const renderOrderByArrow = name => {
// if (orderBy && orderBy.column === name) {
// if (orderBy.order === "desc") {
// return <span className="badge badge-primary">&#8595;</span>;
// } else {
// return <span className="badge badge-primary">&#8593;</span>;
// }
// } else {
// return <span className="badge badge-secondary">&#8645;</span>;
// }
// };

// const handleOrderBy = (e, name) => {
// e.preventDefault();
// let order = "asc";
// if (orderBy && orderBy.column === name) {
// if (orderBy.order === "asc") {
// order = "desc";
// } else if (orderBy.order === "desc") {
// return onOrderBy({
// column: "",
// order: ""
// });
// }
// }
// return onOrderBy({ column: name, order });
// };

const handleDelete = id => {
return deleteModel(id);
};

const columns = [
{
title: (
<a /*onClick={e => handleOrderBy(e, 'name')}*/ href="#">
{'Name'} {/*renderOrderByArrow('name')*/}
</a>
),
dataIndex: 'name',
key: 'name',
sorter: (a, b) => a.name.length - b.name.length,
sortDirections: ['descend', 'ascend']
},
{
title: (
<a /*onClick={e => handleOrderBy(e, ' gearCategory')}*/ href="#">
{'Description'} {/*renderOrderByArrow(' gearCategory')*/}
</a>
),
dataIndex: 'desc',
key: 'desc',
sorter: (a, b) => a.desc.length - b.desc.length,
sortDirections: ['descend', 'ascend']
},
{
title: 'Delete',
key: 'actions',
dataIndex: 'id',
render: (text, record) => (
<>
<Popconfirm
title="Cancel Request?"
onConfirm={() => handleDelete(text)}
onCancel={cancel}
okText="Yes"
cancelText="No"
>
<Button shape="circle" icon="delete" type="danger" size="small" />
</Popconfirm>
<ModelsFormComponent model={record} title={'Edit the Model'} onSubmit={updateModel} />
</>
)
}
];

return (
<>
{loading && !models ? (
<Loading text="Loading... " />
) : (
<>
<Table
dataSource={models}
columns={columns}
title={() => <ModelsFormComponent title={'Add a Model'} onSubmit={addModel} />}
/>
</>
)}
</>
);
};

ModelsComponent.propTypes = {
loading: PropTypes.bool.isRequired,
models: PropTypes.array,
// orderBy: PropTypes.object,
// onOrderBy: PropTypes.func.isRequired,
currentUser: PropTypes.object,
addModel: PropTypes.func,
updateModel: PropTypes.func,
deleteModel: PropTypes.func
};

export default ModelsComponent;
Loading