Skip to content

Commit

Permalink
Sidebar for backoffice
Browse files Browse the repository at this point in the history
* full height sidebar
* fluid content container
* document, items, eitems, patrons, series, document requests and statistics
* snapshots update
* aggregations hidden by the spinner while loading
* closes #533
  • Loading branch information
topless authored and zzacharo committed Oct 8, 2019
1 parent 9fe9a61 commit a99e731
Show file tree
Hide file tree
Showing 63 changed files with 817 additions and 988 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,27 @@ import { ResultsPerPage, SortBy, SortOrder } from 'react-searchkit';

export function ResultsSort(props) {
return props.searchConfig.SORT_BY.length ? (
<div className="sorting">
<span className="before">Show</span>
<ResultsPerPage
values={props.searchConfig.RESULTS_PER_PAGE}
defaultValue={props.searchConfig.RESULTS_PER_PAGE[0].value}
/>
<span className="middle">results per page sorted by</span>
<SortBy
values={props.searchConfig.SORT_BY}
defaultValue={props.searchConfig.SORT_BY[0].value}
defaultValueOnEmptyString={props.searchConfig.SORT_BY_ON_EMPTY_QUERY}
/>
<SortOrder
values={props.searchConfig.SORT_ORDER}
defaultValue={props.searchConfig.SORT_ORDER[0]['value']}
/>
<div>
<span>
Show&nbsp;
<ResultsPerPage
values={props.searchConfig.RESULTS_PER_PAGE}
defaultValue={props.searchConfig.RESULTS_PER_PAGE[0].value}
/>
&nbsp;results per page sorted by
</span>
<div>
<SortBy
values={props.searchConfig.SORT_BY}
defaultValue={props.searchConfig.SORT_BY[0].value}
defaultValueOnEmptyString={props.searchConfig.SORT_BY_ON_EMPTY_QUERY}
/>
&nbsp;
<SortOrder
values={props.searchConfig.SORT_ORDER}
defaultValue={props.searchConfig.SORT_ORDER[0]['value']}
/>
</div>
</div>
) : null;
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ export class ResultsTable extends Component {
return (
<Grid>
<Grid.Row>
<Grid.Column width={13} verticalAlign={'middle'}>
<Grid.Column width={8} verticalAlign={'middle'}>
{header}
</Grid.Column>
<Grid.Column width={3} textAlign={'right'}>
<Grid.Column width={8} textAlign={'right'}>
{headerActionComponent}
</Grid.Column>
</Grid.Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ exports[`ResultsTable tests should load the ResultTable component 1`] = `
<GridRow>
<GridColumn
verticalAlign="middle"
width={13}
width={8}
/>
<GridColumn
textAlign="right"
width={3}
width={8}
/>
</GridRow>
</Grid>
Expand Down Expand Up @@ -71,18 +71,18 @@ exports[`ResultsTable tests should not render the see all button when showing on
>
<GridColumn
verticalAlign="middle"
width={13}
width={8}
>
<div
className="middle aligned thirteen wide column"
className="middle aligned eight wide column"
/>
</GridColumn>
<GridColumn
textAlign="right"
width={3}
width={8}
>
<div
className="right aligned three wide column"
className="right aligned eight wide column"
/>
</GridColumn>
</div>
Expand Down Expand Up @@ -611,18 +611,18 @@ exports[`ResultsTable tests should render the see all button when showing only a
>
<GridColumn
verticalAlign="middle"
width={13}
width={8}
>
<div
className="middle aligned thirteen wide column"
className="middle aligned eight wide column"
/>
</GridColumn>
<GridColumn
textAlign="right"
width={3}
width={8}
>
<div
className="right aligned three wide column"
className="right aligned eight wide column"
/>
</GridColumn>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import assign from 'lodash/assign';
import { formatPidTypeToName } from '../ManageRelationsButton/utils';
import { loan as loanApi } from '../../api';
import { BackOfficeRoutes, FrontSiteRoutes } from '../../../routes/urls';
import { invenioConfig } from '../../config';
import { invenioConfig, TRUNCATE_LENGTH } from '../../config';
import startCase from 'lodash/startCase';
import truncate from 'lodash/truncate';

function formatLoanToTableView(loan, actions = null) {
const requestStartDate = loan.metadata.request_start_date
Expand Down Expand Up @@ -122,8 +123,12 @@ function formatEItemToTableView(eitem) {
'Open access': eitem.metadata.open_access ? 'Yes' : 'No',
Created: toShortDate(fromISO(eitem.created)),
Updated: toShortDate(fromISO(eitem.updated)),
Description: eitem.metadata.description,
'Internal Notes': eitem.metadata.internal_notes,
Description: truncate(eitem.metadata.description, {
length: TRUNCATE_LENGTH,
}),
'Internal Notes': truncate(eitem.metadata.internal_notes, {
length: TRUNCATE_LENGTH,
}),
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const ES_DELAY = 3000;
export const ES_MAX_SIZE = 1000;
export const SUCCESS_AUTO_DISMISS_SECONDS = 10;
export const TRUNCATE_LENGTH = 128;

export { getSearchConfig } from './searchConfig';
export { invenioConfig } from './invenioConfig';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { getIn, FieldArray } from 'formik';
import { Form, Button, Segment } from 'semantic-ui-react';
import { Form, Button } from 'semantic-ui-react';

export class ArrayField extends Component {
constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Formik, getIn } from 'formik';
import isEmpty from 'lodash/isEmpty';
import {
Form,
Segment,
Button,
Grid,
Header,
Container,
} from 'semantic-ui-react';
import { Form, Button, Grid, Header, Container } from 'semantic-ui-react';
import { ES_DELAY } from '../../../common/config';

export class BaseForm extends Component {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ StringField.propTypes = {
label: PropTypes.string,
placeholder: PropTypes.string,
required: PropTypes.bool,
required: PropTypes.bool,
uiProps: PropTypes.object,
};

Expand Down
9 changes: 0 additions & 9 deletions invenio_app_ils/ui/src/invenio_app_ils/index.scss

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ exports[`DocumentItems tests should render item 1`] = `
>
<GridColumn
verticalAlign="middle"
width={13}
width={8}
>
<div
className="middle aligned thirteen wide column"
className="middle aligned eight wide column"
>
<Header
as="h3"
Expand All @@ -169,10 +169,10 @@ exports[`DocumentItems tests should render item 1`] = `
</GridColumn>
<GridColumn
textAlign="right"
width={3}
width={8}
>
<div
className="right aligned three wide column"
className="right aligned eight wide column"
/>
</GridColumn>
</div>
Expand Down Expand Up @@ -753,10 +753,10 @@ exports[`DocumentItems tests should render show a message with no items 1`] = `
>
<GridColumn
verticalAlign="middle"
width={13}
width={8}
>
<div
className="middle aligned thirteen wide column"
className="middle aligned eight wide column"
>
<Header
as="h3"
Expand All @@ -780,10 +780,10 @@ exports[`DocumentItems tests should render show a message with no items 1`] = `
</GridColumn>
<GridColumn
textAlign="right"
width={3}
width={8}
>
<div
className="right aligned three wide column"
className="right aligned eight wide column"
/>
</GridColumn>
</div>
Expand Down Expand Up @@ -920,10 +920,10 @@ exports[`DocumentItems tests should render the see all button when showing only
>
<GridColumn
verticalAlign="middle"
width={13}
width={8}
>
<div
className="middle aligned thirteen wide column"
className="middle aligned eight wide column"
>
<Header
as="h3"
Expand All @@ -947,10 +947,10 @@ exports[`DocumentItems tests should render the see all button when showing only
</GridColumn>
<GridColumn
textAlign="right"
width={3}
width={8}
>
<div
className="right aligned three wide column"
className="right aligned eight wide column"
/>
</GridColumn>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ exports[`DocumentPendingLoans tests should render pending loans 1`] = `
>
<GridColumn
verticalAlign="middle"
width={13}
width={8}
>
<div
className="middle aligned thirteen wide column"
className="middle aligned eight wide column"
>
<Header
as="h3"
Expand All @@ -158,10 +158,10 @@ exports[`DocumentPendingLoans tests should render pending loans 1`] = `
</GridColumn>
<GridColumn
textAlign="right"
width={3}
width={8}
>
<div
className="right aligned three wide column"
className="right aligned eight wide column"
/>
</GridColumn>
</div>
Expand Down Expand Up @@ -657,10 +657,10 @@ exports[`DocumentPendingLoans tests should render show a message with no pending
>
<GridColumn
verticalAlign="middle"
width={13}
width={8}
>
<div
className="middle aligned thirteen wide column"
className="middle aligned eight wide column"
>
<Header
as="h3"
Expand All @@ -684,10 +684,10 @@ exports[`DocumentPendingLoans tests should render show a message with no pending
</GridColumn>
<GridColumn
textAlign="right"
width={3}
width={8}
>
<div
className="right aligned three wide column"
className="right aligned eight wide column"
/>
</GridColumn>
</div>
Expand Down Expand Up @@ -815,10 +815,10 @@ exports[`DocumentPendingLoans tests should render the see all button when showin
>
<GridColumn
verticalAlign="middle"
width={13}
width={8}
>
<div
className="middle aligned thirteen wide column"
className="middle aligned eight wide column"
>
<Header
as="h3"
Expand All @@ -842,10 +842,10 @@ exports[`DocumentPendingLoans tests should render the see all button when showin
</GridColumn>
<GridColumn
textAlign="right"
width={3}
width={8}
>
<div
className="right aligned three wide column"
className="right aligned eight wide column"
/>
</GridColumn>
</div>
Expand Down
Loading

0 comments on commit a99e731

Please sign in to comment.