mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-05 18:47:41 +00:00
Support async notebook publishing (#275)
Handle cases for async notebook publishing. Now `Your published work` tab shows 3 sections - published, under review, and removed notebooks. Note: The text labels are design placeholders 
This commit is contained in:
@@ -323,3 +323,27 @@ export function getTabTitle(tab: GalleryTab): string {
|
||||
throw new Error(`Unknown tab ${tab}`);
|
||||
}
|
||||
}
|
||||
|
||||
export function filterPublishedNotebooks(
|
||||
items: IGalleryItem[]
|
||||
): {
|
||||
published: IGalleryItem[];
|
||||
underReview: IGalleryItem[];
|
||||
removed: IGalleryItem[];
|
||||
} {
|
||||
const underReview: IGalleryItem[] = [];
|
||||
const removed: IGalleryItem[] = [];
|
||||
const published: IGalleryItem[] = [];
|
||||
|
||||
items?.forEach(item => {
|
||||
if (item.policyViolations?.length > 0) {
|
||||
removed.push(item);
|
||||
} else if (item.pendingScanJobIds?.length > 0) {
|
||||
underReview.push(item);
|
||||
} else {
|
||||
published.push(item);
|
||||
}
|
||||
});
|
||||
|
||||
return { published, underReview, removed };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user