run method
Future<PageModel>
run({
- required FeedModel? feed,
- required String? feedIdentifier,
- required String feedMenuComponentIdentifier,
- required String feedFrontComponentIdentifier,
- required String followRequestsDashboardComponentIdentifier,
- required String followersDashboardComponentIdentifier,
- required String followingDashboardComponentIdentifier,
- required String inviteDashboardComponentIdentifier,
- required String profileComponentIdentifier,
Implementation
Future<PageModel> run({
required FeedModel? feed,
required String? feedIdentifier,
required String feedMenuComponentIdentifier,
required String feedFrontComponentIdentifier,
required String followRequestsDashboardComponentIdentifier,
required String followersDashboardComponentIdentifier,
required String followingDashboardComponentIdentifier,
required String inviteDashboardComponentIdentifier,
required String profileComponentIdentifier,
}) async {
var appId = app.documentID;
var newFeed = await assertFeedModel(feed, feedIdentifier, appId, uniqueId);
var feedMenuPageId =
constructDocumentId(uniqueId: uniqueId, documentId: pageId);
var newFeedFront = await FeedFrontPageBuilder.setupDashboard(
app, newFeed, uniqueId, feedFrontComponentIdentifier);
await FollowRequestsDashboardPageBuilder.setupDashboard(feedMenuPageId, app,
uniqueId, followRequestsDashboardComponentIdentifier);
await FollowersDashboardPageBuilder.setupDashboard(
feedMenuPageId, app, uniqueId, followersDashboardComponentIdentifier);
await FollowingDashboardPageBuilder.setupDashboard(
feedMenuPageId, app, uniqueId, followingDashboardComponentIdentifier);
await InviteDashboardPageBuilder.setupDashboard(
feedMenuPageId, app, uniqueId, inviteDashboardComponentIdentifier);
var feedMenu = FeedMenuModel(
documentID: constructDocumentId(
uniqueId: uniqueId, documentId: feedMenuComponentIdentifier),
appId: app.documentID,
description: 'Feed',
itemColor: null,
selectedItemColor: null,
feedFront: newFeedFront,
bodyComponentsCurrentMember: [
followRequestsDashboardComponent(
followRequestsDashboardComponentIdentifier),
followersDashboardComponent(followersDashboardComponentIdentifier),
followingDashboardComponent(followingDashboardComponentIdentifier),
inviteDashboardComponent(inviteDashboardComponentIdentifier),
],
bodyComponentsOtherMember: [],
conditions: StorageConditionsModel(
privilegeLevelRequired:
PrivilegeLevelRequiredSimple.noPrivilegeRequiredSimple),
);
feedMenuRepository(appId: app.documentID)!.add(feedMenu);
return await doIt(
componentName: AbstractFeedMenuComponent.componentName,
componentIdentifier: feedMenuComponentIdentifier,
title: "Feed",
description: "Feed");
}