public IEnumerable <VueMenuItem> DefineSidebarMenuItems()
 {
     yield return(new VueMenuItem {
         CategoryId = MEDIA_MENU_CATEGORY_ID,
         Label = "File Explorer",
         Href = _urlsProv.GenerateManageFileExplorerUrl(),
         IconCssClass = "fa fa-folder-open",
         RowOrder = 0,
         IsVisible = ctx => ctx.UserHasPermission(ManageFileExplorerPermission.PERMISSION_ID)
     });
 }
        public VueComponentDefinition[] ConvertFormToVues(ContentModifierForm modifierForm, ContentField field,
                                                          ContentModifyOperation operation, ProtoContent content, ContentFieldDefinition fieldDefinition)
        {
            var fcfg = fieldDefinition.Config.DirectCastTo <FilePickerFieldConfiguration>();

            return(new[] {
                new VueComponentDefinition {
                    Name = "cms-form-field-file-picker",
                    Props = new {
                        label = fcfg.Label ?? fieldDefinition.FieldName,
                        valuePath = nameof(FilePickerFieldModifierForm.Val),
                        helpText = fcfg.HelpText,
                        isMultiSelect = fcfg.IsMultiSelect,
                        fileExplorerPageUrl = _urlProv.GenerateManageFileExplorerUrl()
                    }
                }
            });
        }
 public override IDictionary <string, VueComponentDefinition[]> ConvertFormToVues(
     IDictionary <string, ContentModifierForm> modifierForm, ApplicationUser datum,
     DatumModifyOperation operation,
     Type datumType)
 {
     if (operation.IsCreateOrUpdateOperation())
     {
         var vues = new List <VueComponentDefinition>();
         vues.AddRange(new[] {
             new VueComponentDefinition {
                 Name  = "cms-form-field-hidden",
                 Props = new {
                     valuePath = nameof(UserDatumModifierForm.Id)
                 }
             },
             new VueComponentDefinition {
                 Name  = "cms-form-field-text",
                 Props = new {
                     label     = "UserName",
                     valuePath = nameof(UserDatumModifierForm.UserName)
                 }
             },
             new VueComponentDefinition {
                 Name  = "cms-form-field-checkbox",
                 Props = new {
                     label     = "Activated?",
                     valuePath = nameof(UserDatumModifierForm.IsActivated),
                     yesLabel  = "Activated",
                     noLabel   = "Deactivated"
                 }
             }
         });
         if (operation.IsUpdateOperation())
         {
             vues.Add(new VueComponentDefinition {
                 Name  = "cms-form-field-checkbox",
                 Props = new {
                     label     = "Change Password?",
                     valuePath = nameof(UserDatumModifierForm.ChangePassword),
                     helpText  = "Enable this to also change user password when updating data.",
                     yesLabel  = "Change",
                     noLabel   = "Don't Change"
                 }
             });
         }
         vues.AddRange(new[] {
             new VueComponentDefinition {
                 Name  = "cms-form-field-password",
                 Props = new {
                     label     = "Password",
                     valuePath = nameof(UserDatumModifierForm.Password)
                 }
             },
             new VueComponentDefinition {
                 Name  = "cms-form-field-password",
                 Props = new {
                     label     = "Password Confirmation",
                     valuePath = nameof(UserDatumModifierForm.PasswordConfirmation)
                 }
             },
             new VueComponentDefinition {
                 Name  = "cms-form-field-text",
                 Props = new {
                     label     = "Display Name",
                     valuePath = nameof(UserDatumModifierForm.DisplayName)
                 }
             },
             new VueComponentDefinition {
                 Name  = "cms-form-field-file-picker",
                 Props = new {
                     label               = "Photo",
                     valuePath           = nameof(UserDatumModifierForm.PhotoUrl),
                     fileExplorerPageUrl = _urlProv.GenerateManageFileExplorerUrl()
                 }
             },
             new VueComponentDefinition {
                 Name  = "cms-form-field-text",
                 Props = new {
                     label     = "Email",
                     valuePath = nameof(UserDatumModifierForm.Email)
                 }
             },
             new VueComponentDefinition {
                 Name  = "cms-form-field-checkbox",
                 Props = new {
                     label     = "Email Confirmed?",
                     valuePath = nameof(UserDatumModifierForm.EmailConfirmed),
                     yesLabel  = "Confirmed",
                     noLabel   = "Not Confirmed"
                 }
             },
             new VueComponentDefinition {
                 Name  = "cms-form-field-text",
                 Props = new {
                     label     = "Phone No.",
                     valuePath = nameof(UserDatumModifierForm.PhoneNumber)
                 }
             },
             new VueComponentDefinition {
                 Name  = "cms-form-field-checkbox",
                 Props = new {
                     label     = "Phone No. Confirmed?",
                     valuePath = nameof(UserDatumModifierForm.PhoneNumberConfirmed),
                     yesLabel  = "Confirmed",
                     noLabel   = "Not Confirmed"
                 }
             },
             new VueComponentDefinition {
                 Name  = "cms-form-field-select",
                 Props = new {
                     label               = "Roles",
                     valuePath           = nameof(UserDatumModifierForm.RoleIds),
                     isMultiSelect       = true,
                     optionsHandlerId    = DatumSelectFieldOptionsHandler.HANDLER_ID,
                     optionsHandlerParam = Jsonizer.Convert(new DatumSelectFieldOptionsHandlerParam {
                         DatumTypeId = "role",
                         SortInfos   = new[] { Tuple.Create("Name", false) }
                     })
                 }
             }
         });
         return(new Dictionary <string, VueComponentDefinition[]> {
             [FORM_KEY] = vues.ToArray()
         });
     }
     if (operation.IsDeleteOperation())
     {
         return(new Dictionary <string, VueComponentDefinition[]> {
             [FORM_KEY] = new VueComponentDefinition[] {
                 new VueHtmlWidget("Proceed to delete?")
             }
         });
     }
     return(null);
 }