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

feat(series): Created series entity create/edit routes and display page #649

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
809fccb
feat(series): created action creators for series-section
akashgp09 Jun 12, 2021
3a159fc
feat(series): created reducers for series-section
akashgp09 Jun 12, 2021
0fa07d2
feat(series): created SeriesSection component
akashgp09 Jun 13, 2021
9234445
refactor(collection): moved helper functions to utils
akashgp09 Jun 13, 2021
666678b
feat(relAttribute): created relationship attribute component
akashgp09 Jun 13, 2021
47e6fbc
feat(relationships): added new actions and reducers for relationship-…
akashgp09 Jun 13, 2021
54b9c5f
feat(relationships): added attributes to relationship-editor
akashgp09 Jun 13, 2021
3b29fc6
feat(relationships): Drag n Drop Reorderable relationships
akashgp09 Jun 13, 2021
13ba26c
feat(entity-table): added new column to all entity tables
akashgp09 Jun 13, 2021
50aea2a
feat(series) created entity create and edit routes
akashgp09 Jun 13, 2021
1cd5f11
feat(routes): added attribute,attributeSetId property to rel object
akashgp09 Jun 13, 2021
b3bddca
feat(series): created series entity display page
akashgp09 Jun 13, 2021
3348ac3
feat(series): added validators for series section
akashgp09 Jun 13, 2021
613e199
feat(series): added series to menu and other helper function
akashgp09 Jun 13, 2021
b72c8c4
feat(series): created two new middleware loadSeriesOrderingTypes and …
akashgp09 Jun 13, 2021
1d57084
feat(editor): shifted RelationshipSection below Entity-section
akashgp09 Jun 13, 2021
8b59e15
test(series): added validation tests for series
akashgp09 Jun 13, 2021
3ba0838
created some helper functions
akashgp09 Jun 13, 2021
d9d4338
added new types for relationship attributes
akashgp09 Jun 13, 2021
f94780b
feat(search): added series to ES index
akashgp09 Jun 13, 2021
11e6cc2
feat(entity): created getNextRelationshipAttributeSets func
akashgp09 Jun 13, 2021
cf7145c
chore: fix linting errors
akashgp09 Jun 13, 2021
3cfa0e7
feat(series): sort series automatically by number
akashgp09 Jun 14, 2021
0865184
feat: updated routes and middlewares
akashgp09 Jun 14, 2021
5f51c1c
Merge remote-tracking branch 'upstream/series-entity' into series-ent…
akashgp09 Jun 14, 2021
1c4fd82
chore: fix package-lock.json file
akashgp09 Jun 14, 2021
ba0130e
feat(relationship): created new component RelationshipAttribute
akashgp09 Jun 16, 2021
89326fb
improve: sort relationships
akashgp09 Jun 16, 2021
b909c99
fix: empty string is saved when attribute value is deleted
akashgp09 Jun 18, 2021
3da339a
refactor: added and updated types
akashgp09 Jun 18, 2021
1d7f9ea
improve: updated sorting technique
akashgp09 Jun 23, 2021
28d5b7d
docs: added comments for sortRelationships action creator
akashgp09 Jun 23, 2021
3b89638
refactored loadEntities middleware
akashgp09 Jun 23, 2021
e622dff
refactor(series): updated series-section
akashgp09 Jun 23, 2021
1ef93d6
feat(series): display total item count in the series
akashgp09 Jun 23, 2021
0221b6b
refactor(middleware): attach attributes to relationship object
akashgp09 Jun 23, 2021
36c2146
chore(dependencies): bump bookbrainz-data from 2.10.0 to 2.11.0
akashgp09 Jun 23, 2021
8ee7064
docs: wrote JSDoc for some functions
akashgp09 Jun 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 21 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -35,7 +35,8 @@
"@fortawesome/free-brands-svg-icons": "^5.14.0",
"@fortawesome/free-solid-svg-icons": "^5.14.0",
"@fortawesome/react-fontawesome": "^0.1.11",
"bookbrainz-data": "^2.10.0",
"array-move": "^3.0.1",
"bookbrainz-data": "^2.11.0",
"chart.js": "^2.9.4",
"chartjs-adapter-date-fns": "^1.0.0",
"classnames": "^2.2.5",
Expand Down Expand Up @@ -69,6 +70,7 @@
"react-hot-loader": "^4.13.0",
"react-redux": "^5.1.2",
"react-select": "^1.1.0",
"react-sortable-hoc": "^2.0.0",
"react-sticky": "^6.0.1",
"react-virtualized-select": "^3.0.1",
"redux": "^3.7.2",
Expand Down
29 changes: 1 addition & 28 deletions src/client/components/pages/collection.js
Expand Up @@ -18,48 +18,21 @@

import * as bootstrap from 'react-bootstrap';
import {faPencilAlt, faPlus, faTimesCircle, faTrashAlt} from '@fortawesome/free-solid-svg-icons';
import {formatDate, getEntityKey, getEntityTable} from '../../helpers/utils';
import AddEntityToCollectionModal from './parts/add-entity-to-collection-modal';
import AuthorTable from './entities/author-table';
import DeleteOrRemoveCollaborationModal from './parts/delete-or-remove-collaboration-modal';
import {ENTITY_TYPE_ICONS} from '../../helpers/entity';
import EditionGroupTable from './entities/editionGroup-table';
import EditionTable from './entities/edition-table';
import EntityImage from './entities/image';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import PagerElement from './parts/pager';
import PropTypes from 'prop-types';
import PublisherTable from './entities/publisher-table';
import React from 'react';
import WorkTable from './entities/work-table';
import _ from 'lodash';
import {formatDate} from '../../helpers/utils';
import request from 'superagent';


const {Alert, Badge, Button, Col, Row} = bootstrap;

