Base solution for your next web application
Open Closed

How to clear the selected app logo #11428


0
hongbing.wang created

In downloaded ASP.NET Zero 12.0, Angular tenant-settings.component.ts: clearLogo(): void { this._tenantSettingsService.clearLogo().subscribe(() => { this.appSession.tenant.lightLogoFileType = null; this.appSession.tenant.lightLogoId = null; this.appSession.tenant.darkLogoFileType = null; this.appSession.tenant.darkLogoId = null; this.notify.info(this.l('ClearedSuccessfully')); }); }

In TenantSettingsAppService.cs public async Task ClearLogo() { var tenant = await GetCurrentTenantAsync();

        if (!tenant.HasLogo())
        {
            return;
        }

        var logoObject = await _binaryObjectManager.GetOrNullAsync(tenant.DarkLogoId.Value);
        if (logoObject != null)
        {
            await _binaryObjectManager.DeleteAsync(tenant.DarkLogoId.Value);
        }

        tenant.ClearLogo();
    }

In Tenant.cs public void ClearLogo() { DarkLogoId = null; DarkLogoFileType = null; }

It seems the code doesn’t clear the selected logo. It only clears dark logo. Why? On the page, it appears both dark and clear logos are cleared (as per angular client code). Press Save All and reload the page, light logo is displayed in all the three locations. Please see the attached screenshot.

Please advise how this should work.


5 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi,

    Thanks, I have reproduced the problem. Please follow https://github.com/aspnetboilerplate/aspnetboilerplate/issues/6630

  • 0
    hongbing.wang created

    @ismcagdas Thank you.

    Can you please also check the following:

    1. Upload a logo, the top left corner logo is not updated. In the past, developer tool shows the following under Network tab: /TenantCustomization/UploadLogo /TenantCustomization/GetLogo?tenantId=1 /TenantCustomization/GetTenantLogo?skin=light&tenantId=1&id=aa5e5927-7254-26cb-9500-3a08dfc0df2b /assets/common/images/transparent_background.png

    But after upgrading to Zero 12.0, I only got /TenantCustomization/UploadLightLogo when I upload a light logo, so the top left corner logo is not updated. Is this a bug or did I miss something?

    1. Clear Logo, the top left corner logo shows the default one. This may be OK. api/services/app/TenantSettings/ClearLogo assets/common/images/app-logo-on-light.svg

    But after upgrading to Zero 12.0, I only have api/services/app/TenantSettings/ClearLogo, the top left corner logo still shows the default one. This seems acceptable.

  • 0
    ismcagdas created
    Support Team

    Hi @hongbing.wang

    Thanks, I will also check this.

  • 0
    hongbing.wang created

    @ismcagdas Thank you. I can reproduce the above-mentioned issue with your sample code. Please investigate it.

  • 0
    ismcagdas created
    Support Team

    Hi,

    Yes, we also reproduced this problem and will fix it.