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:
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user