-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrating reducer extension to new dynamic sdk
- Loading branch information
Showing
16 changed files
with
96 additions
and
88 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
2 changes: 1 addition & 1 deletion
2
frontend/packages/console-app/src/__tests__/extension-checks/reducers.spec.ts
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
21 changes: 21 additions & 0 deletions
21
frontend/packages/console-dynamic-plugin-sdk/src/extensions/reducers.ts
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,21 @@ | ||
import { Reducer } from 'redux'; | ||
import { CodeRef, Extension } from '@console/plugin-sdk/src/typings/base'; | ||
|
||
export namespace ExtensionProperties { | ||
export type ReduxReducer = { | ||
/** The key to represent reducer-managed substate within the Redux state object. */ | ||
namespace: string; | ||
/** The reducer handler, resolved to a function that returns a reducer. */ | ||
handler: CodeRef<Reducer>; | ||
}; | ||
} | ||
|
||
// Extension types | ||
|
||
export type ReduxReducer = Extension<ExtensionProperties.ReduxReducer> & { | ||
type: 'console.reducer'; | ||
}; | ||
|
||
// Type guards | ||
|
||
export const isReduxReducer = (e: Extension): e is ReduxReducer => e.type === 'console.reducer'; |
3 changes: 2 additions & 1 deletion
3
frontend/packages/console-dynamic-plugin-sdk/src/schema/console-extensions.ts
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
19 changes: 0 additions & 19 deletions
19
frontend/packages/console-plugin-sdk/src/typings/reducers.ts
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,4 +1,15 @@ | ||
{ | ||
"$schema": "../console-dynamic-plugin-sdk/dist/schema/console-extensions.json", | ||
"data": [] | ||
"data": [ | ||
{ | ||
"type": "console.reducer", | ||
"properties": { | ||
"namespace": "kubevirt", | ||
"handler": { "$codeRef": "redux" } | ||
}, | ||
"flags": { | ||
"required": ["KUBEVIRT"] | ||
} | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -1,4 +1,12 @@ | ||
{ | ||
"$schema": "../console-dynamic-plugin-sdk/dist/schema/console-extensions.json", | ||
"data": [] | ||
"data": [ | ||
{ | ||
"type": "console.reducer", | ||
"properties": { | ||
"namespace": "devconsole", | ||
"handler": { "$codeRef": "reducer.default" } | ||
} | ||
} | ||
] | ||
} |
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