function getEntityTable(entityType) {
const tables = {
Author: AuthorTable,
Edition: EditionTable,
EditionGroup: EditionGroupTable,
Publisher: PublisherTable,
Work: WorkTable
};
return tables[entityType];
}

function getEntityKey(entityType) {
const keys = {
Author: 'authors',
Edition: 'editions',
EditionGroup: 'editionGroups',
Publisher: 'publishers',
Work: 'works'
};
return keys[entityType];
}

function CollectionAttributes({collection}) {
return (
<div>
Expand Down
5 changes: 4 additions & 1 deletion src/client/components/pages/entities/author-table.js
Expand Up @@ -29,6 +29,7 @@ const {transformISODateForDisplay, extractAttribute, getEntityDisambiguation, ge
function AuthorTableRow({author, showAddedAtColumn, showCheckboxes, selectedEntities, onToggleRow}) {
const name = getEntityLabel(author);
const disambiguation = getEntityDisambiguation(author);
const number = author.number || '?';
const authorType = author.authorType ? author.authorType.label : '?';
const gender = author.gender ? author.gender.name : '?';
const beginDate = transformISODateForDisplay(extractAttribute(author.beginDate));
Expand All @@ -37,6 +38,7 @@ function AuthorTableRow({author, showAddedAtColumn, showCheckboxes, selectedEnti
/* eslint-disable react/jsx-no-bind */
return (
<tr>
{author.displayNumber && <td>{number}</td>}
<td>
{
showCheckboxes ?
Expand Down Expand Up @@ -83,7 +85,8 @@ function AuthorTable({authors, showAddedAtColumn, showCheckboxes, selectedEntiti
<Table striped>
<thead>
<tr>
<th style={{width: '50%'}}>Name</th>
{authors[0].displayNumber && <th style={{width: '10%'}}>#</th>}
<th>Name</th>
<th>Gender</th>
<th>Type</th>
<th>Date of birth</th>
Expand Down
3 changes: 3 additions & 0 deletions src/client/components/pages/entities/edition-table.js
Expand Up @@ -37,6 +37,7 @@ const {Button, Table} = bootstrap;
function EditionTableRow({edition, showAddedAtColumn, showCheckboxes, selectedEntities, onToggleRow}) {
const name = getEntityLabel(edition);
const disambiguation = getEntityDisambiguation(edition);
const number = edition.number || '?';
const releaseDate = getEditionReleaseDate(edition);
const isbn = getISBNOfEdition(edition);
const editionFormat = getEditionFormat(edition);
Expand All @@ -45,6 +46,7 @@ function EditionTableRow({edition, showAddedAtColumn, showCheckboxes, selectedEn
/* eslint-disable react/jsx-no-bind */
return (
<tr>
{edition.displayNumber && <td>{number}</td>}
<td>
{
showCheckboxes ?
Expand Down Expand Up @@ -101,6 +103,7 @@ function EditionTable({editions, entity, showAddedAtColumn, showAdd, showCheckbo
<Table striped>
<thead>
<tr>
{editions[0].displayNumber && <th style={{width: '10%'}}>#</th>}
<th>Name</th>
<th>Format</th>
<th>ISBN</th>
Expand Down
3 changes: 3 additions & 0 deletions src/client/components/pages/entities/editionGroup-table.js
Expand Up @@ -30,13 +30,15 @@ const {getEntityDisambiguation, getEntityLabel} = entityHelper;

function EditionGroupTableRow({editionGroup, showAddedAtColumn, showCheckboxes, selectedEntities, onToggleRow}) {
const name = getEntityLabel(editionGroup);
const number = editionGroup.number || '?';
const disambiguation = getEntityDisambiguation(editionGroup);
const editionGroupType = editionGroup.editionGroupType ? editionGroup.editionGroupType.label : '?';
const addedAt = showAddedAtColumn ? utilHelper.formatDate(new Date(editionGroup.addedAt), true) : null;

/* eslint-disable react/jsx-no-bind */
return (
<tr>
{editionGroup.displayNumber && <td>{number}</td>}
<td>
{
showCheckboxes ?
Expand Down Expand Up @@ -78,6 +80,7 @@ function EditionGroupTable({editionGroups, showAddedAtColumn, showCheckboxes, se
<Table striped>
<thead>
<tr>
{editionGroups[0].displayNumber && <th style={{width: '10%'}}>#</th>}
<th>Name</th>
<th>Type</th>
{
Expand Down
5 changes: 4 additions & 1 deletion src/client/components/pages/entities/publisher-table.js
Expand Up @@ -29,6 +29,7 @@ const {transformISODateForDisplay, extractAttribute, getEntityDisambiguation, ge

function PublisherTableRow({showAddedAtColumn, publisher, showCheckboxes, selectedEntities, onToggleRow}) {
const name = getEntityLabel(publisher);
const number = publisher.number || '?';
const disambiguation = getEntityDisambiguation(publisher);
const publisherType = publisher.publisherType ? publisher.publisherType.label : '?';
const area = publisher.area ? publisher.area.name : '?';
Expand All @@ -39,6 +40,7 @@ function PublisherTableRow({showAddedAtColumn, publisher, showCheckboxes, select
/* eslint-disable react/jsx-no-bind */
return (
<tr>
{publisher.displayNumber && <td>{number}</td>}
<td>
{
showCheckboxes ?
Expand Down Expand Up @@ -83,7 +85,8 @@ function PublisherTable({showAddedAtColumn, publishers, showCheckboxes, selected
<Table striped>
<thead>
<tr>
<th style={{width: '50%'}}>Name</th>
{publishers[0].displayNumber && <th style={{width: '10%'}}>#</th>}
<th>Name</th>
<th>Area</th>
<th>Type</th>
<th>Date founded</th>
Expand Down