Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "codenewa"

I've a project based on Asp.NET Core + Angular 2 project.

I want to add the user session timeout control mentioned here: <a class="postlink" href="http://keenthemes.com/preview/metronic/theme/admin_4_material_design/ui_session_timeout.html">http://keenthemes.com/preview/metronic/ ... meout.html</a>

If I set the tokenAuthConfig i nthe Web.Core project's WebCoreModule.cs to set the expiration to a value which also drives the above plugin, how do i configure the stay alive url so that a new token can be generated?

Hi,

I'm looking at the unit test: AuditLogAppService_Test. Should_Get_Audit_Logs()

Here, we setup the Arrange part by Adding some values to the AuditLogs table and then calling the service in the act step.

I followed the same step to test my own app service. However, I got the DbContext disposed exception. I followed through other discussions here and was able to get the tests to work by starting a unit of work.

How is it working in the AuditLogAppService_Test?

Hello,

We had the Asp.NET Core + Angular 2 version of the the boilerplate with the .xproj structure. We update the solution to VS2017 which used the csproj structure. We also upgraded from Angular 2 to Angular 4.

But now, the localized strings from the Project.Core\Localization*.xml are not working.

I saw a suggestion in one of the older posts to make sure that the xml files are embedded resources. I've verified that as well.

Currently, the Abp assemblies are at version 2.0.2.

Please help.

From the documentation, it seems that the background jobs are retried for up to 2 days which is the default timeout.

  1. Is there a way to cancel the job in case of exceptions?
  2. How do I get the identifier for the current BackgroundJob<TJobArgs> which is being executed?
  3. Also, how can I push the exceptions from a background job into the audit logs?

In my application, I have two entities Attribute and Package which have a many to many relationship. So, I have a PacakgeAttribute entity which is a FullAuditedEntity

public class PackageAttribute: FullAuditedEntity{
...
}

public class Package: FullAuditedEntity{
  public IList<PackageAttribute> PackageAttributes{get;set;}
}

In this code, I cannot remove a PackageAttribute by doing:

package.Attribute.Remove(packageAttribute);
pacakgeRepository.UpdateAsync(package)

This throws error:

The relationship could not be changed because one or more of the foreign-key properties is non-nullable. When a change is made to a relationship, the related foreign-key property is set to a null value. If the foreign-key does not support null values, a new relationship must be defined, the foreign-key property must be assigned another non-null value, or the unrelated object must be deleted.

However, I cannot make the relationship an identifying relationship, as it is a soft delete.

I tried including the Id as a part of the composite key but the database does not set the id column as an identity column. (Could this be an issue?)

So, I ended up using IRepository<PackageAttribute> to remove the packageAttribute by calling DeleteAsync() method.

Am I missing something? Or, is this how it is supposed to be done?

I have an entity Location which is associated to the Tenant entity via association class TenantLocation. I need to track changes to TenantLocation, so I have set it to inherit from FullAuditedEntity.

Tenant has a property IList<TenantLocation> TenantLocations.

<ins>Issue 1</ins>: When I add a TenantLocation, the CreatorId is not populated for the TenantLocation Record.

<ins>Issue 2</ins>: Unless I go through a IRepository<TenantLocation>, I cannot remove a tenant location. When I attempt that I get an error: <span style="color:#FF0000">"The operation failed: The relationship could not be changed because one or more of the foreign-key properties is non-nullable. When a change is made to a relationship, the related foreign-key property is set to a null value. If the foreign-key does not support null values, a new relationship must be defined, the foreign-key property must be assigned another non-null value, or the unrelated object must be deleted."</span>. Seems like I have to update the Association record one by one. So, when I use the repository, the error goes away but it does not populate DeleterUserId.

I'm currently working on a multi-tenant application where the host admin can create data that can be consumed by the users in the tenants. However, the data created by the tenants would not be available to other tenants.

I think that the IMayHaveTenant interface can be used to make allow the data created by the host to be consumed by the tenants. Is that correct?

Thank you for the guidance.

Is it possible to set the tenantId after the user has logged in?

I have deployed the angular 2 app to my test environment. But I'm getting js errors after deployment.

This is what I see on Chrome console when I load the application.

JQMIGRATE: Migrate is installed, version 3.0.0
inline.1523ecb….bundle.js:1 Uncaught TypeError: Cannot read property 'call' of undefined
    at r (inline.1523ecb….bundle.js:1)
    at Object.542 (main.da73a68….bundle.js:9)
    at r (inline.1523ecb….bundle.js:1)
    at Object.707 (main.da73a68….bundle.js:11)
    at r (inline.1523ecb….bundle.js:1)
    at Object.1195 (main.da73a68….bundle.js:1)
    at r (inline.1523ecb….bundle.js:1)
    at window.webpackJsonp (inline.1523ecb….bundle.js:1)
    at main.da73a68….bundle.js:1

A similar error occurred a couple of days of ago but it went away after I rebuilt the angular app a couple of times. From my build logs, I am seeing the following warnings when yarn is installing the dependencies.

yarn -v
yarn install v0.20.3
[1/4] Resolving packages...
[2/4] Fetching packages...
warning [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "@ngtools/[email protected]" has unmet peer dependency "@angular/tsc-wrapped@^0.5.0".
[4/4] Building fresh packages...
Done in 63.21s.
yarn
yarn install v0.20.3
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.86s.
npm run build2prod
> [email protected] build2prod C:\projects\iemergent-mms-hblv0\angular
> ng build -prod
  0% compilin

However, I don't see any difference in the warnings between a working build and the current failing build.

I currently use appveyor to run the build. Node version is 6.10.0 Yarn version is 0.20.3

I know that this is not a lot to start with. Please let me know if you need any more info.

Hello,

I created my first service without any hiccups. But when working on the second service, I'm getting issues with the POST methods. Service Method:

[AbpAuthorize(AppPermissions.Pages_Administration_Tenant_AttributeSettings)]
    public class AttributesAppService : MMSAppServiceBase, IAttributesAppService
    {
...
[AbpAuthorize(AppPermissions.Pages_Administration_Tenant_AttributeSettings_Create_Update)]
        public async Task SaveAttributeSettings(SaveAttributeSettingInput input)
        {
            var attributeValue = input.MapTo<Attribute>();
            attributeValue.TenantId = AbpSession.TenantId;
            if (input.Id == 0)
...

Service-proxies.ts

/**
     * @return Success
     */
    saveAttributeSettings(input: SaveAttributeSettingInput): Observable<void> {
        let url_ = this.baseUrl + "/api/services/app/Attributes/SaveAttributeSettings";

        const content_ = JSON.stringify(input ? input.toJS() : null);
        
        return this.http.request(url_, {
            body: content_,
            method: "post",
            headers: new Headers({
                "Content-Type": "application/json; charset=UTF-8", 
				"Accept": "application/json; charset=UTF-8"
            })
        }).map((response) => {
...

component.ts

...
   save(): void {
        this.saving = true;
        this._svc.saveAttributeSettings(**this.attr**)
            .finally(() => this.saving = false)
            .subscribe(() => {
                this.notify.info('Saved Successfully');
                this.close();
                this.modalSave.emit(this.attr);
            });
    }
...

But when it runs it gives me the following error:

{result: null, targetUrl: null, success: false,…}
__abp
:
true
error
:
{code: 0, message: "Your request is not valid!",…}
code
:
0
details
:
"The following errors were detected during validation.
↵ - input is null!
↵"
message
:
"Your request is not valid!"
validationErrors
:
[{message: "input is null!", members: ["input"]}]
0
:
{message: "input is null!", members: ["input"]}
members
:
["input"]
message
:
"input is null!"
result
:
null
success
:
false
targetUrl
:
null
unAuthorizedRequest
:
false

Thank you for your help.

Showing 1 to 10 of 10 entries