Skip to content

Commit ad37df0

Browse files
committed
- NCOA Results Block conversion and chop
2 parents fab5a59 + 0afb8e6 commit ad37df0

19 files changed

Lines changed: 1558 additions & 900 deletions

File tree

Rock.Blocks/Crm/NcoaResults.cs

Lines changed: 652 additions & 0 deletions
Large diffs are not rendered by default.

Rock/Model/Core/NcoaHistory/AddressStatus.cs renamed to Rock.Enums/Core/AddressStatus.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ namespace Rock.Model
2020
/// <summary>
2121
/// Represents the address statuses.
2222
/// </summary>
23+
[Enums.EnumDomain( "Core" )]
2324
public enum AddressStatus
2425
{
2526
/// <summary>
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
<!-- Copyright by the Spark Development Network; Licensed under the Rock Community License -->
2+
<template>
3+
<Modal v-model="isVisible"
4+
title="Settings"
5+
saveText="Save"
6+
@save="onSave">
7+
<SectionHeader title="Filters" />
8+
9+
<NotificationBox v-if="errorMessage"
10+
alertType="warning">
11+
{{ errorMessage }}
12+
</NotificationBox>
13+
14+
<div class="row">
15+
<div class="col-md-6">
16+
<DropDownList v-model="gridSettingsForm.filterProcessed"
17+
:items="enumToListItemBag(ProcessedDescription)"
18+
:showBlankItem="false"
19+
label="Processed" />
20+
</div>
21+
22+
<div class="col-md-6">
23+
<DropDownList v-model="gridSettingsForm.filterMoveType"
24+
:items="enumToListItemBag(MoveTypeDescription)"
25+
label="Move Type" />
26+
</div>
27+
</div>
28+
29+
<div class="row">
30+
<div class="col-md-6">
31+
<SlidingDateRangePicker v-model="gridSettingsForm.filterMoveDate"
32+
label="Created Date Range"
33+
:isRangeClearable="true" />
34+
</div>
35+
36+
<div class="col-md-6">
37+
<SlidingDateRangePicker v-model="gridSettingsForm.filterNcoaProcessedDate"
38+
label="NCOA Processed Date Range"
39+
:isRangeClearable="true" />
40+
</div>
41+
</div>
42+
43+
<div class="row">
44+
<div class="col-md-6">
45+
<DropDownList v-model="gridSettingsForm.filterAddressStatus"
46+
:items="enumToListItemBag(AddressStatusDescription)"
47+
label="Address Status" />
48+
</div>
49+
50+
<div class="col-md-6">
51+
<DropDownList v-model="gridSettingsForm.filterInvalidReason"
52+
:items="enumToListItemBag(AddressInvalidReasonDescription)"
53+
label="Invalid Reason" />
54+
</div>
55+
</div>
56+
<div class="row">
57+
<div class="col-md-4">
58+
<NumberBox v-model="gridSettingsForm.filterMoveDistance"
59+
label="Move Distance" />
60+
</div>
61+
62+
<div class="col-md-4">
63+
<TextBox v-model="gridSettingsForm.filterLastName"
64+
label="Last Name" />
65+
</div>
66+
<div class="col-md-4">
67+
<CampusPicker v-model="gridSettingsForm.filterCampus"
68+
:forceVisible="true"
69+
:includeInactive="true"
70+
:showBlankItem="true"
71+
label="Campus" />
72+
</div>
73+
</div>
74+
</Modal>
75+
</template>
76+
77+
<script setup lang="ts">
78+
import Modal from "@Obsidian/Controls/modal.obs";
79+
import DropDownList from "@Obsidian/Controls/dropDownList.obs";
80+
import SectionHeader from "@Obsidian/Controls/sectionHeader.obs";
81+
import NotificationBox from "@Obsidian/Controls/notificationBox.obs";
82+
import SlidingDateRangePicker from "@Obsidian/Controls/slidingDateRangePicker.obs";
83+
import { ref, PropType, watch } from "vue";
84+
import { GridSettingsOptions } from "./types.partial";
85+
import { useVModelPassthrough } from "@Obsidian/Utility/component";
86+
import { deepEqual } from "@Obsidian/Utility/util";
87+
import { ListItemBag } from "@Obsidian/ViewModels/Utility/listItemBag";
88+
import { clone } from "@Obsidian/Utility/objectUtils";
89+
import TextBox from "@Obsidian/Controls/textBox.obs";
90+
import NumberBox from "@Obsidian/Controls/numberBox.obs";
91+
import CampusPicker from "@Obsidian/Controls/campusPicker.obs";
92+
import { MoveTypeDescription } from "@Obsidian/Enums/Core/moveType";
93+
import { ProcessedDescription } from "@Obsidian/Enums/Core/processed";
94+
import { AddressStatusDescription } from "@Obsidian/Enums/Core/addressStatus";
95+
import { AddressInvalidReasonDescription } from "@Obsidian/Enums/Core/addressInvalidReason";
96+
import { enumToListItemBag } from "@Obsidian/Utility/enumUtils";
97+
98+
const props = defineProps({
99+
modelValue: {
100+
type: Object as PropType<GridSettingsOptions>,
101+
required: true
102+
},
103+
104+
visible: {
105+
type: Boolean as PropType<boolean>,
106+
required: true
107+
},
108+
109+
currentPerson: {
110+
type: Object as PropType<ListItemBag>,
111+
required: false,
112+
}
113+
});
114+
115+
const emit = defineEmits<{
116+
(e: "update:modelValue", value: GridSettingsOptions): void;
117+
(e: "update:visible", value: boolean): void;
118+
(e: "close"): void;
119+
}>();
120+
121+
const errorMessage = ref();
122+
const gridSettingsForm = ref(clone(props.modelValue));
123+
124+
const isVisible = useVModelPassthrough(props, "visible", emit);
125+
126+
function onSave(): void {
127+
128+
if (!deepEqual(gridSettingsForm.value, props.modelValue, true)) {
129+
emit("update:modelValue", clone(gridSettingsForm.value));
130+
}
131+
132+
isVisible.value = false;
133+
}
134+
135+
// watch(() => props.modelValue, () => {
136+
// createdBy.value = props.modelValue.createdBy?.value ?? "Selected Person";
137+
// filterPerson.value = props.modelValue.filterPerson;
138+
// createdDateRange.value = props.modelValue.createdDateRange ?? defaultCreatedDateRange;
139+
// });
140+
141+
// watch(filterPerson, () => {
142+
// if (!filterPerson.value) {
143+
// createdBy.value = "Not Specified";
144+
// }
145+
// });
146+
147+
// watch(createdBy, () => {
148+
// if (createdBy.value === "Not Specified") {
149+
// filterPerson.value = undefined;
150+
// }
151+
// else if (createdBy.value === "Selected Person" && !filterPerson.value) {
152+
// filterPerson.value = props.currentPerson;
153+
// }
154+
// });
155+
156+
// watch(createdDateRange, () => {
157+
// if (!isNullOrWhiteSpace(errorMessage.value)) {
158+
// const dates = calculateSlidingDateRange(createdDateRange.value);
159+
160+
// if (dates.start && dates.end) {
161+
// errorMessage.value = "";
162+
// }
163+
// }
164+
// });
165+
166+
watch(isVisible, () => {
167+
errorMessage.value = "";
168+
if (!isVisible.value) {
169+
emit("close");
170+
}
171+
});
172+
</script>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
import { SlidingDateRange } from "@Obsidian/Utility/slidingDateRange";
19+
import { ListItemBag } from "@Obsidian/ViewModels/Utility/listItemBag";
20+
21+
export const enum PreferenceKey {
22+
FilterProcessed = "filter-processed",
23+
FilterMoveDate = "filter-move-date",
24+
FilterNcoaProcessedDate = "filter-ncoa-processed-date",
25+
FilterMoveType = "filter-move-type",
26+
FilterAddressStatus = "filter-address-status",
27+
FilterInvalidReason = "filter-invalid-reason",
28+
FilterMoveDistance = "filter-move-distance",
29+
FilterLastName = "filter-last-name",
30+
FilterCampus = "filter-campus"
31+
}
32+
33+
export type GridSettingsOptions = {
34+
filterProcessed: string;
35+
filterMoveDate: SlidingDateRange | null;
36+
filterNcoaProcessedDate: SlidingDateRange | null;
37+
filterMoveType: string;
38+
filterAddressStatus: string;
39+
filterInvalidReason: string;
40+
filterMoveDistance: number | null;
41+
filterLastName: string;
42+
filterCampus?: ListItemBag | null;
43+
};

0 commit comments

Comments
 (0)