Base solution for your next web application

Activities of "rucksackdigital"

Hello,

I used the Power Tools to scaffold out a new entity for storing contact information. One of the fields references the User entity, and is a required relationship. Frontend validation for my other required fields (text inputs) are working properly but I am able to attempt a form save without selecting a user, which throws an exception. I see "required" attributes on the UserId hidden field but since it's hidden it's not triggering validation (and I would want it to show the error under the selector anyways not where the Id is stored in the form). Do I have something configured incorrectly or do I need to add some manual validation in?

I am using the .NET Core with MVC & jQuery project base.

The hangfire configuration documentation link in the Getting Started section appears to be broken:

URL: https://docs.aspnetzero.com/documents/aspnet-core-angular/latest/Hangfire Reference page: https://docs.aspnetzero.com/documents/aspnet-core-angular/latest/Getting-Started-Angular

In the Core+Angular solution, the footer in Theme 12 is hidden behind the sidebar nav. Screenshot below. Note that if you make the footer fixed the problem is resolved.

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))

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?

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,

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?

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.

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;

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?

Showing 1 to 10 of 13 entries