This commit is contained in:
seb
2026-10-04 21:04:40 +02:00
parent 669954b496
commit f765b87336
59 changed files with 1491 additions and 2045 deletions

View File

@@ -1,7 +1,9 @@
import { Component } from 'react';
import Box from '@mui/material/Box';
import CircularProgress from '@mui/material/CircularProgress';
import { StorageManagerContext } from '../../api/storageManagerContext';
import { getCategoryState, whenCategoryTreeReady } from '../../automats/categoryAutomat';
import companyAutomat from '../../automats/companyAutomat';
import { bootstrapAuthMe } from '../../automats/authAutomat';
import BackendError from '../../components/BackendError';
import { ArticleView } from '../../components/article';
import {
@@ -22,13 +24,11 @@ function ArticleLoading() {
}
class ArtikelSkuPage extends Component {
static contextType = StorageManagerContext;
constructor(props, context) {
super(props, context);
constructor(props) {
super(props);
this.state = {
article: getArticle(props.sku),
ready: context.getCategoryState() != null,
ready: getCategoryState() != null,
error: null,
};
}
@@ -72,9 +72,9 @@ class ArtikelSkuPage extends Component {
try {
await Promise.all([
artikelAutomat.actions.loadArticle(sku),
this.context.categoryTreePromise,
this.context.companyPromise,
this.context.authMePromise,
whenCategoryTreeReady(),
companyAutomat.actions.load(),
bootstrapAuthMe(),
]);
if (this._mounted) this.setState({ ready: true });
} catch (error) {