mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
UI for enabling/disabling extensions (#1208)
* Extensions page and menu item Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Basic extension list view Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Adding get userExtensions filter Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Using WizardLayout at extension page Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Adding search to extension page Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Few style fixes Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * clean up Signed-off-by: Roman <ixrock@gmail.com> * added folder-icon to open extensions in finder, refactoring Signed-off-by: Roman <ixrock@gmail.com> * remove export warnings in dev:main, tooltip.getPosition() fix Signed-off-by: Roman <ixrock@gmail.com> * refactoring base lens-extension.ts, added `isBundled` flag Signed-off-by: Roman <ixrock@gmail.com> * added enabled/disable buttons Signed-off-by: Roman <ixrock@gmail.com> * auto enable/disable extensions -- part 1 Signed-off-by: Roman <ixrock@gmail.com> * auto enable/disable extensions -- part 2 Signed-off-by: Roman <ixrock@gmail.com> * auto enable/disable extensions -- part 3 Signed-off-by: Roman <ixrock@gmail.com> * auto enable/disable extensions -- part 4 Signed-off-by: Roman <ixrock@gmail.com> * refactoring & fixes Signed-off-by: Roman <ixrock@gmail.com> * fix: use page-layout with fullsize viewport Signed-off-by: Roman <ixrock@gmail.com> Co-authored-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
1 parent
d5214e47c1
commit
f9578ba407
17 files changed
+376
-191
No files matched your search
@@ -1,5 +1,5 @@
|
||||
// Base class for extensions-api registries
|
||||
import { observable } from "mobx";
|
||||
import { action, observable } from "mobx";
|
||||
|
||||
export class BaseRegistry<T = any> {
|
||||
protected items = observable<T>([], { deep: false });
|
||||
@@ -8,10 +8,16 @@ export class BaseRegistry<T = any> {
|
||||
return this.items.toJS();
|
||||
}
|
||||
|
||||
add(item: T) {
|
||||
this.items.push(item);
|
||||
return () => {
|
||||
@action
|
||||
add(...items: T[]) {
|
||||
this.items.push(...items);
|
||||
return () => this.remove(...items);
|
||||
}
|
||||
|
||||
@action
|
||||
remove(...items: T[]) {
|
||||
items.forEach(item => {
|
||||
this.items.remove(item); // works because of {deep: false};
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user