feat(help-center): enable drag-and-drop category reordering (#13706)

This commit is contained in:
Sojan Jose
2026-03-04 23:23:38 -08:00
committed by GitHub
parent 3abe32a2c7
commit 42a244369d
33 changed files with 708 additions and 47 deletions

View File

@@ -11,7 +11,10 @@ const store = useStore();
const pageNumber = ref(1);
const articles = useMapGetter('articles/allArticles');
const allArticles = useMapGetter('articles/allArticles');
const articlesSortedByPosition = useMapGetter(
'articles/allArticlesSortedByPosition'
);
const categories = useMapGetter('categories/allCategories');
const meta = useMapGetter('articles/getMeta');
const portalMeta = useMapGetter('portals/getMeta');
@@ -58,6 +61,11 @@ const isCategoryArticles = computed(() => {
);
});
// Use position-sorted articles for category views and categories filter view (where drag reorder is enabled)
const articles = computed(() =>
isCategoryArticles.value ? articlesSortedByPosition.value : allArticles.value
);
const fetchArticles = ({ pageNumber: pageNumberParam } = {}) => {
store.dispatch('articles/index', {
pageNumber: pageNumberParam || pageNumber.value,

View File

@@ -9,7 +9,7 @@ import CategoriesPage from 'dashboard/components-next/HelpCenter/Pages/CategoryP
const store = useStore();
const route = useRoute();
const categories = useMapGetter('categories/allCategories');
const categories = useMapGetter('categories/allCategoriesSortedByPosition');
const selectedPortalSlug = computed(() => route.params.portalSlug);
const getPortalBySlug = useMapGetter('portals/portalBySlug');