Skip to content

Commit ff1a790

Browse files
- Added a new Obsidian Data View Filter Editor control that allows administrators to build and edit Data View Filters. This provides a more consistent and user-friendly way to configure filter criteria across Obsidian-based blocks and tools.
1 parent 0054600 commit ff1a790

42 files changed

Lines changed: 2084 additions & 15 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// <copyright>
2+
// Copyright by the Spark Development Network
3+
//
4+
// Licensed under the Rock Community License (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.rockrms.com/license
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
// </copyright>
16+
//
17+
18+
namespace Rock.Enums.Reporting
19+
{
20+
/// <summary>
21+
/// Specifies how child filters in a group are joined together.
22+
/// </summary>
23+
public enum FilterGroupJoinType
24+
{
25+
/// <summary>
26+
/// All child filters must be satisfied.
27+
/// </summary>
28+
All = 0,
29+
30+
/// <summary>
31+
/// Any child filter may be satisfied.
32+
/// </summary>
33+
Any = 1
34+
}
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// <copyright>
2+
// Copyright by the Spark Development Network
3+
//
4+
// Licensed under the Rock Community License (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.rockrms.com/license
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
// </copyright>
16+
//
17+
18+
namespace Rock.Enums.Reporting
19+
{
20+
/// <summary>
21+
/// Specifies whether the group evaluates for true or false conditions.
22+
/// </summary>
23+
public enum FilterGroupTruthType
24+
{
25+
/// <summary>
26+
/// The child filter logic should evaluate to true.
27+
/// </summary>
28+
True = 0,
29+
30+
/// <summary>
31+
/// The child filter logic should evaluate to false.
32+
/// </summary>
33+
False = 1
34+
}
35+
}

Rock.Frontend.Styles/src/styles/styles-v2/components/_panels.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
box-shadow: var(--box-shadow);
3636

3737
.panel-title {
38-
i {
38+
& > i {
3939
margin-right: var(--spacing-tiny);
4040
color: var(--color-interface-medium);
4141
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<template>
2+
<GalleryAndResult :importCode="importCode"
3+
:exampleCode="exampleCode"
4+
description="Edits a nested DataViewFilter tree using the same filter components that Data Views and Content Channel Views use.">
5+
6+
<ContentSection title="Filtering Logic">
7+
<ContentStack title="Content Filtering"
8+
description="Defines the rule groups used to determine which items are included in the results.">
9+
<DataViewFilterEditor v-model="value"
10+
:entityTypeGuid="entityTypeGuid?.value" />
11+
</ContentStack>
12+
</ContentSection>
13+
14+
<template #settings>
15+
<div class="row">
16+
<div class="col-md-3">
17+
<EntityTypePicker label="For Entity Type"
18+
v-model="entityTypeGuid"
19+
enhanceForLongLists
20+
showBlankItem />
21+
</div>
22+
</div>
23+
</template>
24+
</GalleryAndResult>
25+
</template>
26+
27+
<script setup lang="ts">
28+
import { ref, watch } from "vue";
29+
import GalleryAndResult from "./common/galleryAndResult.partial.obs";
30+
import { getSfcControlImportPath } from "./common/utils.partial";
31+
import ContentSection from "@Obsidian/Controls/contentSection.obs";
32+
import ContentStack from "@Obsidian/Controls/contentStack.obs";
33+
import DataViewFilterEditor from "@Obsidian/Controls/dataViewFilterEditor.obs";
34+
import EntityTypePicker from "@Obsidian/Controls/entityTypePicker.obs";
35+
import { createDefaultDataViewFilter } from "@Obsidian/Core/Reporting/dataViewFilterEditor";
36+
import { EntityType } from "@Obsidian/SystemGuids/entityType";
37+
import { DataViewFilterBag } from "@Obsidian/ViewModels/Reporting/dataViewFilterBag";
38+
import type { ListItemBag } from "@Obsidian/ViewModels/Utility/listItemBag";
39+
40+
const defaultEntityTypeGuid = EntityType.Person;
41+
42+
const entityTypeGuid = ref<ListItemBag | null>({ text: "Person", value: defaultEntityTypeGuid });
43+
const value = ref<DataViewFilterBag>(createDefaultDataViewFilter());
44+
45+
const importCode = getSfcControlImportPath("dataViewFilterEditor");
46+
const exampleCode = `<DataViewFilterEditor v-model="value" :entityTypeGuid="entityTypeGuid" />`;
47+
48+
watch(entityTypeGuid, () => {
49+
value.value = createDefaultDataViewFilter();
50+
});
51+
</script>

Rock.JavaScript.Obsidian.Blocks/src/Example/controlGallery.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ import CampusPickerGallery from "./ControlGallery/campusPickerGallery.partial.ob
152152
import ScheduleBuilderGallery from "./ControlGallery/scheduleBuilderGallery.partial.obs";
153153
import BinaryFilePickerGallery from "./ControlGallery/binaryFilePickerGallery.partial.obs";
154154
import EventItemPickerGallery from "./ControlGallery/eventItemPickerGallery.partial.obs";
155+
import DataViewFilterEditorGallery from "./ControlGallery/dataViewFilterEditorGallery.partial.obs";
155156
import DataViewPickerGallery from "./ControlGallery/dataViewPickerGallery.partial.obs";
156157
import WorkflowTypePickerGallery from "./ControlGallery/workflowTypePickerGallery.partial.obs";
157158
import FinancialGatewayPickerGallery from "./ControlGallery/financialGatewayPickerGallery.partial.obs";
@@ -331,6 +332,7 @@ const controlGalleryComponents: Record<string, Component> = [
331332
CodeEditorGallery,
332333
ModalGallery,
333334
EventItemPickerGallery,
335+
DataViewFilterEditorGallery,
334336
DataViewPickerGallery,
335337
WorkflowTypePickerGallery,
336338
ComponentPickerGallery,

Rock.JavaScript.Obsidian.Reporting/src/DataFilters/Person/hasPictureFilter.obs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<RadioButtonList v-model="hasPicture" :items="hasPictureOptions" horizontal />
2+
<RadioButtonList v-model="hasPicture" :items="hasPictureOptions" horizontal disableLabel />
33
</template>
44

55
<script setup lang="ts">

0 commit comments

Comments
 (0)