Share report template functionality
This commit is contained in:
parent
e6ad0e239e
commit
4822a50d0b
35 changed files with 614 additions and 128 deletions
|
|
@ -1,8 +1,9 @@
|
|||
'use strict';
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { translate, Trans } from 'react-i18next';
|
||||
import { withPageHelpers, Title } from '../lib/page'
|
||||
import { requiresAuthenticatedUser, withPageHelpers, Title } from '../lib/page';
|
||||
import {
|
||||
withForm, Form, FormSendMethod, InputField, TextArea, TableSelect, TableSelectMode, ButtonRow, Button,
|
||||
Fieldset
|
||||
|
|
@ -16,6 +17,7 @@ import moment from 'moment';
|
|||
@withForm
|
||||
@withPageHelpers
|
||||
@withErrorHandling
|
||||
@requiresAuthenticatedUser
|
||||
export default class CUD extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
@ -33,6 +35,10 @@ export default class CUD extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
static propTypes = {
|
||||
edit: PropTypes.bool
|
||||
}
|
||||
|
||||
isDelete() {
|
||||
return this.props.match.params.action === 'delete';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import React, { Component } from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import { Title, Toolbar, NavButton } from '../lib/page';
|
||||
import { withPageHelpers, Title, Toolbar, NavButton } from '../lib/page';
|
||||
import { Table } from '../lib/table';
|
||||
import { withErrorHandling, withAsyncErrorHandler } from '../lib/error-handling';
|
||||
import moment from 'moment';
|
||||
|
|
@ -11,6 +11,7 @@ import { ReportState } from '../../../shared/reports';
|
|||
|
||||
@translate()
|
||||
@withErrorHandling
|
||||
@withPageHelpers
|
||||
export default class List extends Component {
|
||||
|
||||
@withAsyncErrorHandler
|
||||
|
|
|
|||
|
|
@ -2,13 +2,14 @@
|
|||
|
||||
import React, { Component } from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import { withPageHelpers, Title } from '../lib/page'
|
||||
import { requiresAuthenticatedUser, withPageHelpers, Title } from '../lib/page'
|
||||
import { withErrorHandling, withAsyncErrorHandler } from '../lib/error-handling';
|
||||
import axios from '../lib/axios';
|
||||
|
||||
@translate()
|
||||
@withPageHelpers
|
||||
@withErrorHandling
|
||||
@requiresAuthenticatedUser
|
||||
export default class Output extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import React, { Component } from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import { withPageHelpers, Title } from '../lib/page'
|
||||
import { requiresAuthenticatedUser, withPageHelpers, Title } from '../lib/page'
|
||||
import { withErrorHandling, withAsyncErrorHandler } from '../lib/error-handling';
|
||||
import axios from '../lib/axios';
|
||||
import { ReportState } from '../../../shared/reports';
|
||||
|
|
@ -10,6 +10,7 @@ import { ReportState } from '../../../shared/reports';
|
|||
@translate()
|
||||
@withPageHelpers
|
||||
@withErrorHandling
|
||||
@requiresAuthenticatedUser
|
||||
export default class View extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
|
|
|||
|
|
@ -5,13 +5,15 @@ import ReactDOM from 'react-dom';
|
|||
import { I18nextProvider } from 'react-i18next';
|
||||
import i18n from '../lib/i18n';
|
||||
|
||||
import { Section } from '../lib/page'
|
||||
import ReportsCUD from './CUD'
|
||||
import ReportsList from './List'
|
||||
import ReportsView from './View'
|
||||
import ReportsOutput from './Output'
|
||||
import ReportTemplatesCUD from './templates/CUD'
|
||||
import ReportTemplatesList from './templates/List'
|
||||
import { Section } from '../lib/page';
|
||||
import ReportsCUD from './CUD';
|
||||
import ReportsList from './List';
|
||||
import ReportsView from './View';
|
||||
import ReportsOutput from './Output';
|
||||
import ReportTemplatesCUD from './templates/CUD';
|
||||
import ReportTemplatesList from './templates/List';
|
||||
import Share from '../shares/Share';
|
||||
|
||||
|
||||
const getStructure = t => {
|
||||
const subPaths = {};
|
||||
|
|
@ -59,11 +61,16 @@ const getStructure = t => {
|
|||
title: t('Create Report Template'),
|
||||
params: [':wizard?'],
|
||||
render: props => (<ReportTemplatesCUD {...props} />)
|
||||
},
|
||||
share: {
|
||||
title: t('Share Report Template'),
|
||||
params: [':id'],
|
||||
render: props => (<Share title={entity => t('Share Report Template "{{name}}"', {name: entity.name})} getUrl={id => `/rest/report-templates/${id}`} entityTypeId="reportTemplate" {...props} />)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { translate, Trans } from 'react-i18next';
|
||||
import { withPageHelpers, Title } from '../../lib/page'
|
||||
import { withForm, Form, FormSendMethod, InputField, TextArea, Dropdown, ACEEditor, ButtonRow, Button } from '../../lib/form';
|
||||
|
|
@ -25,6 +26,10 @@ export default class CUD extends Component {
|
|||
this.initForm();
|
||||
}
|
||||
|
||||
static propTypes = {
|
||||
edit: PropTypes.bool
|
||||
}
|
||||
|
||||
isDelete() {
|
||||
return this.props.match.params.action === 'delete';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,18 @@
|
|||
import React, { Component } from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import { DropdownMenu } from '../../lib/bootstrap-components';
|
||||
import { Title, Toolbar, DropdownLink } from '../../lib/page';
|
||||
import { requiresAuthenticatedUser, withPageHelpers, Title, Toolbar, DropdownLink } from '../../lib/page';
|
||||
import { Table } from '../../lib/table';
|
||||
import moment from 'moment';
|
||||
|
||||
@translate()
|
||||
@withPageHelpers
|
||||
@requiresAuthenticatedUser
|
||||
export default class List extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
const t = this.props.t;
|
||||
|
||||
|
|
@ -16,6 +22,10 @@ export default class List extends Component {
|
|||
{
|
||||
label: 'Edit',
|
||||
link: '/reports/templates/edit/' + data[0]
|
||||
},
|
||||
{
|
||||
label: 'Share',
|
||||
link: '/reports/templates/share/' + data[0]
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue