Exemplo n.º 1
0
        public ViewResult Detail(TaxonomyBranchPrimaryKey taxonomyBranchPrimaryKey)
        {
            var taxonomyBranch         = taxonomyBranchPrimaryKey.EntityObject;
            var taxonomyBranchProjects = taxonomyBranch.GetAssociatedProjects(CurrentPerson).ToList();

            var projectMapCustomization = new ProjectMapCustomization(ProjectLocationFilterType.TaxonomyBranch, new List <int> {
                taxonomyBranch.TaxonomyBranchID
            }, ProjectColorByType.ProjectStage);
            var projectLocationsLayerGeoJson = new LayerGeoJson($"{FieldDefinition.ProjectLocation.GetFieldDefinitionLabel()}", Project.MappedPointsToGeoJsonFeatureCollection(taxonomyBranchProjects, true, true), "red", 1, LayerInitialVisibility.Show);
            var projectLocationsMapInitJson  = new ProjectLocationsMapInitJson(projectLocationsLayerGeoJson, projectMapCustomization, "TaxonomyBranchProjectMap");
            var projectLocationsMapViewData  = new ProjectLocationsMapViewData(projectLocationsMapInitJson.MapDivID, ProjectColorByType.ProjectStage.DisplayName, MultiTenantHelpers.GetTopLevelTaxonomyTiers(), CurrentPerson.CanViewProposals);

            var associatePerformanceMeasureTaxonomyLevel = MultiTenantHelpers.GetAssociatePerformanceMeasureTaxonomyLevel();
            var canHaveAssociatedPerformanceMeasures     = associatePerformanceMeasureTaxonomyLevel == TaxonomyLevel.Branch;
            var taxonomyTierPerformanceMeasures          = taxonomyBranch.GetTaxonomyTierPerformanceMeasures();
            var relatedPerformanceMeasuresViewData       = new RelatedPerformanceMeasuresViewData(associatePerformanceMeasureTaxonomyLevel, true, taxonomyTierPerformanceMeasures, canHaveAssociatedPerformanceMeasures);
            List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas = null;

            if (canHaveAssociatedPerformanceMeasures)
            {
                performanceMeasureChartViewDatas = taxonomyTierPerformanceMeasures.Select(x => new PerformanceMeasureChartViewData(x.Key, CurrentPerson, false, new List <Project>())).ToList();
            }

            var taxonomyLevel = MultiTenantHelpers.GetTaxonomyLevel();
            var viewData      = new DetailViewData(CurrentPerson, taxonomyBranch, projectLocationsMapInitJson, projectLocationsMapViewData, canHaveAssociatedPerformanceMeasures, relatedPerformanceMeasuresViewData, performanceMeasureChartViewDatas, taxonomyLevel);

            return(RazorView <Summary, DetailViewData>(viewData));
        }
Exemplo n.º 2
0
        public DetailViewData(FirmaSession currentFirmaSession,
                              ProjectFirmaModels.Models.TaxonomyTrunk taxonomyTrunk,
                              ProjectLocationsMapInitJson projectLocationsMapInitJson,
                              ProjectLocationsMapViewData projectLocationsMapViewData, bool canHaveAssociatedPerformanceMeasures,
                              RelatedPerformanceMeasuresViewData relatedPerformanceMeasuresViewData,
                              List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas, TaxonomyLevel taxonomyLevel,
                              List <ProjectCustomGridConfiguration> projectCustomDefaultGridConfigurations) : base(currentFirmaSession)
        {
            TaxonomyTrunk                       = taxonomyTrunk;
            TaxonomyTrunkDisplayName            = FieldDefinitionEnum.TaxonomyTrunk.ToType().GetFieldDefinitionLabel();
            TaxonomyTrunkDisplayNamePluralized  = FieldDefinitionEnum.TaxonomyTrunk.ToType().GetFieldDefinitionLabelPluralized();
            TaxonomyBranchDisplayNamePluralized = FieldDefinitionEnum.TaxonomyBranch.ToType().GetFieldDefinitionLabelPluralized();
            TaxonomyLeafDisplayNamePluralized   = FieldDefinitionEnum.TaxonomyLeaf.ToType().GetFieldDefinitionLabelPluralized();

            ProjectLocationsMapInitJson = projectLocationsMapInitJson;
            ProjectLocationsMapViewData = projectLocationsMapViewData;

            ProjectMapFilteredUrl = ProjectLocationsMapInitJson.ProjectMapCustomization.GetCustomizedUrl();

            PageTitle  = taxonomyTrunk.GetDisplayName();
            EntityName = TaxonomyTrunkDisplayName;
            IndexUrl   = SitkaRoute <ProgramInfoController> .BuildUrlFromExpression(c => c.Taxonomy());

            UserHasTaxonomyTrunkManagePermissions = new TaxonomyTrunkManageFeature().HasPermissionByFirmaSession(CurrentFirmaSession);
            UserHasProjectTaxonomyTrunkExpenditureManagePermissions = new TaxonomyTrunkManageFeature().HasPermissionByFirmaSession(CurrentFirmaSession);
            EditTaxonomyTrunkUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(c => c.Edit(taxonomyTrunk.TaxonomyTrunkID));

            TaxonomyBranchIndexUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(c => c.Index());

            var projectDetails = HttpRequestStorage.DatabaseEntities.vProjectDetails.ToDictionary(x => x.ProjectID);

            ProjectCustomDefaultGridSpec = new ProjectCustomGridSpec(currentFirmaSession, projectCustomDefaultGridConfigurations, ProjectCustomGridType.Default.ToEnum, projectDetails, currentFirmaSession.Tenant)
            {
                ObjectNameSingular = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}", ObjectNamePlural = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true
            };

            ProjectCustomDefaultGridName    = "taxonomyTrunkProjectListGrid";
            ProjectCustomDefaultGridDataUrl = SitkaRoute <ProjectCustomGridController> .BuildUrlFromExpression(tc => tc.TaxonomyTrunkProjectsGridJsonData(taxonomyTrunk));

            ProjectTaxonomyViewData = new ProjectTaxonomyViewData(taxonomyTrunk, taxonomyLevel);

            CanHaveAssociatedPerformanceMeasures = canHaveAssociatedPerformanceMeasures;
            PerformanceMeasureChartViewDatas     = performanceMeasureChartViewDatas;
            RelatedPerformanceMeasuresViewData   = relatedPerformanceMeasuresViewData;

            EditChildrenSortOrderUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(x => x.EditChildrenSortOrder(taxonomyTrunk));
        }
        public DetailViewData(Person currentPerson,
                              Models.TaxonomyTrunk taxonomyTrunk,
                              ProjectLocationsMapInitJson projectLocationsMapInitJson,
                              ProjectLocationsMapViewData projectLocationsMapViewData, bool canHaveAssociatedPerformanceMeasures,
                              RelatedPerformanceMeasuresViewData relatedPerformanceMeasuresViewData,
                              List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas, TaxonomyLevel taxonomyLevel) : base(currentPerson)
        {
            TaxonomyTrunk                       = taxonomyTrunk;
            TaxonomyTrunkDisplayName            = Models.FieldDefinition.TaxonomyTrunk.GetFieldDefinitionLabel();
            TaxonomyTrunkDisplayNamePluralized  = Models.FieldDefinition.TaxonomyTrunk.GetFieldDefinitionLabelPluralized();
            TaxonomyBranchDisplayNamePluralized = Models.FieldDefinition.TaxonomyBranch.GetFieldDefinitionLabelPluralized();
            ProjectTypeDisplayNamePluralized    = Models.FieldDefinition.ProjectType.GetFieldDefinitionLabelPluralized();

            ProjectLocationsMapInitJson = projectLocationsMapInitJson;
            ProjectLocationsMapViewData = projectLocationsMapViewData;

            ProjectMapFilteredUrl = ProjectLocationsMapInitJson.ProjectMapCustomization.GetCustomizedUrl();

            PageTitle  = taxonomyTrunk.DisplayName;
            EntityName = TaxonomyTrunkDisplayName;
            IndexUrl   = SitkaRoute <ProgramInfoController> .BuildUrlFromExpression(c => c.Taxonomy());

            UserHasTaxonomyTrunkManagePermissions = new TaxonomyTrunkManageFeature().HasPermissionByPerson(CurrentPerson);
            UserHasProjectTaxonomyTrunkExpenditureManagePermissions = new TaxonomyTrunkManageFeature().HasPermissionByPerson(currentPerson);
            EditTaxonomyTrunkUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(c => c.Edit(taxonomyTrunk.TaxonomyTrunkID));

            TaxonomyBranchIndexUrl = SitkaRoute <TaxonomyBranchController> .BuildUrlFromExpression(c => c.Index());

            BasicProjectInfoGridName = "taxonomyTrunkProjectListGrid";
            BasicProjectInfoGridSpec = new BasicProjectInfoGridSpec(CurrentPerson, true)
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} with this {TaxonomyTrunkDisplayName}",
                ObjectNamePlural    = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()} with this {TaxonomyTrunkDisplayName}",
                SaveFiltersInCookie = true
            };

            BasicProjectInfoGridDataUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(taxonomyTrunk));

            ProjectTaxonomyViewData = new ProjectTaxonomyViewData(taxonomyTrunk, taxonomyLevel);

            CanHaveAssociatedPerformanceMeasures = canHaveAssociatedPerformanceMeasures;
            PerformanceMeasureChartViewDatas     = performanceMeasureChartViewDatas;
            RelatedPerformanceMeasuresViewData   = relatedPerformanceMeasuresViewData;

            EditChildrenSortOrderUrl = SitkaRoute <TaxonomyTrunkController> .BuildUrlFromExpression(x => x.EditChildrenSortOrder(taxonomyTrunk));
        }
Exemplo n.º 4
0
        public ViewResult Detail(TaxonomyTrunkPrimaryKey taxonomyTrunkPrimaryKey)
        {
            var taxonomyTrunk         = taxonomyTrunkPrimaryKey.EntityObject;
            var taxonomyTrunkProjects = taxonomyTrunk.GetAssociatedProjects(CurrentFirmaSession).ToList();

            var projectMapCustomization = new ProjectMapCustomization(ProjectLocationFilterType.TaxonomyTrunk,
                                                                      new List <int> {
                taxonomyTrunk.TaxonomyTrunkID
            }, ProjectColorByType.ProjectStage);
            var projectLocationsLayerGeoJson =
                new LayerGeoJson($"{FieldDefinitionEnum.ProjectLocation.ToType().GetFieldDefinitionLabel()}",
                                 taxonomyTrunkProjects.MappedPointsToGeoJsonFeatureCollection(false, true, true), "red", 1,
                                 LayerInitialVisibility.LayerInitialVisibilityEnum.Show);
            var projectLocationsMapInitJson = new ProjectLocationsMapInitJson(projectLocationsLayerGeoJson,
                                                                              projectMapCustomization, "TaxonomyTrunkProjectMap", false);

            var projectLocationsMapViewData = new ProjectLocationsMapViewData(projectLocationsMapInitJson.MapDivID,
                                                                              ProjectColorByType.ProjectStage.GetDisplayNameFieldDefinition(), MultiTenantHelpers.GetTopLevelTaxonomyTiers(),
                                                                              CurrentFirmaSession.CanViewProposals());

            var associatePerformanceMeasureTaxonomyLevel =
                MultiTenantHelpers.GetAssociatePerformanceMeasureTaxonomyLevel();
            var canHaveAssociatedPerformanceMeasures = associatePerformanceMeasureTaxonomyLevel == TaxonomyLevel.Trunk;
            var taxonomyTierPerformanceMeasures      = taxonomyTrunk.GetTaxonomyTierPerformanceMeasures();
            var relatedPerformanceMeasuresViewData   = new RelatedPerformanceMeasuresViewData(
                associatePerformanceMeasureTaxonomyLevel, true, taxonomyTierPerformanceMeasures,
                canHaveAssociatedPerformanceMeasures);
            List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas = null;

            if (canHaveAssociatedPerformanceMeasures)
            {
                performanceMeasureChartViewDatas = taxonomyTierPerformanceMeasures.Select(x =>
                                                                                          new PerformanceMeasureChartViewData(x.Key, CurrentFirmaSession, false, new List <Project>())).ToList();
            }

            var taxonomyLevel = MultiTenantHelpers.GetTaxonomyLevel();
            var projectCustomDefaultGridConfigurations = HttpRequestStorage.DatabaseEntities.ProjectCustomGridConfigurations.Where(x => x.IsEnabled && x.ProjectCustomGridTypeID == ProjectCustomGridType.Default.ProjectCustomGridTypeID).OrderBy(x => x.SortOrder).ToList();
            var viewData = new DetailViewData(CurrentFirmaSession, taxonomyTrunk, projectLocationsMapInitJson,
                                              projectLocationsMapViewData, canHaveAssociatedPerformanceMeasures, relatedPerformanceMeasuresViewData,
                                              performanceMeasureChartViewDatas, taxonomyLevel, projectCustomDefaultGridConfigurations);

            return(RazorView <Detail, DetailViewData>(viewData));
        }
        public DetailViewData(Person currentPerson,
                              Models.ProjectType projectType,
                              ProjectLocationsMapInitJson projectLocationsMapInitJson,
                              ProjectLocationsMapViewData projectLocationsMapViewData, bool canHaveAssociatedPerformanceMeasures,
                              RelatedPerformanceMeasuresViewData relatedPerformanceMeasuresViewData,
                              List <PerformanceMeasureChartViewData> performanceMeasureChartViewDatas, TaxonomyLevel taxonomyLevel) : base(currentPerson)
        {
            ProjectType = projectType;
            PageTitle   = projectType.DisplayName;
            var fieldDefinitionProjectType = Models.FieldDefinition.ProjectType;
            var projectTypeDisplayName     = fieldDefinitionProjectType.GetFieldDefinitionLabel();

            EntityName = projectTypeDisplayName;

            ProjectLocationsMapInitJson = projectLocationsMapInitJson;
            ProjectLocationsMapViewData = projectLocationsMapViewData;
            ProjectMapFilteredUrl       = ProjectLocationsMapInitJson.ProjectMapCustomization.GetCustomizedUrl();

            UserHasProjectTypeManagePermissions = new ProjectTypeManageFeature().HasPermissionByPerson(CurrentPerson);
            EditProjectTypeUrl = SitkaRoute <ProjectTypeController> .BuildUrlFromExpression(c => c.Edit(projectType));

            IndexUrl = SitkaRoute <ProgramInfoController> .BuildUrlFromExpression(x => x.Taxonomy());

            BasicProjectInfoGridName = "projectTypeProjectListGrid";
            BasicProjectInfoGridSpec = new BasicProjectInfoGridSpec(CurrentPerson, true)
            {
                ObjectNameSingular  = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabel()} with this {projectTypeDisplayName}",
                ObjectNamePlural    = $"{Models.FieldDefinition.Project.GetFieldDefinitionLabelPluralized()} with this {projectTypeDisplayName}",
                SaveFiltersInCookie = true
            };

            BasicProjectInfoGridDataUrl = SitkaRoute <ProjectTypeController> .BuildUrlFromExpression(tc => tc.ProjectsGridJsonData(projectType));

            ProjectTaxonomyViewData = new ProjectTaxonomyViewData(projectType, taxonomyLevel);

            ProjectTypeDisplayName           = projectTypeDisplayName;
            ProjectTypeDisplayNamePluralized = fieldDefinitionProjectType.GetFieldDefinitionLabelPluralized();

            CanHaveAssociatedPerformanceMeasures = canHaveAssociatedPerformanceMeasures;
            PerformanceMeasureChartViewDatas     = performanceMeasureChartViewDatas;
            RelatedPerformanceMeasuresViewData   = relatedPerformanceMeasuresViewData;
        }
