Activities of "nabass"

Question

hi how to hide <abp-tab> from screen i want to keep the code but make it hidden in screen type="hidden" => not work display:none; => not work

  • ABP Framework version: v8.0.2
  • UI Type: MVC
Question
  • ABP Framework version: v8.2
  • UI Type:MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace:
  • Steps to reproduce the issue: I have screen called wizard and has two existing pages firstPage and second Page (these pages already working)
  • but when i want to view one of them in the wizard screen using
  • <partial name="@Model.CurrentStep.ViewPath"
            model="@Model.CurrentStep.Model"
            view-data="@Model.CurrentStep.ViewData" />
    
but it is not working and gives me error  

![image.png](/QA/files/3a1780e102e79ed019979009d519cc25.png)

i know there is AbpViewComponent and i already used it in another thing,
but here i want to use pages already done before to avoide recode again in viewComponent 
Question

hi i am trying to create partial view screen i almost done but i got some problem if abp framework can solve it by using injection,class inherit or something else i attached video to see behavior i want avoid that sidebar && toolbar are visible for almost 4 || 5 sec then disappear they are disappear till page has rendering i want to make them always display: none i used js code => not work created new methods for checking if screen display or not then do the style => not work so if you can help or abp gives simple solution please share it here is the behavior video https://streamable.com/4r550a

here is my code

@page
@model Horizon.HorizonERP.Web.Pages.WizardSrs.IndexModel
@using Horizon.CoreSetting.Permissions
@using Horizon.HorizonERP.Web.Menus
@using Horizon.MainAccounting.Localization
@using Horizon.MainAccounting.Permissions
@using Horizon.MainAccounting.Web.Menus
@using Microsoft.AspNetCore.Authorization
@using Microsoft.Extensions.Localization
@using System.Net
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@inject IStringLocalizer<MainAccountingResource> L
@inject IAuthorizationService Authorization
@inject IPageLayout PageLayout

@{
    PageLayout.Content.Title = L["Wizard Steps"].Value;
    PageLayout.Content.MenuItemName = HorizonERPMenus.MainWizard;
}

@section styles
{
    <abp-style src="/Pages/WizardSrs/style.css" />
}



 <form method="post" id="wizardForm">
    <abp-container>
        <div class="wizard-header d-flex justify-content-center align-items-center mb-4 flex-wrap" id="wizardHeader"></div>

        <abp-card>
            <div class="wizard-content" id="wizardContent">
                <abp-card-body id="cardBody" class="wizard_body"></abp-card-body>
            </div>
        </abp-card>

        <div class="d-flex justify-content-between mt-1">
            <div class="wizard-navigation">
                <button class="btn btn-secondary" id="prev-btn" type="button" disabled>Previous</button>
                <button class="btn btn-primary" id="next-btn" type="button">Next</button>
            </div>
        </div>
    </abp-container>
</form> 

 <script>
    document.addEventListener("DOMContentLoaded", function () {
        let currentStepIndex = 0;
        let wizardSteps = [];

        // Fetch steps from the server
        async function getWizardSteps() {
            try {
                const response = await fetch("/api/CoreSetting/Wizard/getsteps");
                if (!response.ok) throw new Error(`Failed to fetch steps: ${response.statusText}`);

                const data = await response.json();
                if (!Array.isArray(data)) throw new Error("Invalid steps format.");

                wizardSteps = data;
                renderWizardSteps();
                loadWizardContent();
            } catch (error) {
                console.error("Error fetching wizard steps:", error);
            }
        }

        function renderWizardSteps() {
            const wizardHeader = document.getElementById("wizardHeader");
            wizardHeader.innerHTML = "";

            wizardSteps.forEach((step, index) => {
                const stepElement = document.createElement("div");
                stepElement.classList.add("wizard-step");
                if (index === currentStepIndex) stepElement.classList.add("active");

                stepElement.innerHTML = `
                    &lt;div class=&quot;circle&quot;&gt;${step.stepsSort}&lt;/div&gt;
                    &lt;a href=&quot;${step.url || &quot;#&quot;}&quot; class=&quot;label&quot;&gt;${step.program}&lt;/a&gt;
                    ${index &lt; wizardSteps.length - 1 ? &#39;&lt;div class=&quot;wizard-line&quot;&gt;&lt;/div&gt;' : ""}
                `;

                wizardHeader.appendChild(stepElement);

                const linkElement = stepElement.querySelector("a");
                if (linkElement) {
                    linkElement.classList.remove("lpx-sidebar-container", "lpx-toolbar-container");
                }
            });

            updateButtonStates();
        }

        function updateButtonStates() {
            document.getElementById("prev-btn").disabled = currentStepIndex === 0;
            document.getElementById("next-btn").disabled = currentStepIndex === wizardSteps.length - 1;
        }

        function loadWizardContent() {
            const currentStep = wizardSteps[currentStepIndex];
            const wizardContent = document.getElementById("wizardContent");

            wizardContent.innerHTML = `
                &lt;iframe src=&quot;${currentStep.url || &quot;#&quot;}&quot; style=&quot;width: 100%; height: 500px; border: none;&quot;&gt;&lt;/iframe&gt;
            `;

            const iframe = wizardContent.querySelector("iframe");

            // Apply styles immediately while the iframe is loading
            iframe.onload = () => applyStylesToIframe(iframe);

            iframe.addEventListener("loadstart", () => {
                try {
                    const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
                    injectStyles(iframeDoc); // Apply styles as soon as possible
                } catch (error) {
                    console.error("Could not inject styles immediately:", error);
                }
            });
        }

        function applyStylesToIframe(iframe) {
            try {
                const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
                injectStyles(iframeDoc); // Apply styles when iframe is fully loaded
            } catch (error) {
                console.error("Could not apply styles to iframe:", error);
            }
        }

        function injectStyles(iframeDoc) {
            // Add the styles dynamically
            const style = iframeDoc.createElement("style");
            style.textContent = `
                .lpx-sidebar-container,
                .lpx-toolbar-container
                 {
                    display: none !important;
                }
 {
                    display: none !important;
                }
            `;
            iframeDoc.head.appendChild(style);
        }

        // Button Click Handlers
        document.getElementById("prev-btn").addEventListener("click", () => {
            if (currentStepIndex > 0) {
                currentStepIndex--;
                renderWizardSteps();
                loadWizardContent();
            }
        });

        document.getElementById("next-btn").addEventListener("click", () => {
            if (currentStepIndex < wizardSteps.length - 1) {
                currentStepIndex++;
                renderWizardSteps();
                loadWizardContent();
            }
        });

        // Initialize Wizard
        getWizardSteps();
    });

</script> 
  • ABP Framework version: v8.0.2
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
Question

hi i tried to create partial view in my project at first my project about multi modules each module has it's own logic, pages , services, permissions ...... etc i created new component called (Wizard) in Src project i want to make partial view within it to get a multiple pages on his own card and make me do an operation CRUD on it like it's pages i do js code and it get the correct page using it's url but call the all page with the side bars (which including menus and logout and icons) and i wanna just the main card(body) of it

  • ABP Framework version: v8.0.2
  • UI Type: MVC
  • Database System: EF Core (SQL Server)

hi i have multi modules project each module has his own permissions and seeder so i want when creating new tenant create two roles by default with specific permissions

i achieved creating roles but permissions no i get the code which give them all permissions

 var multiTenancySide = CurrentTenant.GetMultiTenancySide();
 var allPermissionNames = (await PermissionDefinitionManager.GetPermissionsAsync())
     .Where(p => p.MultiTenancySide.HasFlag(multiTenancySide))
     .Select(p => p.Name)
     .ToArray(); 

i created new array and put my permissions within it ===> not work i get all permission then filter them ===> not work here is my code


using Horizon.CoreSetting;
using Horizon.EInvoice;
using Horizon.HRMS1;
using Horizon.Inventory;
using Horizon.MainAccounting;
using Horizon.POS;
 
using Microsoft.Extensions.Options;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;

using System;
using System.Linq;
 
using Volo.Abp.Authorization.Permissions;
 
using Volo.Abp.Guids;
using Volo.Abp.Identity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement;
using Volo.Abp.Uow;
using Microsoft.AspNetCore.Identity;
using System.Collections.Generic;



namespace Horizon.HorizonERP.ERP
{
    public class ERPDataSeedContributor : IDataSeedContributor, ITransientDependency
    {
        protected IGuidGenerator GuidGenerator { get; }
        protected IIdentityRoleRepository RoleRepository { get; }
        protected IIdentityUserRepository UserRepository { get; }
        protected ILookupNormalizer LookupNormalizer { get; }
        protected IdentityUserManager UserManager { get; }
        protected IdentityRoleManager RoleManager { get; }
        protected ICurrentTenant CurrentTenant { get; }
        protected IOptions<IdentityOptions> IdentityOptions { get; }
        protected IPermissionDefinitionManager PermissionDefinitionManager { get; }
        protected IPermissionDataSeeder PermissionDataSeeder { get; }


 
        private readonly InventoryDataSeederContributor _inventoryDataSeederContributor;
 private readonly POSDataSeederContributor _POsDataSeederContributor;
 
        public ERPDataSeedContributor(  
            InventoryDataSeederContributor inventoryDataSeederContributor 
 
            IGuidGenerator guidGenerator,
            IIdentityRoleRepository roleRepository,
            IIdentityUserRepository userRepository,
            ILookupNormalizer lookupNormalizer,
            IdentityUserManager userManager,
            IdentityRoleManager roleManager,
            ICurrentTenant currentTenant,
            IOptions<IdentityOptions> identityOptions,
            IPermissionDefinitionManager permissionDefinitionManager,
            IPermissionDataSeeder permissionDataSeeder)
        {
            GuidGenerator = guidGenerator;
            RoleRepository = roleRepository;
            UserRepository = userRepository;
            LookupNormalizer = lookupNormalizer;
            UserManager = userManager;
            RoleManager = roleManager;
            CurrentTenant = currentTenant;
            IdentityOptions = identityOptions;
            PermissionDefinitionManager = permissionDefinitionManager;
            PermissionDataSeeder = permissionDataSeeder;


  
            _inventoryDataSeederContributor = inventoryDataSeederContributor;
 
  		_POsDataSeederContributor = pOsDataSeederContributor;
        }
        [UnitOfWork]
        public async Task SeedAsync(DataSeedContext context)
        {
 
            await _inventoryDataSeederContributor.SeedAsync(context);
 
            await _POsDataSeederContributor.SeedAsync(context);

            var tenantId = context.TenantId;
            using (CurrentTenant.Change(tenantId))
            {
                await IdentityOptions.SetAsync();

                // "Accounting" and "Cashier" roles
                const string accRoleName = "Accounting";
                const string cashRoleName = "Cashier";

                var accRoleNameRole = await RoleRepository.FindByNormalizedNameAsync(LookupNormalizer.NormalizeName(accRoleName));
                if (accRoleNameRole == null)
                {
                    accRoleNameRole = new Volo.Abp.Identity.IdentityRole(GuidGenerator.Create(), accRoleName, tenantId)
                    {
                        IsPublic = true
                    };

                    (await RoleManager.CreateAsync(accRoleNameRole)).CheckErrors();
                }

                var cashRoleNameRole = await RoleRepository.FindByNormalizedNameAsync(LookupNormalizer.NormalizeName(cashRoleName));
                if (cashRoleNameRole == null)
                {
                    cashRoleNameRole = new Volo.Abp.Identity.IdentityRole(GuidGenerator.Create(), cashRoleName, tenantId)
                    {
                        IsPublic = true
                    };

                    (await RoleManager.CreateAsync(cashRoleNameRole)).CheckErrors();
                }
                //var user = await UserRepository.FindAsync(tenantId.Value);//your user id

                //(await UserManager.AddToRoleAsync(user, accRoleName)).CheckErrors();
                //(await UserManager.AddToRoleAsync(user, cashRoleName)).CheckErrors();

                var multiTenancySide = CurrentTenant.GetMultiTenancySide();
                var allPermissionNames = (await PermissionDefinitionManager.GetPermissionsAsync())
                    .Where(p => p.MultiTenancySide.HasFlag(multiTenancySide))
                    .Select(p => p.Name)
                    .ToArray();

                var accPermissions = new[]
                {
                    "AccountIntegrations.Create",
                    "AccountIntegrations.Edit",
                    "AccountIntegrations.Delete",
                };
                await PermissionDataSeeder.SeedAsync(
                    RolePermissionValueProvider.ProviderName,
                    accRoleName,
                    accPermissions,
                    context?.TenantId
                     //allPermissionNames,
                );

                var cashPermissions = new[]
                {
                    "BasketReturn.Create"
                };

                await PermissionDataSeeder.SeedAsync(
                    RolePermissionValueProvider.ProviderName,
                    cashRoleName,
                    cashPermissions,
                    context?.TenantId
                    //allPermissionNames,
                );

            }
        }
    }
}

  • ABP Framework version: v8.0.2
  • UI Type:MVC
  • Database System: EF Core (SQL Server)

when run angular application i got this error all configurations are good .... response is 200 all is well why this error

  • ABP Framework version: v8.0.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
Question

hi sir,, how to change my project title i changed the title within index.html file as normal Angular project and environment.ts but still got this title where can i find it ??

  • ABP Framework version: v8.0.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)

hi sir i have an entity (company) with it's logic and pages this entity within (core) module now i want to transfer company createModal page to tenant page to make user when he add new tenant add new company add year add product ..... etc so i my work will be within tenant screen i created cs class and cshtml cs class without errors but cshtml i got error

  • ABP Framework version: v8.0.2
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
Question

hi according to Q #3440 you said that you are working to allow Wizard Component in the future is there any updated or still abp not support Wizard Component ??

  • ABP Framework version: v8.0.2
  • UI Type: MVC
  • Database System: EF Core (SQL Server )
Question

hi i wish i can explain i want to make logic that allows me open page or not according to Authorization i attached some images to explain what i want what i want is: if i have 2 users (x ,y) x has permission for specific pages so i must give him requiredPolicy within route.provider.ts file and not open the page if he hasn't permission put in my case what happen is just router link appear or not according to permission and page still open even if (x) hasn't permission

both if has permission or not will open this page and i don't want this just open it if has permission

  • ABP Framework version: v8.0.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
Showing 11 to 20 of 74 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 12, 2025, 10:20