Esempio n. 1
0
 public override IDisplayResult Display(ContentItem model)
 {
     return(Combine(
                Dynamic("AddToDeploymentPlan_Modal__ActionDeploymentPlan")
                .Location("SummaryAdmin", "ActionsMenu:30")
                .RenderWhen(async() => await _deploymentPlanService.DoesUserHavePermissionsAsync()),
                Shape("AddToDeploymentPlan_SummaryAdmin__Button__Actions", new ContentItemViewModel(model))
                .Location("SummaryAdmin", "ActionsMenu:30")
                .RenderWhen(async() => await _deploymentPlanService.DoesUserHavePermissionsAsync())
                ));
 }
        public async Task ProcessDeploymentStepAsync(DeploymentStep deploymentStep, DeploymentPlanResult result)
        {
            if (!(deploymentStep is DeploymentPlanDeploymentStep deploymentPlanStep))
            {
                return;
            }

            if (!await _deploymentPlanService.DoesUserHavePermissionsAsync())
            {
                return;
            }

            var deploymentPlans = deploymentPlanStep.IncludeAll
                ? (await _deploymentPlanService.GetAllDeploymentPlansAsync()).ToArray()
                : (await _deploymentPlanService.GetDeploymentPlansAsync(deploymentPlanStep.DeploymentPlanNames)).ToArray();

            var plans = (from plan in deploymentPlans
                         select new
            {
                plan.Name,
                Steps = (from step in plan.DeploymentSteps
                         select new
                {
                    Type = step.GetType().Name,
                    Step = step
                }).ToArray()
            }).ToArray();

            // Adding deployment plans
            result.Steps.Add(new JObject(
                                 new JProperty("name", "deployment"),
                                 new JProperty("Plans", JArray.FromObject(plans))
                                 ));
        }
Esempio n. 3
0
        public override async Task <IDisplayResult> DisplayAsync(ContentItem model, BuildDisplayContext context)
        {
            if (await _deploymentPlanService.DoesUserHavePermissionsAsync())
            {
                return(Combine(
                           Dynamic("AddToDeploymentPlan_Modal__ActionDeploymentPlan").Location("SummaryAdmin", "ActionsMenu:30"),
                           Shape("AddToDeploymentPlan_SummaryAdmin__Button__Actions", new ContentItemViewModel(model)).Location("SummaryAdmin", "ActionsMenu:30")
                           ));
            }

            return(null);
        }
Esempio n. 4
0
        public override async Task <IDisplayResult> DisplayAsync(ContentOptionsViewModel model, BuildDisplayContext context)
        {
            if (await _deploymentPlanService.DoesUserHavePermissionsAsync())
            {
                return(Combine(
                           Dynamic("AddToDeploymentPlan__Button__ContentsBulkActions").Location("BulkActions", "Content:20"),
                           Dynamic("AddToDeploymentPlan_Modal__ContentsBulkActionsDeploymentPlan").Location("BulkActions", "Content:20")
                           ));
            }

            return(null);
        }