Base solution for your next web application

Activities of "rucksackdigital"

Question

Hello,

I have a few core modifications I think would be beneficial to added to ANZ. Can I submit these in gitbhub via a PR? They can be used or not, just figured I would provide them.

Running Angular w/ aspnetCore, 10.5.0

I'm having difficulties trying to add a simple modal component into the sub-header module; it seems wherever I make the declaration for my modal module, it's inaccessible to the sub-header. The modal just a trimmed-down version of most of the ModalComponents, showing only a title and localized text string that are passed in.

When I place in any admin/main page's module and call, everything works as expected. It's only in the sub-header where I get the 'Cant bind to X since it isn't a known property'. I am probably missing something incredibly simple...

import { Component, Injector, ViewChild } from '@angular/core';
import { AppComponentBase } from '@shared/common/app-component-base';
import { ModalDirective } from 'ngx-bootstrap/modal';
import { merge as _merge } from 'lodash-es';


@Component({
    selector: 'simpleInfoModal',
    templateUrl: './simple-info-modal.component.html',
})
export class SimpleInfoModalComponent extends AppComponentBase {

    helpText: string;
    modalTitle: string = 'Info';

    @ViewChild('modal', { static: true }) modal: ModalDirective;
    
    constructor(injector: Injector) {
        super(injector);
    }


    show(helpText:string, modalTitle?:string): void {

        this.helpText = helpText;
        if(modalTitle)
            this.modalTitle = modalTitle;

        this.modal.show();
    }

   

    close(): void {
        this.modal.hide();
    }
}

pre-reqs -- v10.5.0, Angular with .net Core.

Was wondering if there was an ETA for power tools VS2022 support?

Hello,

  • V7.3.1
  • MVC
  • .NET Core

I'm running into an issue with my background workers; I have a job set up to run every 5 minutes, which calls a domain service to process some data. My domain service is calling await SettingManager.GetSettingValueForApplicationAsync() to retrieve a application-level setting value.

What seems to be happening is, when I change this value through the web interface, my domain service still receives the old value. I have tried going through maintenance to flush the caches manually, but the old value is still received until I shutdown and restart the application in IIS.

Has anyone run into an issue similar to this?

Hi all,

Running v7.0.0 MVC/jQuery build.

When running through VS in IISExpress, UserFriendlyExceptions are being returned correctly. When publishing to IIS, I'm getting back the generic "Error detail not sent by Server" message. I've all setting values for <customErrors mode="xyz" />, as mentioned in other posts, as well as setting my ASPNETCORE_ENVIRONMENT environment variable, to no avail. I'm sure this is just a configuration setting as it's fine under localhost. What am I missing? I should mention I've published in debug mode, not release.

The correct response from localhost build:

{"result":null,"targetUrl":null,"success":false,"error":{"code":0,"message":"Error Message Here","details":null,"validationErrors":null},"unAuthorizedRequest":false,"__abp":true}

Response from published build:

The page cannot be displayed because an internal server error has occurred.

I have also tried setting

Configuration.Modules.AbpWebCommon().SendAllExceptionsToClients = true;

Running power tools 2.0.4 with aspnetzero 7.0.0.0 on MVC/Jquery build. Every time I run the RAD tool to scaffold out a new entity, the UI sorting is broken. It appears the tool is adding the entity type name onto the output (see screenshot 2). I've been going in and manually removing this but it's a bit frustrating and time consuming. Am I doing something wrong or is this something others have run into?

I should mention that I also have v1.9.2.2 of the RAD tool installed as I support a client on 6x, but it is disabled via VS Extensions.

Hello,

Running v7.0.0 with MVC/jQuery stack. I'm running into an odd issue that I can't seem to track down.

What's happening is:

  • I've modified some of my edit modals to have multiple tabs, allowing better organization of information being edited. modals have standard .modal-body
  • Inside of my modal body I have a tab panel with standard class=tabbable-line, ul.nav-tabs, and div.tab-panes
  • Whenever I switch tabs, the service tied to the dataTable population on the main page is triggered.

