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

@@ -7,7 +7,6 @@
<!-- EntityGrid for projects -->
<EntityGrid
:entity-type="'projects'"
:entities="allProjects"
:active-did="activeDid"
:all-my-dids="allMyDids"
:all-contacts="allContacts"
@@ -16,7 +15,6 @@
:show-unnamed-entity="false"
:notify="notify"
:conflict-context="'project'"
:load-more-callback="loadMoreCallback"
@entity-selected="handleEntitySelected"
/>
@@ -58,10 +56,6 @@ export default class MeetingProjectDialog extends Vue {
/** Whether the dialog is visible */
visible = false;
/** Array of available projects */
@Prop({ required: true })
allProjects!: PlanData[];
/** Active user's DID */
@Prop({ required: true })
activeDid!: string;
@@ -78,10 +72,6 @@ export default class MeetingProjectDialog extends Vue {
@Prop()
notify?: (notification: NotificationIface, timeout?: number) => void;
/** Callback function to load more projects from server */
@Prop()
loadMoreCallback?: (entities: PlanData[]) => Promise<void>;
/**
* Handle entity selection from EntityGrid
* Immediately assigns the selected project and closes the dialog