Route article detail tabs in the URL and pin a preferred default.
Use /artikel/:sku/:tab with a localStorage-backed default, and a pin control to set which tab opens first.
This commit is contained in:
@@ -49,6 +49,7 @@ import {
|
||||
import { notifyError } from '../../utils/notify';
|
||||
import { PANEL_TILE_KEYS } from '../../theme';
|
||||
import { formatStock } from '../../pages/artikel/searchFormat';
|
||||
import { artikelDetailPath } from '../../pages/artikel/articleRoute';
|
||||
import {
|
||||
buildCategoryPath,
|
||||
defaultCategoryPath,
|
||||
@@ -551,7 +552,12 @@ function PriceUnitCorner({ hasUnit, onToggleHasUnit, onOpenEditor }) {
|
||||
);
|
||||
}
|
||||
|
||||
export default function ArticleView({ article: articleData, onArticleUpdated }) {
|
||||
export default function ArticleView({
|
||||
article: articleData,
|
||||
tab,
|
||||
onTabChange,
|
||||
onArticleUpdated,
|
||||
}) {
|
||||
const navigate = useNavigate();
|
||||
const dispatch = useDispatch();
|
||||
const [tiersDialogOpen, setTiersDialogOpen] = useState(false);
|
||||
@@ -891,6 +897,8 @@ export default function ArticleView({ article: articleData, onArticleUpdated })
|
||||
tileKey={PANEL_TILE_KEYS.content}
|
||||
minHeight={200}
|
||||
article={articleData}
|
||||
tab={tab}
|
||||
onTabChange={onTabChange}
|
||||
onArticleDeleted={handleArticleDeleted}
|
||||
/>
|
||||
|
||||
@@ -908,7 +916,7 @@ export default function ArticleView({ article: articleData, onArticleUpdated })
|
||||
{articleData.fatherSku ? (
|
||||
<Link
|
||||
component={RouterLink}
|
||||
to={`/artikel/${encodeURIComponent(articleData.fatherSku)}`}
|
||||
to={artikelDetailPath(articleData.fatherSku)}
|
||||
>
|
||||
{articleData.fatherSku}
|
||||
</Link>
|
||||
|
||||
Reference in New Issue
Block a user