Exemplo n.º 6
0
        public ViewResult Detail(TaxonomyLeafPrimaryKey taxonomyLeafPrimaryKey)
        {
            var taxonomyLeaf = taxonomyLeafPrimaryKey.EntityObject;
            var currentPersonCanViewProposals = CurrentFirmaSession.CanViewProposals();

            var primaryTaxonomyLeafProjects = taxonomyLeaf.GetProjects().ToList()
                                              .GetActiveProjectsAndProposals(currentPersonCanViewProposals)
                                              .Where(x => x.ProjectStage.ShouldShowOnMap())
                                              .ToList();
            var secondaryTaxonomyLeafProjects = primaryTaxonomyLeafProjects.Union(
                taxonomyLeaf.SecondaryProjectTaxonomyLeafs.Select(x => x.Project)
                .ToList()
                .GetActiveProjectsAndProposals(currentPersonCanViewProposals)
                .Where(x => x.ProjectStage.ShouldShowOnMap()))
                                                .ToList();

            // This page supports two maps for cases where secondary taxonomy leafs are supported
            var primaryProjectMapCustomization = new ProjectMapCustomization(ProjectLocationFilterType.TaxonomyLeaf,
                                                                             new List <int> {
                taxonomyLeaf.TaxonomyLeafID
            }, ProjectColorByType.ProjectStage);
            var secondaryProjectMapCustomization = new ProjectMapCustomization(ProjectLocationFilterType.TaxonomyLeaf,
                                                                               secondaryTaxonomyLeafProjects.Select(x => x.GetTaxonomyLeaf().TaxonomyLeafID).Union(new List <int> {
                taxonomyLeaf.TaxonomyLeafID
            }).ToList(),
                                                                               ProjectColorByType.ProjectStage);
            var primaryProjectLocationsLayerGeoJson =
                new LayerGeoJson($"{FieldDefinitionEnum.ProjectLocation.ToType().GetFieldDefinitionLabel()}",
                                 primaryTaxonomyLeafProjects.MappedPointsToGeoJsonFeatureCollection(false, true, false), "red", 1,
                                 LayerInitialVisibility.LayerInitialVisibilityEnum.Show);
            var secondaryProjectLocationsLayerGeoJson =
                new LayerGeoJson($"{FieldDefinitionEnum.ProjectLocation.ToType().GetFieldDefinitionLabel()}",
                                 secondaryTaxonomyLeafProjects.MappedPointsToGeoJsonFeatureCollection(false, true, false), "red", 1,
                                 LayerInitialVisibility.LayerInitialVisibilityEnum.Show);
            // Add Organization Type boundaries according to configuration
            var configuredOrganizationBoundariesMapInitJson = HttpRequestStorage.DatabaseEntities.Organizations.GetConfiguredBoundaryLayersGeoJson();

            var primaryProjectLocationsMapInitJson = new ProjectLocationsMapInitJson(primaryProjectLocationsLayerGeoJson,
                                                                                     primaryProjectMapCustomization, "TaxonomyLeafProjectMap", false);

            primaryProjectLocationsMapInitJson.Layers.AddRange(configuredOrganizationBoundariesMapInitJson);

            var secondaryProjectLocationsMapInitJson = new ProjectLocationsMapInitJson(secondaryProjectLocationsLayerGeoJson,
                                                                                       secondaryProjectMapCustomization, "SecondaryTaxonomyLeafProjectMap", false);

            secondaryProjectLocationsMapInitJson.Layers.AddRange(configuredOrganizationBoundariesMapInitJson);

            var primaryProjectLocationsMapViewData = new ProjectLocationsMapViewData(primaryProjectLocationsMapInitJson.MapDivID,
                                                                                     ProjectColorByType.ProjectStage.GetDisplayNameFieldDefinition(), MultiTenantHelpers.GetTopLevelTaxonomyTiers(),
                                                                                     CurrentFirmaSession.CanViewProposals());
            var secondaryProjectLocationsMapViewData = new ProjectLocationsMapViewData(secondaryProjectLocationsMapInitJson.MapDivID,
                                                                                       ProjectColorByType.ProjectStage.GetDisplayNameFieldDefinition(), MultiTenantHelpers.GetTopLevelTaxonomyTiers(),
                                                                                       CurrentFirmaSession.CanViewProposals());

            var associatePerformanceMeasureTaxonomyLevel =
                MultiTenantHelpers.GetAssociatePerformanceMeasureTaxonomyLevel();
            var canHaveAssociatedPerformanceMeasures = associatePerformanceMeasureTaxonomyLevel == TaxonomyLevel.Leaf;
            var taxonomyTierPerformanceMeasures      = taxonomyLeaf.GetTaxonomyTierPerformanceMeasures();
            var relatedPerformanceMeasuresViewData   = new RelatedPerformanceMeasuresViewData(
                associatePerformanceMeasureTaxonomyLevel, true, taxonomyTierPerformanceMeasures,
                canHaveAssociatedPerformanceMeasures);

            var taxonomyLevel   = MultiTenantHelpers.GetTaxonomyLevel();
            var tenantAttribute = MultiTenantHelpers.GetTenantAttributeFromCache();

            var performanceMeasures = taxonomyLeaf.TaxonomyLeafPerformanceMeasures.Select(x => x.PerformanceMeasure)
                                      .ToList();
            var primaryPerformanceMeasureChartViewDataByPerformanceMeasure = performanceMeasures.ToDictionary(
                x => x.PerformanceMeasureID,
                x => new PerformanceMeasureChartViewData(x, CurrentFirmaSession, false, primaryTaxonomyLeafProjects, $"primary{x.GetJavascriptSafeChartUniqueName()}"));
            var secondaryPerformanceMeasureChartViewDataByPerformanceMeasure = performanceMeasures.ToDictionary(
                x => x.PerformanceMeasureID,
                x => new PerformanceMeasureChartViewData(x, CurrentFirmaSession, false, secondaryTaxonomyLeafProjects, $"secondary{x.GetJavascriptSafeChartUniqueName()}"));

            var projectCustomDefaultGridConfigurations = HttpRequestStorage.DatabaseEntities.ProjectCustomGridConfigurations.Where(x => x.IsEnabled && x.ProjectCustomGridTypeID == ProjectCustomGridType.Default.ProjectCustomGridTypeID).OrderBy(x => x.SortOrder).ToList();

            var viewData = new DetailViewData(CurrentFirmaSession, taxonomyLeaf, primaryProjectLocationsMapInitJson,
                                              secondaryProjectLocationsMapInitJson, primaryProjectLocationsMapViewData,
                                              secondaryProjectLocationsMapViewData, canHaveAssociatedPerformanceMeasures,
                                              relatedPerformanceMeasuresViewData, taxonomyLevel, tenantAttribute, performanceMeasures,
                                              primaryPerformanceMeasureChartViewDataByPerformanceMeasure,
                                              secondaryPerformanceMeasureChartViewDataByPerformanceMeasure,
                                              projectCustomDefaultGridConfigurations);

            return(RazorView <Summary, DetailViewData>(viewData));
        }
