nav
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
||||
import { preserveSearchFocus } from './searchFocus';
|
||||
import { artikelDetailPath } from './articleRoute';
|
||||
import withSearchParams from './withSearchParams';
|
||||
import { setLastArticleSku } from '../../automats';
|
||||
|
||||
const resultRowSx = {
|
||||
alignItems: 'center',
|
||||
@@ -171,6 +172,7 @@ class ArtikelSearchPage extends Component {
|
||||
componentDidMount() {
|
||||
document.addEventListener('mousedown', preserveSearchFocus, true);
|
||||
window.addEventListener('resize', this.handleWindowResize);
|
||||
setLastArticleSku(null);
|
||||
|
||||
// Kick off initial search (empty input = show all products).
|
||||
const { input } = this.state;
|
||||
|
||||
@@ -53,6 +53,7 @@ import {
|
||||
enableTerminalCategory,
|
||||
disableTerminalCategory,
|
||||
} from '../../store/posterminalSlice';
|
||||
import { setLastArticleSku } from '../../automats';
|
||||
|
||||
const gridSx = {
|
||||
display: 'grid',
|
||||
@@ -72,6 +73,7 @@ class ArtikelKategorienPage extends Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
setLastArticleSku(null);
|
||||
this.ensureTreeLoaded();
|
||||
this.ensurePosterminalsLoaded();
|
||||
this.syncCategoryFromUrl();
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import { useEffect } from 'react';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { setLastArticleSku } from '../../automats';
|
||||
|
||||
export default function ArtikelLagerPage() {
|
||||
useEffect(() => {
|
||||
setLastArticleSku(null);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Typography color="text.secondary">Lager — Inhalt folgt.</Typography>
|
||||
);
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Component } from 'react';
|
||||
import { StorageManagerContext } from '../../api/storageManagerContext';
|
||||
import { ArticleView } from '../../components/article';
|
||||
import withSkuRoute from './withSkuRoute';
|
||||
import { setLastArticleSku } from '../../automats';
|
||||
|
||||
class ArtikelSkuPage extends Component {
|
||||
static contextType = StorageManagerContext;
|
||||
@@ -17,11 +18,13 @@ class ArtikelSkuPage extends Component {
|
||||
|
||||
componentDidMount() {
|
||||
this.installEscape();
|
||||
setLastArticleSku(this.props.sku);
|
||||
if (!this.state.ready) void this.ensureArticle();
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
if (prevProps.sku !== this.props.sku) {
|
||||
setLastArticleSku(this.props.sku);
|
||||
const ready =
|
||||
this.context.getArticle(this.props.sku) != null &&
|
||||
this.context.getCategoryState() != null;
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import { PureComponent } from 'react';
|
||||
import { ManifestList } from '../../components/manifest';
|
||||
import { setLastDeliveryPath } from '../../automats';
|
||||
|
||||
class LieferungListePage extends PureComponent {
|
||||
componentDidMount() {
|
||||
setLastDeliveryPath(null);
|
||||
}
|
||||
|
||||
render() {
|
||||
return <ManifestList kind="delivery" />;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import { StorageManagerContext } from '../../api/storageManagerContext';
|
||||
import { requireDefined, requireObject } from '../../utils/apiShape';
|
||||
import { backendErrorFrom } from '../../utils/backendError';
|
||||
import { notifyError } from '../../utils/notify';
|
||||
import { setLastDeliveryPath } from '../../automats';
|
||||
|
||||
function sortSuppliers(suppliers) {
|
||||
return [...suppliers].sort((a, b) =>
|
||||
@@ -48,6 +49,7 @@ class LieferungLieferantenPage extends PureComponent {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
setLastDeliveryPath(null);
|
||||
this._cancelled = false;
|
||||
void this.loadSuppliers();
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import { notifyError } from '../../utils/notify';
|
||||
import { generatePdfThumbnail } from '../../utils/pdfThumbnail';
|
||||
import { extractPdfText } from '../../utils/pdfText';
|
||||
import { getDeliveryEditorAutomat } from '../../automats/deliveryEditorAutomat';
|
||||
import { setLastDeliveryPath } from '../../automats';
|
||||
import { delivery as deliveryApi } from '../../api';
|
||||
|
||||
class LieferungNeuPage extends PureComponent {
|
||||
@@ -85,8 +86,10 @@ class LieferungNeuPage extends PureComponent {
|
||||
this.unsubscribe = this.automat.subscribe(this);
|
||||
this._cancelled = false;
|
||||
if (this.props.docId != null) {
|
||||
setLastDeliveryPath(`/lieferung/${this.props.docId}`);
|
||||
void this.loadEdit();
|
||||
} else {
|
||||
setLastDeliveryPath('/lieferung/neu');
|
||||
void this.loadPartiesOnly();
|
||||
if (this.props.initialDelivery) {
|
||||
this.automat.actions.setDelivery(this.props.initialDelivery);
|
||||
|
||||
Reference in New Issue
Block a user