-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify growl hook - add hook for prompt modal
lint
- Loading branch information
1 parent
b9f976e
commit a5cfc9d
Showing
8 changed files
with
210 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,5 +205,6 @@ | |
}, | ||
"resolutions": { | ||
"html-webpack-plugin": "^5.0.0" | ||
} | ||
}, | ||
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" | ||
} |
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,35 @@ | ||
/** | ||
* TODO: Update @shell/plugins/dashboard-store/resource-class to TS. | ||
*/ | ||
export interface SteveResource { | ||
save(): Promise<any>, | ||
remove(): Promise<any>, | ||
} | ||
|
||
export interface ResourceFetchOptions { | ||
id?: string, | ||
namespace?: string, | ||
selector?: string, | ||
force?: boolean | ||
} | ||
|
||
export interface ResourceFetchRequest { | ||
type: string, | ||
options?: ResourceFetchOptions | ||
} | ||
|
||
export interface ResourceManageOptions { | ||
metadata: { | ||
name: string, | ||
namespace?: string, | ||
labels?: {[key: string]: string}, | ||
annotations?: {[key: string]: string} | ||
}, | ||
spec?: any | ||
} | ||
|
||
export interface ResourceManageRequest { | ||
type: string, | ||
options: ResourceManageOptions, | ||
resource?: SteveResource | ||
} |
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,25 @@ | ||
export interface DetailedMessage { | ||
title?: string; | ||
description: string; | ||
} | ||
|
||
export interface GrowlConfig { | ||
/** | ||
* The content of the notification message. | ||
* Either a simple string or an object with `title` and `description` for detailed notifications. | ||
*/ | ||
message: string | DetailedMessage; | ||
|
||
/** | ||
* Optional type of the growl notification. | ||
* Determines the visual style of the notification. | ||
* Defaults to `'error'` if not provided. | ||
*/ | ||
type?: 'success' | 'info' | 'warning' | 'error'; | ||
|
||
/** | ||
* Optional duration (in milliseconds) for which the notification should be displayed. | ||
* Defaults to `5000` milliseconds. A value of `0` keeps the notification indefinitely. | ||
*/ | ||
timeout?: number; | ||
} |
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,82 @@ | ||
/** | ||
* Configuration object for opening a modal. | ||
*/ | ||
export interface ModalConfig { | ||
/** | ||
* TODO: Understand how this works with extensions | ||
* | ||
* The name of the component to be displayed inside the modal. | ||
* | ||
* The component must reside in the `dialog` directory, depending on the environment: | ||
* | ||
* 1. **When Using the Shell as Part of the Core Project**: | ||
* - Components must live in the `@shell/dialog` directory. | ||
* - Example: | ||
* ``` | ||
* shell/dialog/MyCustomDialog.vue | ||
* ``` | ||
* | ||
* 2. **When Using the Shell as a Library (Extensions)**: | ||
* - Components must live in the `pkg/<extension-pkg>/dialog` directory within the extension. | ||
* - Example, in an extension named `my-extension`: | ||
* ``` | ||
* <extension-root>/pkg/my-extension/dialog/MyCustomDialog.vue | ||
* ``` | ||
* | ||
* - The `component` value should still match the file name without the `.vue` extension. | ||
* - Example: | ||
* ```typescript | ||
* component: 'MyCustomDialog' // Dynamically imports MyCustomDialog.vue | ||
* ``` | ||
* | ||
*/ | ||
component: string; | ||
|
||
/** | ||
* Optional props to pass directly to the component rendered inside the modal. | ||
* This can be a record of key-value pairs where keys are the prop names, and | ||
* values are the corresponding prop values for the component. | ||
* | ||
* Example: | ||
* ``` | ||
* componentProps: { title: 'Hello Modal', isVisible: true } | ||
* ``` | ||
*/ | ||
componentProps?: Record<string, any>; | ||
|
||
/** | ||
* Optional array of resources that the modal component might need. | ||
* These resources are passed directly to the modal's `resources` prop. | ||
* | ||
* Example: | ||
* ``` | ||
* resources: [myResource, anotherResource] | ||
* ``` | ||
*/ | ||
resources?: any[]; | ||
|
||
/** | ||
* Custom width for the modal. Defaults to `600px`. | ||
* The width can be specified as a number (pixels) or as a string | ||
* with a valid unit, such as `px` or `%`. | ||
* | ||
* Example: | ||
* ``` | ||
* modalWidth: '800px' // Width in pixels | ||
* modalWidth: '75%' // Width as a percentage | ||
* ``` | ||
*/ | ||
modalWidth?: string; | ||
|
||
/** | ||
* If true, clicking outside the modal will close it. Defaults to `true`. | ||
* Set this to `false` if you want the modal to remain open until the user | ||
* explicitly closes it. | ||
* | ||
* Example: | ||
* ``` | ||
* closeOnClickOutside: false | ||
* ``` | ||
*/ | ||
closeOnClickOutside?: boolean; | ||
} |
This file was deleted.
Oops, something went wrong.