I've tried tracking this down but haven't had success yet. Has anyone else experienced this behavior?

Hello,

running v7.0 with MVC/jQuery. I've read through the ABP docs on exception handling and understand the basic premise but am struggling to find a solution to effectively showing errors other than the standard "An Internal Error Has Occurred."

As an example scenario, if I use the RadTool to scaffold a new entity, FooBar, with the following methods in my Application Service:

          [AbpAuthorize(AppPermissions.Pages_FooBars_Edit)]
		 private async Task Update(CreateOrEditFooBarDto input)
         {
            throw new UserFriendlyException("This is an Update Exception");
            var fooBar = await _fooBarRepository.FirstOrDefaultAsync((int)input.Id);
             ObjectMapper.Map(input, fooBar);
         }
         
          [AbpAuthorize(AppPermissions.Pages_FooBars_Create)]
		 private async Task Create(CreateOrEditFooBarDto input)
         {
            throw new UserFriendlyException("This is a test exception");
            var fooBar = ObjectMapper.Map<FooBar>(input);

			
			if (AbpSession.TenantId != null)
			{
				fooBar.TenantId = (int?) AbpSession.TenantId;
			}
		

            await _fooBarRepository.InsertAsync(fooBar);
         }

		 [AbpAuthorize(AppPermissions.Pages_FooBars_Delete)]
         public async Task Delete(EntityDto input)
         {
            throw new UserFriendlyException("This is a Deletion Exception");
            await _fooBarRepository.DeleteAsync(input.Id);
         } 
         
         [AbpAuthorize(AppPermissions.Pages_FooBars_Edit)]
		 public async Task<GetFooBarForEditOutput> GetFooBarForEdit(EntityDto input)
         {
            throw new UserFriendlyException("This is an Edit Exception");
            var fooBar = await _fooBarRepository.FirstOrDefaultAsync(input.Id);
           
		    var output = new GetFooBarForEditOutput {FooBar = ObjectMapper.Map<CreateOrEditFooBarDto>(fooBar)};
			
            return output;
         }

A sample snippet from the js:

{
                            text: app.localize('Edit'),
                            visible: function () {
                                return _permissions.edit;
                            },
                            action: function (data) {
                                _createOrEditModal.open({ id: data.record.fooBar.id });
                            }
                        }, 
						{
                            text: app.localize('Delete'),
                            visible: function () {
                                return _permissions.delete;
                            },
                            action: function (data) {
                                deleteFooBar(data.record.fooBar);
                            }
                        }]

Any service calls that return ajax, work as expected; attempting to Delete, Update, or Create shows my user-friendly error message, as expected. Calls that expect a View or a PartialView, such as _createOrEditModal.open({ id: data.record.fooBar.id }); return the generic "internal error" message.

So, is there a built-in way to catch UserFriendlyExceptions in this manner? I'm not sure if the framework supports returning either json or text/html, and if the modal manager is capable of catching that.

Or - is it something where I need to have a separate service I call before opening the modal, to perform whatever pre-edit validations I am looking to perform?

Hello,

I've built out a new entity that extends the OrganizationUnit with a new field, and some additional new table as references. Everything is working smoothly, however I'd like to enforce tenantId requirements on my entity with IMustHaveTenant. The issue I'm running is when running add-migration, VS insists on trying to add tenantId to the abporganizationunits table, even though it's already there. I've tried adding [NotMapped] annotation to the tenantID in my class but that doesnt' seem to work.

Is there a way to do this that I'm missing, or should I just add checks for tenantId.HasValue in my domain service (which is what I'm doing now), before progressing with business logic?

ASP.NET Core w/ Angular project base, out-of-box validation for input types does not appear to be functioning correctly.

Example: AppFeatures.MaxContactCount, inputType: new SingleLineStringInputType(new NumericValueValidator(0, int.MaxValue))

Showing 1 to 10 of 13 entries