refactor: consolidate project loading into EntityGrid component

Unify project loading and searching logic in EntityGrid.vue to eliminate
duplication. Make entities prop optional for projects, add internal
project state, and auto-load projects when needed.

- EntityGrid: Combine search/load into fetchProjects(), add internal
  allProjects state, handle pagination internally for both search and
  load modes
- OnboardMeetingSetupView: Remove project loading methods
- MeetingProjectDialog: Remove project props
- GiftedDialog: Remove project loading logic
- EntitySelectionStep: Make projects prop optional

Reduces code duplication by ~150 lines and simplifies component APIs.
All project selection now uses EntityGrid's internal loading.
This commit is contained in:
Jose Olarte III
2025-11-17 19:49:17 +08:00
parent acf104eaa7
commit cb75b25529
5 changed files with 265 additions and 266 deletions

View File

@@ -14,7 +14,7 @@ properties * * @author Matthew Raymer */
<EntityGrid
:entity-type="shouldShowProjects ? 'projects' : 'people'"
:entities="shouldShowProjects ? projects : allContacts"
:entities="shouldShowProjects ? projects || undefined : allContacts"
:active-did="activeDid"
:all-my-dids="allMyDids"
:all-contacts="allContacts"
@@ -23,7 +23,6 @@ properties * * @author Matthew Raymer */
:you-selectable="youSelectable"
:notify="notify"
:conflict-context="conflictContext"
:load-more-callback="shouldShowProjects ? loadMoreCallback : undefined"
@entity-selected="handleEntitySelected"
/>
@@ -95,9 +94,9 @@ export default class EntitySelectionStep extends Vue {
@Prop({ default: false })
isFromProjectView!: boolean;
/** Array of available projects */
@Prop({ required: true })
projects!: PlanData[];
/** Array of available projects (optional - EntityGrid loads internally if not provided) */
@Prop({ required: false })
projects?: PlanData[];
/** Array of available contacts */
@Prop({ required: true })
@@ -149,10 +148,6 @@ export default class EntitySelectionStep extends Vue {
@Prop()
notify?: (notification: NotificationIface, timeout?: number) => void;
/** Callback function to load more projects from server */
@Prop()
loadMoreCallback?: (entities: PlanData[]) => Promise<void>;
/**
* CSS classes for the cancel button
*/