Commit a1579b87 authored by Matija Obreza's avatar Matija Obreza
Browse files

Lint: ui-express

parent aea83389
......@@ -118,7 +118,7 @@ app.use(express.static(path.join('../assets'), {
// Parse cookies
app.use(cookieParser());
const HELLO_COOKIE = `GGCEid`;
const HELLO_COOKIE = 'GGCEid';
const addHelloCookie = (req, res) => {
console.log(`You get a cookie, ${req.ip} gets a cookie, everyone gets a cookie!`);
res.cookie(HELLO_COOKIE, 1, {
......@@ -194,7 +194,7 @@ if (config.frontendPath !== '') {
espresso.set('x-powered-by', false);
espresso.use(config.frontendPath, app);
} else {
console.log(`Using root / path`);
console.log('Using root / path');
}
export default espresso;
......@@ -15,7 +15,7 @@ const styles = (theme) => ({
marginTop: '1em',
marginBottom: '1em',
[theme.breakpoints.up('md')]: {
maxWidth: `800px`,
maxWidth: '800px',
},
},
});
......
......@@ -6,7 +6,7 @@ import {
import { ApplicationService } from '@gringlobal-ce/client/service';
import { ApiCall } from '@gringlobal-ce/client/model/common';
import AppSetting from '@gringlobal-ce/client/model/gringlobal/AppSetting';
import { IPageRequest, Page } from "@gringlobal-ce/client/model/page";
import { IPageRequest, Page } from '@gringlobal-ce/client/model/page';
export const appSetting = [
......
import { RECEIVE_SSR_ERROR_INFO } from '_core/constants/serverInfo';
import { SystemStatusService } from "@gringlobal-ce/client/service";
import { put, takeEvery } from "redux-saga/effects";
import { SystemStatusService } from '@gringlobal-ce/client/service';
import { put, takeEvery } from 'redux-saga/effects';
import {
RECEIVE_SERVER_STATUS,
SAGA_GET_SERVER_STATUS,
} from "_core/constants/serverInfo";
} from '_core/constants/serverInfo';
export const serverInfo = [
takeEvery(SAGA_GET_SERVER_STATUS, getServerStatusSaga),
......
......@@ -2,7 +2,7 @@ import update from 'immutability-helper';
// Model
import SsrError from '@gringlobal-ce/client/model/common/SsrError';
import SystemStatus from "@gringlobal-ce/client/model/gringlobal/SystemStatus";
import SystemStatus from '@gringlobal-ce/client/model/gringlobal/SystemStatus';
import { RECEIVE_SSR_ERROR_INFO, RECEIVE_SERVER_STATUS } from '@gringlobal-ce/ui-express/src/_core/constants/serverInfo';
......
......@@ -30,11 +30,11 @@ import AccessionForm from 'accession/ui/c/AccessionForm';
import ScheduleOutlinedIcon from '@material-ui/icons/ScheduleOutlined';
import FABMenu from '@gringlobal-ce/client/ui/common/button/FABMenu';
import AccessionActionDialog from 'accession/ui/c/AccessionActionDialog';
import AdjustIcon from "@material-ui/icons/Adjust";
import { showSnackbar } from "@gringlobal-ce/client/action/snackbar";
import DOIErrorsDialog from "accession/ui/c/DOIErrorsDialog";
import { DoiUpdate } from "@gringlobal-ce/client/service/AccessionService";
import { Page } from "@gringlobal-ce/client/model/page";
import AdjustIcon from '@material-ui/icons/Adjust';
import { showSnackbar } from '@gringlobal-ce/client/action/snackbar';
import DOIErrorsDialog from 'accession/ui/c/DOIErrorsDialog';
import { DoiUpdate } from '@gringlobal-ce/client/service/AccessionService';
import { Page } from '@gringlobal-ce/client/model/page';
export const AccessionTableDefaultConfig = {
defaultColumns: [
......
......@@ -294,9 +294,9 @@ class AccessionDetailsPage extends React.Component<PropsFromRedux & WithBrowsePa
await AccessionService.removeAction(selected[i]);
}
const updatedActions = actions.filter((action) => !selected.includes(action.id))
console.log("updatedActions", updatedActions);
console.log('updatedActions', updatedActions);
this.setState({ selected: [], actions: [ ...updatedActions ] });
console.log("actions", this.state.actions);
console.log('actions', this.state.actions);
}).catch((e) => {
showSnackbar(e.data && e.data.error || e.toString());
});
......@@ -407,7 +407,7 @@ class AccessionDetailsPage extends React.Component<PropsFromRedux & WithBrowsePa
let accessionSourceMapPromise: Promise<AccessionSourceMap>;
this.setState({ error: null });
if (! sourceMap.accessionSource) {
this.setState({ error: t("accession.public.c.error.noAccessionSource") });
this.setState({ error: t('accession.public.c.error.noAccessionSource') });
return;
}
sourceMap.accessionSource = this.addCurrentAccession(sourceMap.accessionSource);
......@@ -886,18 +886,18 @@ class AccessionDetailsPage extends React.Component<PropsFromRedux & WithBrowsePa
id: { readonly: true, align: TextAlign.right },
sourceId: { readonly: true, align: TextAlign.right },
cooperatorId: { readonly: true, align: TextAlign.right },
name: { readonly: true, label: ["client:model.Cooperator.name", "client:model._.name"] },
title: { align: TextAlign.right, label: "client:model.Cooperator.title" },
lastName: { label: "client:model.Cooperator.lastName" },
firstName: { label: "client:model.Cooperator.firstName" },
organization: { label: "client:model.Cooperator.organization" },
job: { label: "client:model.Cooperator.job" },
geography: { label: "client:model.Cooperator.geography" },
faoInstituteNumber: { label: "client:model.Cooperator.faoInstituteNumber" },
site: { label: "client:model.Cooperator.site" },
statusCode: { label: "client:model.Cooperator.statusCode" },
categoryCode: { label: "client:model.Cooperator.categoryCode" },
disciplineCode: { label: "client:model.Cooperator.disciplineCode" },
name: { readonly: true, label: ['client:model.Cooperator.name', 'client:model._.name'] },
title: { align: TextAlign.right, label: 'client:model.Cooperator.title' },
lastName: { label: 'client:model.Cooperator.lastName' },
firstName: { label: 'client:model.Cooperator.firstName' },
organization: { label: 'client:model.Cooperator.organization' },
job: { label: 'client:model.Cooperator.job' },
geography: { label: 'client:model.Cooperator.geography' },
faoInstituteNumber: { label: 'client:model.Cooperator.faoInstituteNumber' },
site: { label: 'client:model.Cooperator.site' },
statusCode: { label: 'client:model.Cooperator.statusCode' },
categoryCode: { label: 'client:model.Cooperator.categoryCode' },
disciplineCode: { label: 'client:model.Cooperator.disciplineCode' },
},
columnRenderers: {
...CooperatorTableDefaultConfig.columnRenderers,
......
......@@ -28,7 +28,7 @@ import UploadProgressData from '@gringlobal-ce/client/model/genesys/UploadProgre
import LinearProgress from '@material-ui/core/LinearProgress';
import { Button, debounce, DialogActions, DialogContentText } from '@material-ui/core';
import Loading from '@gringlobal-ce/client/ui/common/Loading';
import { Page } from "@gringlobal-ce/client/model/page";
import { Page } from '@gringlobal-ce/client/model/page';
const AccessionMCPDTableConfigProps = {
defaultColumns: [
......@@ -111,13 +111,13 @@ class BrowsePage extends React.Component<PropsFromRedux & WithTranslation & With
GenesysService.uploadAccessions(token, filter).then((uploadProgress) => {
console.log('Uploading....');
// showSnackbar(t('accession.public.p.mcpd.uploadProgress', uploadProgress));
if (uploadProgress.status !== "UPLOADING") {
if (uploadProgress.status !== 'UPLOADING') {
clearInterval(this.uploadIntervalId);
this.setState({ uploadProgress: null }); // clear if not UPLOADING
} else {
this.setState({ uploadProgress });
}
if (uploadProgress.status === "ABORTED") {
if (uploadProgress.status === 'ABORTED') {
showSnackbar(t('accession.public.p.mcpd.uploadError', { error: uploadProgress.errorMessage }));
}
})
......
......@@ -29,7 +29,7 @@ import { AccessionLink } from 'ui/common/Links';
import TranslatedSourceDescObservation from '@gringlobal-ce/client/model/gringlobal/TranslatedSourceDescObservation';
import TranslatedSourceDescriptor from '@gringlobal-ce/client/model/gringlobal/TranslatedSourceDescriptor';
import TranslatedSourceDescriptorCode from '@gringlobal-ce/client/model/gringlobal/TranslatedSourceDescriptorCode';
import { Page } from "@gringlobal-ce/client/model/page";
import { Page } from '@gringlobal-ce/client/model/page';
export const SourceDescObservationTableDefaultConfig = {
......
......@@ -25,7 +25,7 @@ import SourceDescriptorForm from 'accession/ui/c/SourceDescriptorForm';
import { SourceDescriptorService } from '@gringlobal-ce/client/service';
import TranslatedSourceDescriptor from '@gringlobal-ce/client/model/gringlobal/TranslatedSourceDescriptor';
import { Link } from 'react-router-dom';
import { Page } from "@gringlobal-ce/client/model/page";
import { Page } from '@gringlobal-ce/client/model/page';
export const SourceDescriptorTableDefaultConfig = {
defaultColumns: [
......
......@@ -28,13 +28,13 @@ import { Properties, PropertiesItem } from '@gringlobal-ce/client/ui/common/Prop
import Number from '@gringlobal-ce/client/ui/common/Number';
import FiltersButton from 'accession/ui/c/FiltersButton';
import Filters from 'accession/ui/c/Filters';
import { Geography } from "@gringlobal-ce/client/model/gringlobal";
import { YesNoToBoolean } from "@gringlobal-ce/client/utilities";
import { Geography } from '@gringlobal-ce/client/model/gringlobal';
import { YesNoToBoolean } from '@gringlobal-ce/client/utilities';
import FileCopyOutlinedIcon from '@material-ui/icons/FileCopyOutlined';
import PrettyFilters from "ui/common/filter/PrettyFilters";
import PrettyFilters from 'ui/common/filter/PrettyFilters';
import ListIcon from '@material-ui/icons/List';
import { Breakpoint } from "@material-ui/core/styles/createBreakpoints";
import { listAccessionsAction } from "accession/action/public";
import { Breakpoint } from '@material-ui/core/styles/createBreakpoints';
import { listAccessionsAction } from 'accession/action/public';
const styles = () => createStyles({
groupByContainer: {
......@@ -257,7 +257,7 @@ class SummaryPage extends React.Component<PropsFromRedux & WithTranslation & Wit
const lastPathKey = arrayOfKeys.pop();
const withoutLastKey = arrayOfKeys.join('.');
if (name === "NULL") {
if (name === 'NULL') {
set(filter, `${withoutLastKey ? `${withoutLastKey}.` : ''}NULL`, [...(get(accessionFilter, `${filterPath}.NULL`) ?? []), lastPathKey])
this.setState({ accessionFilter: merge({}, accessionFilter, filter) })
this.loadNumbers(group);
......
......@@ -16,7 +16,7 @@ import { WithStyles, withStyles } from '@material-ui/core/styles';
import { Button, DialogActions } from '@material-ui/core';
import { AccessionService, InventoryService } from '@gringlobal-ce/client/service';
import { AccessionTableDefaultConfig } from 'accession/ui/AccessionBrowsePage';
import { loadAllPages } from "@gringlobal-ce/client/utilities";
import { loadAllPages } from '@gringlobal-ce/client/utilities';
const styles = (theme) => ({
dialogContent: {
......
......@@ -7,11 +7,11 @@ import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import { WithStyles, withStyles } from '@material-ui/core/styles';
import { Button, DialogActions } from '@material-ui/core';
import { DoiUpdate } from "@gringlobal-ce/client/service/AccessionService";
import { DoiUpdate } from '@gringlobal-ce/client/service/AccessionService';
const styles = (theme) => ({
sectionLabel: {
fontSize: "1.5rem"
fontSize: '1.5rem'
}
});
......
......@@ -4,8 +4,8 @@ import { useTranslation } from 'react-i18next';
// UI
import { withFilters, TextFilter, StringArrFilter, NumberFilter, DateFilter, BooleanFilter, CVFilter , SiteFilter } from 'ui/common/filter';
import AccessionInvGroupFilter from "common/AccessionInvGroupFilter";
import AclSidFilter from "common/AclSidFilter";
import AccessionInvGroupFilter from 'common/AccessionInvGroupFilter';
import AclSidFilter from 'common/AclSidFilter';
export function AccessionFiltersEmbedded({ prefix = '', withFullText = true }: { prefix?: string, withFullText?: boolean }) {
const { t } = useTranslation();
......
......@@ -93,7 +93,7 @@ class FiltersButton extends React.Component<IFiltersButton & WithTranslation & W
className={ classes.searchButton }
onClick={ this.handleClick }
>
{ ! ["xs", "sm"].includes(width) && (isOpen ? t('common:action.close') : t('common:action.search')) }
{ ! ['xs', 'sm'].includes(width) && (isOpen ? t('common:action.close') : t('common:action.search')) }
{ <SearchIcon className={ classes.searchIcon } viewBox="0 0 16 24"/> }
</Button>
{ isOpen && (
......
......@@ -140,11 +140,11 @@ class SourceDescObservationDialog extends React.Component <ISourceDescObservatio
const selectedSource = accessionSources?.find((source) => source._checked)
const selectedCode = descriptorCodes?.find((code) => code._checked)
if (!selectedSource) {
this.setState({ error: t("accession.public.c.error.noAccessionSource") })
this.setState({ error: t('accession.public.c.error.noAccessionSource') })
return;
}
if (descriptorCodes && !selectedCode) {
this.setState({ error: t("accession.public.c.error.noSourceDescriptorCode") })
this.setState({ error: t('accession.public.c.error.noSourceDescriptorCode') })
return;
}
this.props.onSubmit({
......
......@@ -25,8 +25,8 @@ import { showSnackbar } from '@gringlobal-ce/client/action/snackbar';
import CancelOutlinedIcon from '@material-ui/icons/CancelOutlined';
import EditIcon from '@material-ui/icons/Edit';
import FABMenu from '@gringlobal-ce/client/ui/common/button/FABMenu';
import withBrowsePageBase, { WithBrowsePage } from "ui/common/withBrowsePageBase";
import { Page } from "@gringlobal-ce/client/model/page";
import withBrowsePageBase, { WithBrowsePage } from 'ui/common/withBrowsePageBase';
import { Page } from '@gringlobal-ce/client/model/page';
export const AppSettingsTableConfig = new TableConfiguration({
defaultColumns: [
......
......@@ -13,7 +13,7 @@ import withBrowsePageBase, { WithBrowsePage } from 'ui/common/withBrowsePageBase
import PageTitle from '@gringlobal-ce/client/ui/common/PageTitle';
import Filters from 'auditlog/ui/admin/c/Filters';
import FiltersButton from 'accession/ui/c/FiltersButton';
import { Page } from "@gringlobal-ce/client/model/page";
import { Page } from '@gringlobal-ce/client/model/page';
export const AuditLogTableDefaultConfig = {
defaultColumns: [
......
......@@ -28,8 +28,8 @@ import CodeValue from '@gringlobal-ce/client/model/gringlobal/CodeValue';
import { showSnackbar } from '@gringlobal-ce/client/action/snackbar';
import TocIcon from '@material-ui/icons/Toc';
import AddIcon from '@material-ui/icons/Add';
import CodeValueStatsDialog from "codevalue/ui/admin/c/CodeValueStatsDialog";
import AddNewButton from "@gringlobal-ce/client/ui/common/button/AddNewButton";
import CodeValueStatsDialog from 'codevalue/ui/admin/c/CodeValueStatsDialog';
import AddNewButton from '@gringlobal-ce/client/ui/common/button/AddNewButton';
interface IBrowsePageState {
selected: Partial<TranslatedCodeValue>[];
......
import * as React from 'react';
import { Trans, WithTranslation, withTranslation } from 'react-i18next';
// model
import TranslatedCodeValue from "@gringlobal-ce/client/model/gringlobal/TranslatedCodeValue";
import CodeValueStats from "@gringlobal-ce/client/model/gringlobal/CodeValueStats";
import TranslatedCodeValue from '@gringlobal-ce/client/model/gringlobal/TranslatedCodeValue';
import CodeValueStats from '@gringlobal-ce/client/model/gringlobal/CodeValueStats';
// action
import { CodeValuesService } from '@gringlobal-ce/client/service';
......@@ -12,12 +12,12 @@ import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import {
BasicTableConfiguration as TableConfiguration
} from "@gringlobal-ce/client/ui/common/table/TableConfiguration";
import Table, { TextAlign } from "@gringlobal-ce/client/ui/common/table/Table";
} from '@gringlobal-ce/client/ui/common/table/TableConfiguration';
import Table, { TextAlign } from '@gringlobal-ce/client/ui/common/table/Table';
import Number from '@gringlobal-ce/client/ui/common/Number';
import Button from "@material-ui/core/Button";
import DialogActions from "@material-ui/core/DialogActions";
import { WithWidth, withWidth } from "@material-ui/core";
import Button from '@material-ui/core/Button';
import DialogActions from '@material-ui/core/DialogActions';
import { WithWidth, withWidth } from '@material-ui/core';
export const CodeValueStatsTableDefaultConfig = {
defaultColumns: [
......
Supports Markdown
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