Exemplo n.º 7
0
        public DetailViewData(FirmaSession currentFirmaSession,
                              ProjectFirmaModels.Models.TaxonomyLeaf taxonomyLeaf,
                              ProjectLocationsMapInitJson primaryProjectLocationsMapInitJson,
                              ProjectLocationsMapInitJson secondaryProjectLocationsMapInitJson,
                              ProjectLocationsMapViewData primaryProjectLocationsMapViewData,
                              ProjectLocationsMapViewData secondaryProjectLocationsMapViewData,
                              bool canHaveAssociatedPerformanceMeasures,
                              RelatedPerformanceMeasuresViewData relatedPerformanceMeasuresViewData,
                              TaxonomyLevel taxonomyLevel,
                              TenantAttribute tenantAttribute,
                              IEnumerable <ProjectFirmaModels.Models.PerformanceMeasure> performanceMeasures,
                              Dictionary <int, PerformanceMeasureChartViewData> primaryPerformanceMeasureChartViewDataByPerformanceMeasure,
                              Dictionary <int, PerformanceMeasureChartViewData> secondaryPerformanceMeasureChartViewDataByPerformanceMeasure,
                              List <ProjectCustomGridConfiguration> projectCustomDefaultGridConfigurations) : base(currentFirmaSession)
        {
            TaxonomyLeaf = taxonomyLeaf;
            PageTitle    = taxonomyLeaf.GetDisplayName();
            var fieldDefinitionTaxonomyLeaf = FieldDefinitionEnum.TaxonomyLeaf;
            var taxonomyLeafDisplayName     = fieldDefinitionTaxonomyLeaf.ToType().GetFieldDefinitionLabel();

            EntityName = taxonomyLeafDisplayName;

            PrimaryProjectLocationsMapInitJson   = primaryProjectLocationsMapInitJson;
            PrimaryProjectLocationsMapViewData   = primaryProjectLocationsMapViewData;
            SecondaryProjectLocationsMapInitJson = secondaryProjectLocationsMapInitJson;
            SecondaryProjectLocationsMapViewData = secondaryProjectLocationsMapViewData;
            ProjectMapFilteredUrl = PrimaryProjectLocationsMapInitJson.ProjectMapCustomization.GetCustomizedUrl();

            UserHasTaxonomyLeafManagePermissions = new TaxonomyLeafManageFeature().HasPermissionByFirmaSession(currentFirmaSession);
            EditTaxonomyLeafUrl = SitkaRoute <TaxonomyLeafController> .BuildUrlFromExpression(c => c.Edit(taxonomyLeaf));

            IndexUrl = SitkaRoute <ProgramInfoController> .BuildUrlFromExpression(x => x.Taxonomy());

            SecondaryBasicProjectInfoGridName = "secondaryLeafProjectListGrid";
            BasicProjectInfoGridSpec          = new ProjectForTaxonomyLeafGridSpec(currentFirmaSession, true, taxonomyLeaf)
            {
                ObjectNameSingular  = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()} with this {taxonomyLeafDisplayName}",
                ObjectNamePlural    = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()} with this {taxonomyLeafDisplayName}",
                SaveFiltersInCookie = true
            };

            SecondaryBasicProjectInfoGridDataUrl = SitkaRoute <TaxonomyLeafController> .BuildUrlFromExpression(tc => tc.SecondaryProjectsGridJsonData(taxonomyLeaf));

            ProjectTaxonomyViewData = new ProjectTaxonomyViewData(taxonomyLeaf, taxonomyLevel);

            var projectDetails = HttpRequestStorage.DatabaseEntities.vProjectDetails.ToDictionary(x => x.ProjectID);

            ProjectCustomDefaultGridSpec = new ProjectCustomGridSpec(currentFirmaSession, projectCustomDefaultGridConfigurations, ProjectCustomGridType.Default.ToEnum, projectDetails, currentFirmaSession.Tenant)
            {
                ObjectNameSingular = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}", ObjectNamePlural = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true
            };

            ProjectCustomDefaultGridName    = "taxonomyLeafProjectListGrid";
            ProjectCustomDefaultGridDataUrl = SitkaRoute <ProjectCustomGridController> .BuildUrlFromExpression(tc => tc.TaxonomyLeafProjectsGridJsonData(taxonomyLeaf));

            TaxonomyLeafDisplayName           = taxonomyLeafDisplayName;
            TaxonomyLeafDisplayNamePluralized = fieldDefinitionTaxonomyLeaf.ToType().GetFieldDefinitionLabelPluralized();

            CanHaveAssociatedPerformanceMeasures = canHaveAssociatedPerformanceMeasures;
            PerformanceMeasures = performanceMeasures;
            PrimaryPerformanceMeasureChartViewDataByPerformanceMeasure   = primaryPerformanceMeasureChartViewDataByPerformanceMeasure;
            SecondaryPerformanceMeasureChartViewDataByPerformanceMeasure = secondaryPerformanceMeasureChartViewDataByPerformanceMeasure;
            RelatedPerformanceMeasuresViewData = relatedPerformanceMeasuresViewData;

            TenantAttribute = tenantAttribute;
        }