Base solution for your next web application

Activities of "michaelhilgers"

Answer

Hi,

I got the same problem.

Do you have a solution for it ?

Thanks !

Hi,

My tsconfig.json looks like this :

{
  "compileOnSave": false,
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc-e2e",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ]
  }
}

But event if I replace my config with the suggested config it doesn't work.

Hi

i have the same problem, <a class="postlink" href="https://pm.ligna-systems.com/account/login">https://pm.ligna-systems.com/account/login</a>

have you any idea how i can fix it?

Thanks

Answer

Hi,

I found a solution for client site caching if someone look for it :

<a class="postlink" href="https://github.com/Jackson88/ng2-cache">https://github.com/Jackson88/ng2-cache</a>

Hi,

I'm using Abp 1.5.0 with angular2 and Asp.net core. My appconfig.json looks like: { "remoteServiceBaseUrl": "https://pm-host.mydomain.com", "appBaseUrl": "https://pm-{TENANCY_NAME}.mydomain.com" }

My appsettings.json looks like :

"App":{ "WebSiteRootAddress": "https://pm-{TENANCY_NAME}.mydomain.com/", "CorsOrigins": "https://pm-tenant1.mydomain.com,https://pm-tenant2.mydomain.com }

I changed the AppPreBootstrap function to avoid the <a class="postlink" href="https://pm-null.mydomain.com">https://pm-null.mydomain.com</a> as follow

let subdomainTenancyNameFinder = new SubdomainTenancyNameFinder();
            console.log('1. appBaseUrl : ' + result.appBaseUrl);
            var tenancyName = subdomainTenancyNameFinder.getCurrentTenancyNameOrNull(result.appBaseUrl);
            console.log('2. tenancyName : ' + tenancyName);
            AppConsts.remoteServiceBaseUrl = result.remoteServiceBaseUrl.replace(AppConsts.tenancyNamePlaceHolderInUrl, tenancyName);

            AppConsts.appBaseUrlFormat = result.appBaseUrl;
            AppConsts.remoteServiceBaseUrlFormat = result.remoteServiceBaseUrl;

            if (tenancyName == null) {
                AppConsts.appBaseUrl = result.appBaseUrl.replace('-' + AppConsts.tenancyNamePlaceHolderInUrl, "");
            } else {
                AppConsts.appBaseUrl = result.appBaseUrl.replace(AppConsts.tenancyNamePlaceHolderInUrl, tenancyName);
            }

To show the tenancy name I wrote the consol.log in the preBootstrap function and I could see that the tenancy name was correct but the application didn't change the tenant.

I'm always logged in as host tenant.

Any suggestions ?

Answer

Hi,

I created a modal 'workModal' that contains list of details => "workDetails". In the workModal I have a foreach loop for the workDetails and inside the foreach loop I have a component to show the informations

// inside the 'workModal'
 <div class="panel panel-default" *ngFor="let arbeitszeitDetail of workDetails; let index = index;let first = first;let last = last;">
          <createUpdateWorkDetail [userId]="currentUser.id" [arbeitszeitDetail]="arbeitszeitDetail"  
(arbeitszeitDetailDelete)="deleteArbeitszeitDetail($event);" 
                                   (arbeitszeitDetailChanged)="validateUserInput($event, index);" [index]="index" [first]="first" [last]="last"></createUpdateWorkDetail>
</div>

In the <createUpdateWorkDetail > Component, are other custom components and these components call the server to get datas from the db and these datas I would like caching for some minutes.

Is it possible ?

Hi,

I added the CorsOrigins to the appsettings, but I need also to apply the following changes

<a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/76">https://github.com/aspnetzero/aspnet-ze ... /issues/76</a>

After I did this change It works but I can't use my Tenancy_Name placeholder in the CorsOrigins property so I have to add every subdomain in the corsorigings property.

"App": {
    "WebSiteRootAddress": "https://pm-{TENANCY_NAME}.myDomain.com/",
    "CorsOrigins": "https://pm-Tenancy1.myDomain.com,https://pm-Tenancy2.myDomain.com,https://pm-Tenancy3.myDomain.com,https://pm.myDomain.com,https://pm-host.myDomain.com"
  },

And finally it work.

Thank you very much for your help ! :)

Hi,

Have you got some example for an configuration in the appsettings ? I don't have any experience with cors.

Thanks !

Hi,

I tried to configure cors on the web config. I removed the '*' in the CORS settings from azure so there isn't any configuration. I changed the web.config and now I get the following error :

XMLHttpRequest cannot load <a class="postlink" href="https://pm-host.ligna-systems.com/signalr/negotiate?clientProtocol=1.5&enc_">https://pm-host.ligna-systems.com/signa ... l=1.5&enc_</a>…22abpcommonhub%22%7D%2C%7B%22name%22%3A%22chathub%22%7D%5D&_=1496148093643. The 'Access-Control-Allow-Origin' header contains multiple values 'https://pm-parts.ligna-systems.com, *', but only one is allowed. Origin 'https://pm-parts.ligna-systems.com' is therefore not allowed access.

This is my current web.config File, I put '*' on the 'Access-Control-Allow-Origin' property

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  
  <system.webServer>
    
    <rewrite>
      <rules>
        <rule name="Force HTTPS" enabled="true">
          <match url="(.*)" ignoreCase="false" />
          <conditions>
            <add input="{HTTPS}" pattern="off" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
        </rule>
      </rules>
    </rewrite>
    
    <httpProtocol>
         <customHeaders>
            <add name="Access-Control-Allow-Origin" value="*" />
            <add name="Access-Control-Allow-Methods" value="GET, PUT, POST, DELETE, HEAD, OPTIONS" />
            <add name="Access-Control-Allow-Credentials" value="true"/>
            <add name="Access-Control-Allow-Headers" value="X-Requested-With, origin, content-type, accept, Abp.TenantId, Authorization" />
         </customHeaders>
      </httpProtocol>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath=".\LignaSystems.PM.Web.Host.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="false" />
    <modules>
      <remove name="WebDAVModule" />
    </modules>
  </system.webServer>
</configuration>

Hi,

Yes it works ! Thanks :D

But I have to put the whole jQuery Code inside the onShow()-Methode

onShown(): void { $(this.nameInput.nativeElement).focus();

    $('.date').datepicker({
        weekStart: 1,
        format: "dd/mm/yyyy",
        todayHighlight: true,
        todayBtn: "linked"
    });

    $('#datumArbeitsverhaeltnisBeginn').datepicker().on("changeDate", e => {
        let day = e.date.getDate();
        let month = e.date.getMonth();
        let year = e.date.getFullYear();

        if (day > 0 && month > 0 && month &lt; 13 &amp;&amp; year &gt; 1000) {
            let d = new Date(Date.UTC(year, month, day));
            this.newMitarbeiter.datumArbeitsverhaeltnisBeginn = moment(d);
        }
    });

    $('#datumArbeitsverhaeltnisEnde').datepicker().on("changeDate", e => {
        let day = e.date.getDate();
        let month = e.date.getMonth();
        let year = e.date.getFullYear();

        if (day > 0 && month > 0 && month &lt; 13 &amp;&amp; year &gt; 1000) {
            let d = new Date(Date.UTC(year, month, day));
            this.newMitarbeiter.datumArbeitsverhaeltnisEnde = moment(d);
        }
    });
}
Showing 1 to 10 of 25 entries