Commit 5c5b2d8b by jhrabal

radegast

parent 3a777e12
...@@ -2,7 +2,6 @@ package com.jh.radegast.rating; ...@@ -2,7 +2,6 @@ package com.jh.radegast.rating;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
......
webpackJsonp([245],{1248:function(n,c){}}); webpackJsonp([245],{1249:function(n,c){}});
\ No newline at end of file \ No newline at end of file
webpackJsonp([246],{1247:function(n,c){}}); webpackJsonp([246],{1248:function(n,c){}});
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
export default {
}
\ No newline at end of file
import React from 'react';
import icons from 'constants/icons';
export default ({ row, dateType, onClick }) => {
return (
<div className="flex-list-row">
<div className="content">
<div className="list-row-data">
<div className="record-type">
<div className="icon">
{ icons[row.type] || icons.empty }
<div className={`status-indicator ${row.status || "pending"}`}/>
</div>
<div className="date">{ dateType == "BILLED_DATE" ? formatDate(row.billedDate) : formatDate(row.dueDate) }</div>
</div>
<div className="main">
<div className="main-value">
{ row.name }
</div>
<div className="additional-info">
{ row.description || " " }
</div>
</div>
<div className="right main-value p5">
{ formatMoney(row.amount, row.currency) }
</div>
</div>
</div>
<div className="actions">
<button className="icon" onClick={ () => handleBillableClick(row.type, row.objectId, router) }>{icons.leftMenu}</button>
</div>
</div>
);
}
\ No newline at end of file
import React, { Component } from 'react';
import { EditableList } from 'lib/components';
import Toast from 'components/Toast';
import ContactForm from 'components/ContactForm';
import { injectIntl } from 'react-intl';
import messages from './messages.js';
class ContactList extends EditableList {
renderFooter(disabled) {
let intl = this.props.intl;
return (
<div className="right p10">
<button type="button" className="btn" onClick={ () => this.showCreateForm(-1) } disabled={ disabled }>{ intl.formatMessage(messages.addContacz) }</button>
</div>
);
}
renderItemForm(item, key, disabled) {
return (
<ContactForm
className="p10 editable-list-inline-form"
data={ item }
key={ key }
i18n={ this.props.i18n }
onCancel={ () => this.hideForm() }
onSubmit={ (data) => this.saveItem(data) }
/>
);
}
renderItem(item, key, disabled) {
let secondary = [];
if (item.phone) {
secondary.push(item.phone);
}
if (item.email) {
secondary.push(item.email);
}
if (item.skype) {
secondary.push(item.skype);
}
return (
<div className="list-row bottom-border" key={ key }>
<div className="row-content row">
<div className="left p10">
<div className="main">{ item.name }</div>
<div className="secondary">{ secondary.join(" | ") }</div>
</div>
</div>
<div className="row-menu">
<span className="icon" onClick={ () => this.showEditForm(key) }></span>
<span className="icon" onClick={ () => this.deleteItem(key) }></span>
</div>
</div>
);
}
}
export default injectIntl(ContactList);
\ No newline at end of file
{
"changed": {
"addContact": {
"id": "components.DashboardList.addContact",
"message": "Add contact",
"defaultMessage": "Add contact"
}
},
"translated": {}
}
\ No newline at end of file
export default {
addContact: {
id: "components.DashboardList.addContact",
defaultMessage: "Add contact"
}
}
\ No newline at end of file
import React, { Component } from 'react'; import React, { Component } from 'react';
import messages from './messages.js'; import { Bar, HorizontalBar } from 'react-chartjs-2';
import { injectIntl } from 'react-intl';
import { Bar, Doughnut, HorizontalBar } from 'react-chartjs-2';
import DoughnutChartLegend from 'components/DoughnutChartLegend';
import palette from 'utils/palette'; import palette from 'utils/palette';
import icons from 'constants/icons';
const options = { const options = {
responsive: true, responsive: true,
animation: false, animation: false,
maintainAspectRatio: false, maintainAspectRatio: false,
barValueSpacing: 10,
legend: { legend: {
display: false, display: false,
}, },
...@@ -26,33 +20,35 @@ const options = { ...@@ -26,33 +20,35 @@ const options = {
}; };
let emptyCount = 5;
function emptyLabels() { function emptyLabels() {
let year = (new Date()).getFullYear();
let years = []; let years = [];
for (let i = 0; i < emptyCount; i++) { for (let i = 1; i < 11; i++) {
years.push(year - i); years.push(i);
} }
return years; return years;
} }
function emptyValues() { function emptyValues() {
return emptyLabels(); let years = [];
for (let i = 1; i < 11; i++) {
years.push(0);
}
return years;
} }
export default injectIntl((props) => { export default (props) => {
let { className, empty, years, values } = props; let { className, values } = props;
if (!years || !values) { let empty = false;
if (!values) {
empty = true; empty = true;
} }
let color = palette(global._chartColors, 1)[0]; let color = palette(global._chartColors, 1)[0];
let data = { let data = {
labels: empty ? emptyLabels() : years, labels: emptyLabels(),
datasets: [{ datasets: [{
label: 'X', label: 'X',
backgroundColor: color, backgroundColor: color,
...@@ -66,7 +62,7 @@ export default injectIntl((props) => { ...@@ -66,7 +62,7 @@ export default injectIntl((props) => {
return ( return (
<div className={ className } style={{ minHeight: 300 }}> <div className={ className } style={{ minHeight: 300 }}>
<HorizontalBar data={ data } options={ options } /> <Bar data={ data } options={ options } />
</div> </div>
); );
}); };
\ No newline at end of file \ No newline at end of file
{
"changed": {
"draftLabel": {
"id": "components.StatusChart.draftLabel",
"message": "Draft",
"defaultMessage": "Draft"
},
"activeLabel": {
"id": "components.StatusChart.activeLabel",
"message": "Active",
"defaultMessage": "Active"
},
"finishedLabel": {
"id": "components.StatusChart.finishedLabel",
"message": "Finished",
"defaultMessage": "Finished"
},
"overdueLabel": {
"id": "components.StatusChart.overdueLabel",
"message": "Overdue",
"defaultMessage": "Overdue"
}
},
"translated": {}
}
\ No newline at end of file
{
"changed": {},
"translated": {
"emailSent": {
"id": "component.Toast.emailSent",
"message": "Email byl odeslán",
"defaultMessage": "Email was sent"
},
"validationErrors": {
"id": "component.Toast.validationErrors",
"message": "Formulář obsahuje chyby",
"defaultMessage": "Validation failed"
}
}
}
\ No newline at end of file
{
"changed": {},
"translated": {
"homeMenu": {
"id": "containers.App.homeMenu",
"message": "Přehled",
"defaultMessage": "Home"
},
"customersMenu": {
"id": "containers.App.customersMenu",
"message": "Zákazníci",
"defaultMessage": "Customers"
},
"incomeMenu": {
"id": "containers.App.incomeMenu",
"message": "Příjmy",
"defaultMessage": "Income"
},
"expensesMenu": {
"id": "containers.App.expensesMenu",
"message": "Náklady",
"defaultMessage": "Expenses"
},
"paymentsMenu": {
"id": "containers.App.paymentsMenu",
"message": "Platby",
"defaultMessage": "Payments"
},
"reportsMenu": {
"id": "containers.App.reportsMenu",
"message": "Reporty",
"defaultMessage": "Reports"
},
"settingsMenu": {
"id": "containers.App.settingsMenu",
"message": "Nastavení",
"defaultMessage": "Settings"
},
"logoutMenu": {
"id": "containers.App.logoutMenu",
"message": "Odhlásit",
"defaultMessage": "Logout"
}
}
}
\ No newline at end of file
...@@ -2,31 +2,7 @@ export default { ...@@ -2,31 +2,7 @@ export default {
homeMenu: { homeMenu: {
id: "containers.App.homeMenu", id: "containers.App.homeMenu",
defaultMessage: "Home" defaultMessage: "Overview"
},
customersMenu: {
id: "containers.App.customersMenu",
defaultMessage: "Customers"
},
incomeMenu: {
id: "containers.App.incomeMenu",
defaultMessage: "Income"
},
expensesMenu: {
id: "containers.App.expensesMenu",
defaultMessage: "Expenses"
},
paymentsMenu: {
id: "containers.App.paymentsMenu",
defaultMessage: "Payments"
},
reportsMenu: {
id: "containers.App.reportsMenu",
defaultMessage: "Reports"
},
settingsMenu: {
id: "containers.App.settingsMenu",
defaultMessage: "Settings"
}, },
logoutMenu: { logoutMenu: {
id: "containers.App.logoutMenu", id: "containers.App.logoutMenu",
......
...@@ -9,6 +9,7 @@ import { PageTitle, ActivityIndicator, Info, MessagePanel, SummaryPanel, Toolbar ...@@ -9,6 +9,7 @@ import { PageTitle, ActivityIndicator, Info, MessagePanel, SummaryPanel, Toolbar
//components //components
import StatusChart from 'components/StatusChart'; import StatusChart from 'components/StatusChart';
import RatingBarChart from 'components/RatingBarChart';
import CopyrightInfo from 'components/CopyrightInfo'; import CopyrightInfo from 'components/CopyrightInfo';
import FetchedContent, { ErrorInfo } from 'components/FetchedContent'; import FetchedContent, { ErrorInfo } from 'components/FetchedContent';
...@@ -126,8 +127,8 @@ class DashboardSummary extends Component { ...@@ -126,8 +127,8 @@ class DashboardSummary extends Component {
return ( return (
<div className="row-flex box-margin-5"> <div className="row-flex box-margin-5">
{ this.renderSummaryPanel(status, messages.incomeTitle, "", data.ratings || 0, intl, "income") } { this.renderSummaryPanel(status, messages.ratingsCount, "", data.ratings || 0, intl, "income") }
{ this.renderSummaryPanel(status, messages.outcomeTitle, "", formatNumber(data.average || 0, i18n, 2), intl, "expenses") } { this.renderSummaryPanel(status, messages.averageRating, "", formatNumber(data.average || 0, i18n, 2), intl, "expenses") }
</div> </div>
); } ); }
} }
...@@ -136,6 +137,29 @@ DashboardSummary = connect(settingsSelector((state, props) => state.getIn(["home ...@@ -136,6 +137,29 @@ DashboardSummary = connect(settingsSelector((state, props) => state.getIn(["home
DashboardSummary = injectIntl(DashboardSummary); DashboardSummary = injectIntl(DashboardSummary);
class DashboardBarChart extends Component {
render() {
let { data, status, i18n, intl, className } = this.props;
if (!data) {
data = {};
}
let values = [];
for (let i = 1; i < 11; i++) {
values.push(data && data.values[i] || 0);
}
return (
<div>
{ status == "failed" ? <ErrorInfo /> : <RatingBarChart values={ values } /> }
<ActivityIndicator show={ status == "pending" } type="overlay" />
</div>
); }
}
DashboardBarChart = connect(settingsSelector((state, props) => state.getIn(["home", "stats"]).toJS()), (dispatch) => ({}))(DashboardBarChart);
DashboardBarChart = injectIntl(DashboardBarChart);
class Home extends Component { class Home extends Component {
...@@ -192,6 +216,9 @@ class Home extends Component { ...@@ -192,6 +216,9 @@ class Home extends Component {
<PageTitle title={ intl.formatMessage(messages.pageTitle) } titleIcon={ icons.home } /> <PageTitle title={ intl.formatMessage(messages.pageTitle) } titleIcon={ icons.home } />
</ToolbarSection> </ToolbarSection>
<ToolbarButtons> <ToolbarButtons>
<ToolbarButton label={ intl.formatMessage(messages.refreshButton) } onClick={ this.init }>
<span className="icon">{ icons.refresh }</span>
</ToolbarButton>
</ToolbarButtons> </ToolbarButtons>
</Toolbar> </Toolbar>
</div> </div>
...@@ -202,12 +229,17 @@ class Home extends Component { ...@@ -202,12 +229,17 @@ class Home extends Component {
<DashboardList from={ from } to={ to } i18n={ i18n } onRefresh={ this.init } /> <DashboardList from={ from } to={ to } i18n={ i18n } onRefresh={ this.init } />
</div> </div>
</div> </div>
<div className="col-md-8 p10"> <div className="col-md-8">
<div className="p10">
<DashboardSummary i18n={ i18n } onRefresh={ this.init }/> <DashboardSummary i18n={ i18n } onRefresh={ this.init }/>
</div> </div>
<div className="p10">
<DashboardBarChart i18n={ i18n } onRefresh={ this.init }/>
</div>
</div>
</div> </div>
<CopyrightInfo version={ global.cfg.version }/> <CopyrightInfo version={ global.cfg.version || "0.0.1" }/>
</div> </div>
); );
} }
......
{
"changed": {},
"translated": {
"pageTitle": {
"id": "containers.Home.pageTitle",
"message": "Přehled",
"defaultMessage": "Overview"
},
"cashflowTitle": {
"id": "containers.Home.cashflowTitle",
"message": "Peněžní tok",
"defaultMessage": "Cashflow"
},
"incomeTitle": {
"id": "containers.Home.incomeTitle",
"message": "Příjmy",
"defaultMessage": "Income"
},
"outcomeTitle": {
"id": "containers.Home.outcomeTitle",
"message": "Náklady",
"defaultMessage": "Outcome"
},
"summaryTitle": {
"id": "containers.Home.summaryTitle",
"message": "Celkem",
"defaultMessage": "Summary"
},
"draft": {
"id": "containers.Home.statusDraft",
"message": "Návrh",
"defaultMessage": "Draft"
},
"active": {
"id": "containers.Home.statusActive",
"message": "Aktivní",
"defaultMessage": "Active"
},
"finished": {
"id": "containers.Home.statusFinished",
"message": "Dokončeno",
"defaultMessage": "Finished"
},
"overdue": {
"id": "containers.Home.statusOverdue",
"message": "Po splatnosti",
"defaultMessage": "Overdue"
},
"statusIncome": {
"id": "containers.Home.statusIncome",
"message": "Příjmy",
"defaultMessage": "Income"
},
"statusOutcome": {
"id": "containers.Home.statusOutcome",
"message": "Náklady",
"defaultMessage": "Outcome"
},
"addPaymentButton": {
"id": "containers.Home.addPaymentButton",
"message": "Přidat platbu",
"defaultMessage": "Add payment"
},
"addExpenseButton": {
"id": "containers.Home.addExpenseButton",
"message": "Přidat výdaj",
"defaultMessage": "Add expense"
},
"addIncomeButton": {
"id": "containers.Home.addIncomeButton",
"message": "Přidat příjem",
"defaultMessage": "Add income"
},
"addInvoiceButton": {
"id": "containers.Home.addInvoiceButton",
"message": "Přidat fakturu",
"defaultMessage": "Add invoice"
}
}
}
\ No newline at end of file
...@@ -5,64 +5,17 @@ export default { ...@@ -5,64 +5,17 @@ export default {
defaultMessage: "Overview" defaultMessage: "Overview"
}, },
cashflowTitle: { ratingsCount: {
id: "containers.Home.cashflowTitle", id: "containers.Home.ratingsCount",
defaultMessage: "Cashflow" defaultMessage: "Ratings"
}, },
incomeTitle: { averageRating: {
id: "containers.Home.incomeTitle", id: "containers.Home.averageRating",
defaultMessage: "Income" defaultMessage: "Average rating"
},
outcomeTitle: {
id: "containers.Home.outcomeTitle",
defaultMessage: "Outcome"
},
summaryTitle: {
id: "containers.Home.summaryTitle",
defaultMessage: "Summary"
},
draft: {
id: "containers.Home.statusDraft",
defaultMessage: "Draft"
},
active: {
id: "containers.Home.statusActive",
defaultMessage: "Active"
},
finished: {
id: "containers.Home.statusFinished",
defaultMessage: "Finished"
},
overdue: {
id: "containers.Home.statusOverdue",
defaultMessage: "Overdue"
}, },
statusIncome: { refreshButton: {
id: "containers.Home.statusIncome", id: "containers.Home.refreshButton",
defaultMessage: "Income" defaultMessage: "Refresh"
},
statusOutcome: {
id: "containers.Home.statusOutcome",
defaultMessage: "Outcome"
},
addPaymentButton: {
id: "containers.Home.addPaymentButton",
defaultMessage: "Add payment"
},
addExpenseButton: {
id: "containers.Home.addExpenseButton",
defaultMessage: "Add expense"
},
addIncomeButton: {
id: "containers.Home.addIncomeButton",
defaultMessage: "Add income"
},
addInvoiceButton: {
id: "containers.Home.addInvoiceButton",
defaultMessage: "Add invoice"
}, },
} }
\ No newline at end of file
{
"changed": {},
"translated": {
"buttonCancel": {
"id": "common.button.cancel",
"message": "Storno",
"defaultMessage": "Cancel",
"version": 1550782602755
},
"buttonSave": {
"id": "common.button.save",
"message": "Uložit",
"defaultMessage": "Save",
"version": 1550782602755
},
"buttonYes": {
"id": "common.button.yes",
"message": "Ano",
"defaultMessage": "Yes",
"version": 1550782602755
},
"buttonNo": {
"id": "common.button.no",
"message": "Ne",
"defaultMessage": "No",
"version": 1550782602755
},
"buttonBack": {
"id": "common.button.back",
"message": "Zpět",
"defaultMessage": "Back",
"version": 1550782602755
},
"buttonDelete": {
"id": "common.button.delete",
"message": "Smazat",
"defaultMessage": "Delete",
"version": 1550782602755
},
"buttonSend": {
"id": "common.button.send",
"message": "Odeslat",
"defaultMessage": "Send",
"version": 1550782602755
},
"buttonClose": {
"id": "common.button.close",
"message": "Zavřít",
"defaultMessage": "Close",
"version": 1550782602755
},
"buttonRefresh": {
"id": "common.button.refresh",
"message": "Obnovit",
"defaultMessage": "Refresh"
},
"buttonSubmit": {
"id": "common.button.submit",
"message": "Odeslat",
"defaultMessage": "Submit"
},
"buttonNext": {
"id": "common.button.next",
"message": "Další",
"defaultMessage": "Next"
},
"buttonPrevious": {
"id": "common.button.previous",
"message": "Předchozí",
"defaultMessage": "Previous"
},
"buttonFinish": {
"id": "common.button.finish",
"message": "Dokončit",
"defaultMessage": "Finish"
},
"yes": {
"id": "common.yes",
"message": "Ano",
"defaultMessage": "Yes",
"version": 1550782602755
},
"no": {
"id": "common.no",
"message": "Ne",
"defaultMessage": "No",
"version": 1550782602755
},
"validationFieldRequired": {
"id": "common.validation.requiredField",
"message": "Pole je povinné",
"defaultMessage": "Field is required"
},
"validationFieldDecimal": {
"id": "common.validation.decimalField",
"message": "Je požadováno číslo",
"defaultMessage": "Decimal field"
},
"validationInvalidEmail": {
"id": "common.validation.invalidEmail",
"message": "Neplatný email",
"defaultMessage": "Invalid email"
},
"notificationSaved": {
"id": "common.notification.saved",
"message": "Uloženo",
"defaultMessage": "Saved"
},
"notificationDeleted": {
"id": "common.notification.deleted",
"message": "Smazáno",
"defaultMessage": "Deleted"
},
"notificationError": {
"id": "common.notification.error",
"message": "Chyba",
"defaultMessage": "Error"
},
"homeMenu": {
"id": "home.menu",
"message": "Přehled",
"defaultMessage": "Overview",
"version": 1550782602755
},
"customersMenu": {
"id": "customers.menu",
"message": "Zákazníci",
"defaultMessage": "Customers",
"version": 1550782602755
},
"incomeMenu": {
"id": "income.menu",
"message": "Příjmy",
"defaultMessage": "Income",
"version": 1550782602755
},
"expensesMenu": {
"id": "expenses.menu",
"message": "Výdaje",
"defaultMessage": "Expenses",
"version": 1550782602755
},
"reportsMenu": {
"id": "reports.menu",
"message": "Reporty",
"defaultMessage": "Reports",
"version": 1550782602755
},
"settingsMenu": {
"id": "settings.menu",
"message": "Nastavení",
"defaultMessage": "Settings",
"version": 1550782602755
},
"logoutMenu": {
"id": "layout.logoutAction",
"message": "Odhlásit",
"defaultMessage": "Logout",
"version": 1550782602755
}
}
}
\ No newline at end of file
...@@ -99,26 +99,6 @@ export default { ...@@ -99,26 +99,6 @@ export default {
id: "home.menu", id: "home.menu",
defaultMessage: "Overview" defaultMessage: "Overview"
}, },
customersMenu: {
id: "customers.menu",
defaultMessage: "Customers"
},
incomeMenu: {
id: "income.menu",
defaultMessage: "Income"
},
expensesMenu: {
id: "expenses.menu",
defaultMessage: "Expenses"
},
reportsMenu: {
id: "reports.menu",
defaultMessage: "Reports"
},
settingsMenu: {
id: "settings.menu",
defaultMessage: "Settings"
},
logoutMenu: { logoutMenu: {
id: "layout.logoutAction", id: "layout.logoutAction",
defaultMessage: "Logout" defaultMessage: "Logout"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment