Activities of "Sturla"

Found this in Blazor Server 8.1.1

Most are CMS but the first one is in all pages

1

Strange icon (face-frown) in all breadcrumbs

2

Two buttons doing the same thing

3

Why is this using the pussle-piece icon? Its also in Comments/Pages/Tags. Use fa-refresh if this is a refresh button.

4

Why don´t you databind Name with slug and add dash (-) for it? So the following slug would be this-is-some-name

5

What is Source in newsletter? There is nothing corresponding in the grid.

6

Strange Icons when editing Menu´s

7

When creating a sub menu item it doesn´t show up right away. You'll need to reload the page for it to show up.

Yes I thought so. I’m, my self, on the fence with Blazor (to be used for everything) so I will just use it for the backend for me and my tenants to manage things but will use MVC as the public facing front.

So two applications at this point and if/when Blazor SSR will contain all the bits I can considder having one.

P.s Sorry I mixed the SEO bit into this. That was just for the CMS blog part and isnt related to Blazor in any way. 😅 BUT for my idea to work I need that part so I look forware hearing from you.

@enisin

CMS Kit public side is implemented in MVC only because of SEO capabilities. Will you implement this in Blazor server https://github.com/abpframework/abp/issues/18289 (and if now, when?) or is my only change of having one application running using MVC?

Will the new Blazor SSR not have the CMS Kit public side functionality since you plan to add SEO https://github.com/abpframework/abp/issues/16342#issuecomment-1997078207 ? Any eta for it?

I need to know if my only (none Angular/React) option is then to use MVC, if Im starting something new for the next 3 months?

Can you use something from here? https://support.abp.io/qa/questions/6852/3a115e97-a34f-d9c6-6848-7adc94262fc1

Can we get "Add post" in this Blogs dropdown for quickly adding blogs? Less clicking around.

and "Go to post" in the posts

Add "Add blog to menu".. I was trying out various urls to figure out what the url should be

Thanks for the reply. Very informative.

CMS Kit public side is implemented in MVC only because of SEO capabilities.

Will you implement this in Blazor server https://github.com/abpframework/abp/issues/18289 (and if now, when?) or is my only change of having one application running using MVC?

CMS Kit is not designed for this.

Maybe the easier way is to have two applications.. one for my product/landing and one for all the subdomains tenants using the same database. I will explore this a bit further and try out your suggestions.

I´m just trying to figure out how to have the lowest operational cost while not complicating anything. I´m e.g. aiming on using Azure Container Apps (managed kubernetes).

Please add comments to your nuget packages (interfaces if missing). Its super easy https://stackoverflow.com/a/57731750

Currently there are none but I don´t doubt that you have comments on the methods them selfs but having them on the interfaces is also must for better self service

It is almost working but something is off..

I updated my code example with yours.

Am I pulling the correct values? I have connected gg and ss..

Can you check if is there a console error? It seems like it's a text input in your case.

I checked and its not working in Blazor but is working in MVC

The auto only kicks in if I enter the first letter of the blogs name.

p.s Can we do something about the css of the dropdown? It cramped and hard to view...

I implemented this as I understood you guys. I think it would be rather easy to add the users into the dropdown so you would only need one click to switch.

This modal has a button to switch

@using Volo.Abp.Account
@using Volo.Abp.Data
@using Volo.Abp.Domain.Repositories
@using Volo.Abp.Identity
@using Volo.Abp.MultiTenancy
@using Volo.Abp.Users
@inject ICurrentTenant CurrentTenant
@inject ICurrentUser CurrentUser
@inject NavigationManager NavigationManager
@inject IIdentityLinkUserAppService IdentityLinkUserAppService
@inject IJSRuntime JsRuntime

<form method="post" action="Account/LinkLogin" id="LinkLoginForm" hidden>
    <input type="hidden" name="SourceLinkUserId" value="@CurrentUser.Id">
    <input type="hidden" name="SourceLinkTenantId" value="@CurrentTenant.Id">
    <input type="hidden" id="SourceLinkToken" name="SourceLinkToken">
    <input type="hidden" id="TargetLinkUserId" name="TargetLinkUserId">
    <input type="hidden" id="TargetLinkTenantId" name="TargetLinkTenantId">
    <input type="hidden" name="ReturnUrl">
</form>

@if (linkedAccounts != null)
{
    <li class="outer-menu-item" id="MenuItem_LinkedAccounts" @onclick="@ShowModal" style="cursor:pointer;">
        <a class="lpx-menu-item-link">
            <span class="lpx-menu-item-icon">
                <i class="lpx-icon fa fa-exchange-alt" aria-hidden="true"></i>
            </span>
            <span class="lpx-menu-item-text">Switch Account</span>
        </a>
    </li>
}

<Modal @ref="modalRef">
    <ModalContent>
        <ModalHeader>
            <ModalTitle>Switch Account</ModalTitle>
            <CloseButton Clicked="@HideModal" />
        </ModalHeader>
        <ModalBody>
            @if (linkedAccounts == null)
            {
                <Text> Loading... </Text>
            }
            else
            {
                foreach (var account in linkedAccounts)
                {
                    <Button Color="Color.Light" Size="Size.ExtraSmall" Clicked="() => SwitchToAccount(account)">
                        Switch to Tenant: @account.TargetTenantName (user: @account.TargetUserName)
                    </Button>
                }
            }
        </ModalBody>
        <ModalFooter>
            <Button Color="Color.Secondary" Clicked="@HideModal">Close</Button>
        </ModalFooter>
    </ModalContent>
</Modal>

@code {
    private List<LinkUserDto> linkedAccounts = new();

    public LinkedAccountComponent(IRepository<IdentityUser, Guid> userRepository)
    {
        this.userRepository = userRepository;
    }

    private readonly IRepository<IdentityUser, Guid> userRepository;
    private Modal modalRef = new();

    protected override async Task OnInitializedAsync()
    {
        linkedAccounts = (await IdentityLinkUserAppService.GetAllListAsync()).Items.ToList();
    }

    public async Task SwitchToAccount(LinkUserDto linkedAccount)
    {
        // Generating SourceLinkToken
        var sourceLinkToken = await IdentityLinkUserAppService.GenerateLinkLoginTokenAsync();

        await JsRuntime.InvokeVoidAsync("eval", "document.getElementById('SourceLinkToken').value = '" + sourceLinkToken + "'");
        await JsRuntime.InvokeVoidAsync("eval", "document.getElementById('TargetLinkUserId').value = '" + linkedAccount.TargetUserId + "'");
        await JsRuntime.InvokeVoidAsync("eval", "document.getElementById('TargetLinkTenantId').value = '" + linkedAccount.TargetTenantId + "'");
        await JsRuntime.InvokeVoidAsync("eval", "document.getElementById('LinkLoginForm').submit()");

        await HideModal();
    }

    private Task ShowModal()
    {
        return modalRef.Show();
    }

    private Task HideModal()
    {
        return modalRef.Hide();
    }
}

and ConfigureMenuAsync in the IMenuContributor

    public async Task ConfigureMenuAsync(MenuConfigurationContext context)
   {
       if (context.Menu.Name == StandardMenus.Main)
       {
           await ConfigureMainMenuAsync(context);
       }
       else if (context.Menu.Name == StandardMenus.User)
       {
           await ConfigureUserMenuAsync(context);
       }
   }
   
   private async Task ConfigureUserMenuAsync(MenuConfigurationContext context)
   {
       context.Menu.Items.Add(
         new ApplicationMenuItem("LinkedAccounts", "Linked Accounts", "#")
           .UseComponent(typeof(LinkedAccountComponent)));
           
       await Task.CompletedTask.ConfigureAwait(false);
   }

Is this code valid @liangshiwei AND how should you do the actual switching?

Showing 11 to 20 of 174 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 19, 2024, 10:13