-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(extensible-area): add apps gallery extensible area
Until now, the only way to add an item in the apps gallery was by injecting a sidekick generic content. But as the concept of apps expanded beyond sidebar contents, it was necessary to decouple the gallery apps from the sidebar content(i.e. generic sidekick content). So this commit adds an extensible area specifically for the apps gallery. It has only one type, which is 'ENTRY' and corresponds to an apps gallery entry that won't open a sidebar content when clicked.
- Loading branch information
Showing
9 changed files
with
72 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { AppsGalleryType } from './enums'; | ||
import { AppsGalleryInterface, AppsGalleryItemProps } from './types'; | ||
|
||
export class AppsGalleryEntry implements AppsGalleryInterface { | ||
id: string = ''; | ||
|
||
name: string = ''; | ||
|
||
type: AppsGalleryType = AppsGalleryType.ENTRY; | ||
|
||
icon: string = ''; | ||
|
||
onClick: () => void; | ||
|
||
constructor({ | ||
id, | ||
name, | ||
icon, | ||
onClick, | ||
}: AppsGalleryItemProps) { | ||
if (id) { | ||
this.id = id; | ||
} | ||
this.name = name; | ||
this.icon = icon; | ||
this.onClick = onClick; | ||
} | ||
|
||
setItemId(id: string): void { | ||
this.id = id; | ||
} | ||
} | ||
|
||
export default AppsGalleryEntry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export enum AppsGalleryType { | ||
ENTRY = 'APPS_GALLERY_ENTRY', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export { | ||
AppsGalleryEntry, | ||
} from './component'; | ||
export { | ||
AppsGalleryInterface, | ||
} from './types'; | ||
export { | ||
AppsGalleryType, | ||
} from './enums'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { PluginProvidedUiItemDescriptor } from '../base'; | ||
import { AppsGalleryType } from './enums'; | ||
|
||
export interface AppsGalleryInterface extends PluginProvidedUiItemDescriptor { | ||
type: AppsGalleryType; | ||
} | ||
|
||
export interface AppsGalleryItemProps { | ||
id?: string; | ||
name: string; | ||
icon: string; | ||
onClick: () => void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters