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

Activities of "BobIngham"

Hi Vlad, It seems we are on similar paths! Add the settings during initialisation using the instructions above and then allow your tenant to change them by adding an extra tab in tenant-settings.component.html. For example I have three settings, registration code for devices (we have spoken about this privately), and data provider name and api (I allow a tenants to load and save data to a third-party system). To facilitate tenant changes to these values I use the following code:

<tab *ngIf="true" heading="YourCompanyName" customClass="m-tabs__item">
    
    <h5>{{l("Devices")}}</h5>
    <div class="form-group">
        <label>{{l("RegistrationCode")}}</label>
        <input type="text" #registrationCode="ngModel" name="registrationCode" class="form-control" [ngClass]="{'edited':settings.nuage.registrationCode}" [(ngModel)]="settings.nuage.registrationCode"
            maxlength="6" minlength="4" pattern="[A-Za-z0-9]+" required>
        <div [hidden]="registrationCode.valid || registrationCode.pristine"  class="m-form__help m--font-danger">
            <div [hidden]="!registrationCode.hasError('required')">{{l("RequiredField", l('RegistrationCode'))}}</div>
            <div [hidden]="!registrationCode.hasError('pattern')">{{l("OnlyCharactersAndNumbersAllowed")}}</div>
            <div [hidden]="!registrationCode.hasError('minlength') && !registrationCode.hasError('maxlength')">{{l("StringLengthDoesntMatch", l('RegistrationCode'), "4", "6")}}</div>
        </div>
    </div>
    <h5>{{l("DataProviders")}}</h5>
    <div class="form-group">
        <label>{{l("DataProvider")}}</label>
        <input readonly type="text" name="dataProvider" class="form-control" [ngClass]="{'edited':settings.nuage.dataProvider}"
            [(ngModel)]="settings.nuage.dataProvider" maxlength="256">
    </div>
    <div class="form-group">
        <label>{{l("DataProviderApiUrl")}}</label>
        <input type="text" name="dataProviderApiUrl" class="form-control" [ngClass]="{'edited':settings.nuage.dataProviderApiUrl}"
            [(ngModel)]="settings.nuage.dataProviderApiUrl" maxlength="256">
    </div>
</tab>

Hope this helps.

@vlad, try this:

{  
    "version": "0.2.0",  
    "configurations": [{  
        "name": "Launch Chrome against localhost",  
        "type": "chrome",  
        "request": "launch",  
        "url": "http://localhost:4200",  
        "sourceMaps": true,  
        "webRoot": "${workspaceRoot}",  
        "sourceMapPathOverrides": {  
            "webpack:///./*": "${workspaceRoot}/*"  
        }  
    }]  
}

There are plenty of other examples, the key is to first add the Chrome extension to VSCode.

Yep, I'm one for source code as well. In my case I don't like the Angular templates produced because I am not a fan of using modals for CRUD operations. Call me old school but I like the idea of an index page for a grid (DevExpress, NgPrime or Kendo) with delete functionality and separate pages for create, read and update. Here is my template for the index page:

<div [@routerTransition]>
  <div class="m-content">
    <app-person-list *ngIf="isList" (notifyEdit)="onEditButtonSelected($event)" (notifyCreate)="onCreateButtonSelected($event)" (notifyView)="onViewButtonSelected($event)"></app-person-list>
    <app-create-person *ngIf="isCreate" (notifyCreateSaved)="displayList($event)" (notifyCreateClose)="displayList($event)"></app-create-person>
    <app-edit-person *ngIf="isEdit" (notifyEditSaved)="displayList($event)" (notifyEditClose)="displayList($event)" [person]="person"></app-edit-person>
    <app-view-person *ngIf="isView" (notifyViewClose)="displayList($event)" [person]="person"></app-view-person>
  </div>
</div>

In addition I prefer the Reactive approach for forms instead of the template system used by the RAD tool, not least for in-line error checking. Now, it would be great if I could cut into your code (I presume you're using T4) and produce what I wanted for the client rather than the tedious and error-prone job of deleting, cutting and pasting.... Having said that, it's an awesome tool and at least saves a lot of time in the core. AWESOME JOB BOYS!!!!

Answer

@ismcagdas, that's a shame. I was hoping to extend the usage of settings to reduce the number of extensibility points for upgrades. That is to say, my aim is to use existing Zero functionality wherever possible as opposed to extending entities. This means that when it comes to upgrading I can merge my code and make as few changes to the Zero system as possible. This applies both to the core and to angular, in the latter I have created my own module which is lazy loaded.

@Aaron, another one of life's little mysteries solved, once again I am in debt to your expertise. An excellent piece of code, well done!!!! This alone is worth the upgrade to 5.1.0, I will wait with baited breath for the user interface... Thank you again for your help.

Doh! @brandonmurphy - exactly what I was looking for, I was looking in a previous development database, thanks for casting light on the error of my ways!

@alexanderpilhar I am also interested in your approach. We are building an app using Ionic and I'm sure this would benefit from a cut down version of the Angular project. Please do share your findings and good luck!!!!

@vladsd Try using Visual Code and implement the Chrome debugging extension and add a configuration to launch.json (google it). I am also a VS2017 user but I find debugging simultaneously in Code and VS2017 works quite well.

I'm with you. Better information on features and editions. We modified them to limit the number of devices registered with the system. If you want the code and procedure let me know.

See: [https://github.com/aspnetzero/aspnet-zero-core/issues/706#event-1406083638])

Showing 451 to 460 of 477 entries