feat: add project billable entries link & alert.

This commit is contained in:
elforjani13
2022-09-25 22:27:40 +02:00
parent 6055184084
commit 8ac881cfd7
4 changed files with 74 additions and 20 deletions

View File

@@ -0,0 +1,37 @@
// @ts-nocheck
import React from 'react';
import styled from 'styled-components';
import * as R from 'ramda';
import { ButtonLink } from '@/components';
import withDialogActions from '@/containers/Dialog/withDialogActions';
function ProjectBillableEntriesLinkComponent({
// #ownProps
children,
projectId,
className,
// #withDialogAction
openDialog,
}) {
const handleBillableEntries = (event) => {
openDialog('project-billable-entries', { projectId });
event.preventDefault();
};
return (
<BillableEntriesLink className={className} onClick={handleBillableEntries}>
{children}
</BillableEntriesLink>
);
}
export const ProjectBillableEntriesLink = R.compose(withDialogActions)(
ProjectBillableEntriesLinkComponent,
);
const BillableEntriesLink = styled(ButtonLink)`
font-size: 11px;
margin-top: 6px;
`;

View File

@@ -1,9 +1,10 @@
// @ts-nocheck
export * from './ExpenseSelect';
export * from './ChangeTypesSelect';
export * from './TaskSelect';
export * from './ProjectTaskSelect';
export * from './ProjectTaskChargeTypeSelect';
export * from './ProjectsSelect';
export * from './ProjectMultiSelect'
export * from './ProjectMultiSelect';
export * from './FInputGroupComponent';
export * from './ProjectSuggestField'
export * from './ProjectBillableTypeSuggestField'
export * from './ProjectSuggestField';
export * from './ProjectBillableTypeSuggestField';
export * from './ProjectBillableEntriesLink';

View File

@@ -1,9 +1,24 @@
// @ts-nocheck
import React from 'react';
import moment from 'moment';
import { Callout, Intent, Classes } from '@blueprintjs/core';
import { CLASSES } from '@/constants/classes';
import { FormattedMessage as T } from '@/components';
export const getDefaultQuery = () => {
return {
billableType: '',
to_date: moment(new Date()).format('YYYY-MM-DD'),
};
};
/**
* Empty status callout.
* @returns {React.JSX}
*/
export function EmptyStatuCallout() {
return (
<div className={Classes.DIALOG_BODY}>
<Callout intent={Intent.PRIMARY}>
<p>
<T
id={'project_billable_entries.alert.there_is_no_billable_entries'}
/>
</p>
</Callout>
</div>
);
}