/// <reference path="../../../../pnut/core/ViewModelBase.ts" />
/// <reference path="../../../../pnut/js/USDollars.ts" />
/// <reference path='../../../../typings/knockout/knockout.d.ts' />
/// <reference path='../../../../pnut/core/peanut.d.ts' />
// for registration components
/// <reference path='../vm/Registration.d.ts' />
// Other common refeences
/// <reference path='../../../../pnut/js/searchListObservable.ts' />
///<reference path="../../../../pnut/js/selectListObservable.ts"/>
/// <reference path='../../../../typings/jqueryui/jqueryui.d.ts' />
/// <reference path='../../../../pnut/js/ViewModelHelpers.ts' />
namespace QnutYearlymeeting {
private application:Peanut.IPeanutClient;
private owner : Peanut.IEventSubscriber;
private services: Peanut.ServiceBroker;
// for View models remove contructions and put anything required in Init()
// for components
public constructor(owner: Peanut.ViewModelBase = null)
{
// for reports: public constructor(owner: IReportOwner, name: string) {
var me = this;
me.application = owner.getApplication();
me.services = owner.getServiceBroker();
me.owner = <Peanut.IEventSubscriber>owner;
// reports only
// me.reportName = name;
}
}
public constructor(owner: IReportOwner, name: string)
{
let me = this;
me.application = owner.getApplication();
me.services = owner.getServiceBroker();
me.owner = owner;
me.reportName = name;
}
In view model: Remove constructor, move anything usefull to init()
Add ",me" argument to calls to bindSection, bindNode
Remove ".applicaion" from showDefaultSection.
Remove "applicationPath: string," from init()
remove me.application.initialize(applicationPath, function() { and move interal code up.
replace
peanut.executeService('registration
With
services.executeService('peanut.QnutYearlymeeting::registration
Replace 'var ' with 'let '
Prefix with Peanut.
to any component name referenced in attachComponent or loadComponent, prefix with:
@pkg/qnut-yearlymeeting/
**replace bindComponent with attachComponet per example:
if (me.COMPONENTINSTANACE) {
// same code as in the final block below
}
else {
me.application.attachComponent(
'@pkg/qnut-yearlymeeting/COMPONENTNAME',
// component factory function
(returnFuncton: (vm: any) => void) => {
me.application.loadComponents('@pkg/qnut-yearlymeeting/COMPONENTNAME',() => {
me.VMINSTANCE = new COMPONENTCLASS(me, true);
returnFuncton(me.VMINSTANCE);
});
},
() => {
me.VMINSTANCE.initialize(function() {
// same code as top block
});
}
);
}
Replace "Tops." with "Peanut."
Convert underscore/lodash calls
showRpt{reportName}
GetReportDataCommand:
Forms and Tables
Replace bootstrap display classes:
<TITLE GOES HERE!>
<button type="button" class="close btn-close"
data-bs-dismiss="modal"
aria-label="Close">
</button>
<div class="modal-dialog modal-lg" >
<select class="form-select">
<div class='form-group mb-3'>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="checkboxfield">
<label class="form-check-label" for="checkboxfield">
Checkbox label
</label>
</div>
glyphicon glyphicon-remove
far fa-trash-alt
glyphicon glyphicon-info-sign
fas fa-info-circle
glyphicon glyphicon-refresh
fas fa-sync
glyphicon glyphicon-spin
fas fa-spinner
glyphicon glyphicon-search
fas fa-search
glyphicon glyphicon-backward
fas fa-arrow-left
glyphicon glyphicon-forward
fas fa-arrow-right
glyphicon glyphicon-exclamation-sign
fas fa-exclamation-circle
glyphicon glyphicon-plus
fas fa-plus-circle
glyphicon glyphicon-question-sign
fas fa-question-circle
glyphicon glyphicon-pencil
fas fa-pencil-alt
glyphicon glyphicon-bed
fas fa-bed
glyphicon glyphicon-send
far fa-paper-plane
glyphicon glyphicon-edit
far fa-edit
<i class="fas fa-cash-register"></i>
_.filter(list,function (...)
list.filter(function (...)
_.sortBy(list,propertyname);
Peanut.Helper.SortByAlpha(list,propertyname); // case insensitied
Peanut.Helper.SortByInt(list,propertyname); // whole number values
Peanut.Helper.SortBy(list,propertyname); // conversions or case don't matter
_.find(list, function(item: any) {...});
list.find(function(item: any) {...});
data-bind="css: { 'col-6': showAttending,'col-12' : !showAttending() }