Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 7df5134

Browse files
committed
Added a bootstrapper for the ng2 message log
Gives us a place to test it.
1 parent 2360998 commit 7df5134

9 files changed

+90
-7
lines changed

bootstrapper/app.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<li><a routerLink="/tabs/ng2">Tabs</a></li>
1010
<li><a routerLink="/msi/ng2">Multi Step Indicator</a></li>
1111
<li><a routerLink="/forms/ng2">Forms</a></li>
12-
<li><a routerLink="/messageLog">Message log</a></li>
12+
<li><a routerLink="/messageLog/ng2">Message log</a></li>
1313
<li><a routerLink="/misc/ng2">Misc</a></li>
1414
</ul>
1515
</div>

bootstrapper/app.routing.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ import { MsiBootstrapperComponent } from './msi/msiBootstrapper.ng2';
2222
import { FormsRootComponent } from './forms/formsRoot';
2323
import { FormsNg1BootstrapperComponent } from './forms/formsBootstrapper';
2424
import { FormsBootstrapper } from './forms/formsNg2Bootstrapper';
25-
import { MessageLogNg1BootstrapperComponent } from './messageLog/messageLogBootstrapper';
25+
import { MessageLogNg1BootstrapperComponent } from './messageLog/messageLogNg1Bootstrapper';
26+
import { MessageLogNg2BootstrapperComponent } from './messageLog/messageLogNg2Bootstrapper';
27+
import { MessageLogRootComponent } from './messageLog/messageLogRoot';
2628
import { MiscRootComponent } from './misc/miscRoot';
2729
import { MiscNgContextBootstrapper } from './misc/miscNg2Context';
2830
import { MiscNg1BootstrapperComponent, MiscNg2BootstrapperComponent } from './misc/miscBootstrapper';
@@ -86,7 +88,11 @@ const appRoutes: Routes = [
8688
},
8789
{
8890
path: 'messageLog',
89-
component: MessageLogNg1BootstrapperComponent,
91+
component: MessageLogRootComponent,
92+
children: [
93+
{ path: 'ng1', component: MessageLogNg1BootstrapperComponent },
94+
{ path: 'ng2', component: MessageLogNg2BootstrapperComponent },
95+
],
9096
},
9197
{
9298
path: 'misc',

bootstrapper/app.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import * as componentsDowngrade from '../source/componentsDowngrade';
1414
import { moduleName as inputModuleName } from './inputs/inputBootstrapper';
1515
import { moduleName as buttonModuleName } from './buttons/buttonBootstrapper';
1616
import { moduleName as popupModuleName } from './popup/popupBootstrapper';
17-
import { moduleName as messageLogModuleName } from './messageLog/messageLogBootstrapper';
17+
import { moduleName as messageLogModuleName } from './messageLog/messageLogNg1Bootstrapper';
1818
import { moduleName as cardModuleName } from './cards/cardContainerBootstrapper';
1919
import { moduleName as tabModuleName } from './tabs/tabsBootstrapper';
2020
import { moduleName as formModuleName } from './forms/formsBootstrapper';
@@ -42,7 +42,9 @@ import { MsiBootstrapperComponent } from './msi/msiBootstrapper.ng2';
4242
import { FormsRootComponent } from './forms/formsRoot';
4343
import { FormsNg1BootstrapperComponent, FormsNg1Directive } from './forms/formsBootstrapper';
4444
import { FormsBootstrapper } from './forms/formsNg2Bootstrapper';
45-
import { MessageLogNg1BootstrapperComponent, MessageLogNg1Directive } from './messageLog/messageLogBootstrapper';
45+
import { MessageLogNg1BootstrapperComponent, MessageLogNg1Directive } from './messageLog/messageLogNg1Bootstrapper';
46+
import { MessageLogNg2BootstrapperComponent } from './messageLog/messageLogNg2Bootstrapper';
47+
import { MessageLogRootComponent } from './messageLog/messageLogRoot';
4648
import { MiscRootComponent } from './misc/miscRoot';
4749
import { MiscNgContextBootstrapper } from './misc/miscNg2Context';
4850
import { MiscNg1BootstrapperComponent, MiscNg2BootstrapperComponent, MiscNg1Directive, MiscNg2Directive } from './misc/miscBootstrapper';
@@ -114,6 +116,8 @@ angular.module(moduleName, [
114116

115117
MessageLogNg1BootstrapperComponent,
116118
MessageLogNg1Directive,
119+
MessageLogNg2BootstrapperComponent,
120+
MessageLogRootComponent,
117121

118122
MiscRootComponent,
119123
MiscNg1BootstrapperComponent,

bootstrapper/messageLog/messageLogBootstrapper.ts renamed to bootstrapper/messageLog/messageLogNg1Bootstrapper.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { services } from 'typescript-angular-utilities';
88
import __array = services.array;
99
import __date = services.date;
1010

11-
import { IMessage, IMessageLogDataService, IUser } from '../../source/components/messageLog/messageLog.module';
11+
import { IMessage, IMessageLogDataService, IUser } from '../../source/components/messageLog/ng1/messageLog.module';
1212

1313
export const moduleName: string = 'MessageLogTestModule';
1414

@@ -98,7 +98,7 @@ export class MessageLogNg1Directive extends UpgradeComponent {
9898

9999
angular.module(moduleName, [])
100100
.component('tsMessageLogNg1', {
101-
template: require('./messageLogTest.html'),
101+
template: require('./messageLogNg1Test.html'),
102102
controller: 'MessageLogTestController',
103103
controllerAs: 'messageLog',
104104
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<rlMessageLog [messages]="messages"
2+
[pageSize]="pageSize"
3+
[hasNextPage]="hasNextPage"
4+
[loading]="loading"
5+
(page)="log($event)">
6+
<template let-entry>
7+
<!--{{entry | json}}-->
8+
<div class="message-body">
9+
<div class="message-content">
10+
<!--{{entry.message}}-->
11+
<div [innerHTML]="entry.message"></div>
12+
</div>
13+
<!--<span class="message-button" ng-if="log.canEditEntry(entry)">
14+
<rlButtonAsync type="message-default flat" action="log.editMessage(entry)" size="xs"><i class="fa fa-edit"></i></rlButtonAsync>
15+
</span>
16+
<span class="message-button" ng-if="log.canDeleteEntry(entry)">
17+
<rlButtonAsync type="message-danger flat" action="log.messageLog.deleteMessage(entry)" size="xs"><i class="fa fa-remove"></i></rlButtonAsync>
18+
</span>-->
19+
</div>
20+
<div class="message-byline">
21+
<div class="byline">{{entry.createdBy?.name}}</div>
22+
<div class="byline">
23+
{{ entry.createdDate | rlDate:true }}
24+
<!--<span ng-if="entry.edited" class="edited-note" rl-popover="log.tooltipTemplate" popover-trigger="mouseenter">(edited)</span>-->
25+
</div>
26+
</div>
27+
</template>
28+
</rlMessageLog>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'tsMessageLogBootstrapper',
5+
template: require('./messageLogNg2Bootstrapper.html'),
6+
})
7+
export class MessageLogNg2BootstrapperComponent {
8+
messages: any[];
9+
pageSize = 8;
10+
hasNextPage = true;
11+
loading: boolean = false;
12+
13+
ngOnInit(): void {
14+
this.messages = [
15+
{
16+
id: 1,
17+
isSystemMessage: false,
18+
message: 'Cool',
19+
createdBy: { name: 'Jim Davis' },
20+
createdDate: '2017-01-01T12:00:00',
21+
},
22+
{
23+
id: 2,
24+
isSystemMessage: true,
25+
message: 'Event',
26+
createdBy: { name: 'System' },
27+
createdDate: '2017-01-01T01:00:00',
28+
},
29+
];
30+
}
31+
32+
log = x => console.log(x);
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<ul class="nav nav-tabs">
2+
<li role="presentation"><a routerLink="ng1">Angular 1</a></li>
3+
<li role="presentation"><a routerLink="ng2">Angular 2</a></li>
4+
</ul>
5+
<router-outlet></router-outlet>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'tsMessageLogRoot',
5+
template: require('./messageLogRoot.html'),
6+
})
7+
export class MessageLogRootComponent { }

0 commit comments

Comments
 (0)