mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 02:56:23 +08:00
refactor(editor): enable the noUncheckedIndexedAccess rule for the data-view package (#9351)
close: BS-2230
This commit is contained in:
+6
-3
@@ -233,9 +233,12 @@ export class FilterConditionView extends SignalWatcher(ShadowlessElement) {
|
||||
if (!type || !argValues || !data) {
|
||||
return;
|
||||
}
|
||||
const argDataList = argValues.map((v, i) =>
|
||||
v ? { value: v, type: type.args[i + 1] } : undefined
|
||||
);
|
||||
const argDataList = argValues.map((v, i) => {
|
||||
if (v == null) return undefined;
|
||||
const argType = type.args[i + 1];
|
||||
if (!argType) return undefined;
|
||||
return { value: v, type: argType };
|
||||
});
|
||||
const valueString = data.shortString?.(...argDataList) ?? '';
|
||||
if (valueString) {
|
||||
return `${name}${valueString}`;
|
||||
|
||||
+3
@@ -262,6 +262,9 @@ export class FilterGroupView extends SignalWatcher(ShadowlessElement) {
|
||||
|
||||
private _clickConditionOps(target: HTMLElement, i: number) {
|
||||
const filter = this.filterGroup.value.conditions[i];
|
||||
if (!filter) {
|
||||
return;
|
||||
}
|
||||
popFilterableSimpleMenu(popupTargetFromElement(target), [
|
||||
menu.group({
|
||||
items: [
|
||||
|
||||
+3
@@ -202,6 +202,9 @@ export class FilterRootView extends SignalWatcher(ShadowlessElement) {
|
||||
|
||||
private _clickConditionOps(target: HTMLElement, i: number) {
|
||||
const filter = this.filterGroup.value.conditions[i];
|
||||
if (!filter) {
|
||||
return;
|
||||
}
|
||||
popFilterableSimpleMenu(popupTargetFromElement(target), [
|
||||
menu.action({
|
||||
name: filter.type === 'filter' ? 'Turn into group' : 'Wrap in group',
|
||||
|
||||
Reference in New Issue
Block a user