mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Make CatalogEntity labels clickable (#3075)
- Transition workspace's to be labels - Fix migrations to support multiple migrations for the same version Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
d812e28639
commit
7f51e3addd
30 files changed
+268
-120
No files matched your search
@@ -19,7 +19,7 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { computed, observable, reaction, makeObservable } from "mobx";
|
||||
import { computed, observable, reaction, makeObservable, action } from "mobx";
|
||||
import { autoBind } from "../../utils";
|
||||
import { searchUrlParam } from "../input/search-input-url";
|
||||
|
||||
@@ -68,6 +68,7 @@ export class PageFiltersStore {
|
||||
return () => disposers.forEach(dispose => dispose());
|
||||
}
|
||||
|
||||
@action
|
||||
addFilter(filter: Filter, begin = false) {
|
||||
if (begin) this.filters.unshift(filter);
|
||||
else {
|
||||
@@ -75,12 +76,17 @@ export class PageFiltersStore {
|
||||
}
|
||||
}
|
||||
|
||||
@action
|
||||
removeFilter(filter: Filter) {
|
||||
if (!this.filters.remove(filter)) {
|
||||
const filterCopy = this.filters.find(f => f.type === filter.type && f.value === filter.value);
|
||||
|
||||
if (filterCopy) this.filters.remove(filterCopy);
|
||||
}
|
||||
|
||||
if (filter.type === FilterType.SEARCH) {
|
||||
searchUrlParam.clear();
|
||||
}
|
||||
}
|
||||
|
||||
getByType(type: FilterType, value?: any): Filter {
|
||||
@@ -99,19 +105,26 @@ export class PageFiltersStore {
|
||||
return !this.isDisabled.get(type);
|
||||
}
|
||||
|
||||
@action
|
||||
disable(type: FilterType | FilterType[]) {
|
||||
[type].flat().forEach(type => this.isDisabled.set(type, true));
|
||||
|
||||
return () => this.enable(type);
|
||||
}
|
||||
|
||||
@action
|
||||
enable(type: FilterType | FilterType[]) {
|
||||
[type].flat().forEach(type => this.isDisabled.delete(type));
|
||||
|
||||
return () => this.disable(type);
|
||||
}
|
||||
|
||||
@action
|
||||
reset() {
|
||||
if (this.isEnabled(FilterType.SEARCH)) {
|
||||
searchUrlParam.clear();
|
||||
}
|
||||
|
||||
this.filters.length = 0;
|
||||
this.isDisabled.clear();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user