feat: show migration status in libraries list [FC-0097] (#2417)

Adds migration status to library cards in legacy libraries tab in studio home.
Also converts javascript files to typescript and replaces redux with react query for related api calls.
This commit is contained in:
Navin Karkera
2025-09-25 21:19:13 +05:30
committed by GitHub
parent 39e5f89b45
commit d63680083d
11 changed files with 257 additions and 132 deletions

View File

@@ -13,6 +13,17 @@ export function getBlockType(usageKey: string): string {
throw new Error(`Invalid usageKey: ${usageKey}`);
}
/**
* Parses a library key and returns the organization and library name as an object.
*/
export function parseLibraryKey(libraryKey: string): { org: string, lib: string } {
const [, org, lib] = libraryKey?.split(':') || [];
if (org && lib) {
return { org, lib };
}
throw new Error(`Invalid libraryKey: ${libraryKey}`);
}
/**
* Given a usage key like `lb:org:lib:html:id`, get the library key
* @param usageKey e.g. `lb:org:lib:html:id`