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:
Sebastian Malton authored and GitHub committed 2021-06-18 08:44:28 -04:00
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();
}