Browse Source

Formatting fixed

pull/65/head
Sebastian Stehle 10 years ago
parent
commit
728527fb9a
  1. 21
      src/Squidex/app/app.routes.ts
  2. 17
      src/Squidex/app/features/administration/module.ts
  3. 2
      src/Squidex/app/features/assets/pages/assets-page.component.html
  4. 6
      src/Squidex/app/features/content/module.ts
  5. 48
      src/Squidex/app/features/dashboard/pages/dashboard-page.component.ts
  6. 6
      src/Squidex/app/features/settings/module.ts
  7. 21
      src/Squidex/app/shared/services/app-clients.service.spec.ts
  8. 17
      src/Squidex/app/shared/services/app-contributors.service.spec.ts
  9. 19
      src/Squidex/app/shared/services/app-languages.service.spec.ts
  10. 29
      src/Squidex/app/shared/services/apps.service.spec.ts
  11. 61
      src/Squidex/app/shared/services/assets.service.spec.ts
  12. 41
      src/Squidex/app/shared/services/contents.service.spec.ts
  13. 29
      src/Squidex/app/shared/services/event-consumers.service.spec.ts
  14. 18
      src/Squidex/app/shared/services/help.service.spec.ts
  15. 25
      src/Squidex/app/shared/services/history.service.spec.ts
  16. 17
      src/Squidex/app/shared/services/languages.service.spec.ts
  17. 169
      src/Squidex/app/shared/services/schemas.service.spec.ts
  18. 42
      src/Squidex/app/shared/services/usages.service.spec.ts
  19. 116
      src/Squidex/app/shared/services/users.service.spec.ts

21
src/Squidex/app/app.routes.ts

@ -28,7 +28,8 @@ export const routes: Routes = [
path: '', path: '',
component: HomePageComponent, component: HomePageComponent,
canActivate: [MustBeNotAuthenticatedGuard] canActivate: [MustBeNotAuthenticatedGuard]
}, { },
{
path: 'app', path: 'app',
component: InternalAreaComponent, component: InternalAreaComponent,
canActivate: [MustBeAuthenticatedGuard], canActivate: [MustBeAuthenticatedGuard],
@ -36,10 +37,12 @@ export const routes: Routes = [
{ {
path: '', path: '',
loadChildren: './features/apps/module#SqxFeatureAppsModule' loadChildren: './features/apps/module#SqxFeatureAppsModule'
}, { },
{
path: 'administration', path: 'administration',
loadChildren: './features/administration/module#SqxFeatureAdministrationModule' loadChildren: './features/administration/module#SqxFeatureAdministrationModule'
}, { },
{
path: ':appName', path: ':appName',
component: AppAreaComponent, component: AppAreaComponent,
canActivate: [AppMustExistGuard], canActivate: [AppMustExistGuard],
@ -47,16 +50,20 @@ export const routes: Routes = [
{ {
path: '', path: '',
loadChildren: './features/dashboard/module#SqxFeatureDashboardModule' loadChildren: './features/dashboard/module#SqxFeatureDashboardModule'
}, { },
{
path: 'content', path: 'content',
loadChildren: './features/content/module#SqxFeatureContentModule' loadChildren: './features/content/module#SqxFeatureContentModule'
}, { },
{
path: 'schemas', path: 'schemas',
loadChildren: './features/schemas/module#SqxFeatureSchemasModule' loadChildren: './features/schemas/module#SqxFeatureSchemasModule'
}, { },
{
path: 'assets', path: 'assets',
loadChildren: './features/assets/module#SqxFeatureAssetsModule' loadChildren: './features/assets/module#SqxFeatureAssetsModule'
}, { },
{
path: 'settings', path: 'settings',
loadChildren: './features/settings/module#SqxFeatureSettingsModule' loadChildren: './features/settings/module#SqxFeatureSettingsModule'
} }

17
src/Squidex/app/features/administration/module.ts

@ -26,13 +26,16 @@ const routes: Routes = [
children: [ children: [
{ {
path: '', path: '',
children: [{ children: [
path: 'event-consumers', {
component: EventConsumersPageComponent path: 'event-consumers',
}, { component: EventConsumersPageComponent
path: 'users', },
component: UsersPageComponent {
}] path: 'users',
component: UsersPageComponent
}
]
} }
] ]
} }

2
src/Squidex/app/features/assets/pages/assets-page.component.html

@ -18,7 +18,7 @@
<h3 class="panel-title">Assets</h3> <h3 class="panel-title">Assets</h3>
</div> </div>
<a class="panel-close" routerLink="../"> <a class="panel-close" routerLink="./../">
<i class="icon-close"></i> <i class="icon-close"></i>
</a> </a>
</div> </div>

6
src/Squidex/app/features/content/module.ts

@ -51,7 +51,8 @@ const routes: Routes = [
loadChildren: './../assets/module#SqxFeatureAssetsModule' loadChildren: './../assets/module#SqxFeatureAssetsModule'
} }
] ]
}, { },
{
path: ':contentId', path: ':contentId',
component: ContentPageComponent, component: ContentPageComponent,
canDeactivate: [CanDeactivateGuard], canDeactivate: [CanDeactivateGuard],
@ -65,7 +66,8 @@ const routes: Routes = [
data: { data: {
channel: 'contents.{contentId}' channel: 'contents.{contentId}'
} }
}, { },
{
path: 'assets', path: 'assets',
loadChildren: './../assets/module#SqxFeatureAssetsModule' loadChildren: './../assets/module#SqxFeatureAssetsModule'
} }

48
src/Squidex/app/features/dashboard/pages/dashboard-page.component.ts

@ -42,9 +42,11 @@ export class DashboardPageComponent extends AppComponentBase implements OnInit,
public chartOptions = { public chartOptions = {
responsive: true, responsive: true,
scales: { scales: {
xAxes: [{ xAxes: [
display: true {
}] display: true
}
]
}, },
maintainAspectRatio: false maintainAspectRatio: false
}; };
@ -94,28 +96,32 @@ export class DashboardPageComponent extends AppComponentBase implements OnInit,
.subscribe(dtos => { .subscribe(dtos => {
this.chartStorageCount = { this.chartStorageCount = {
labels: createLabels(dtos), labels: createLabels(dtos),
datasets: [{ datasets: [
label: 'Number of Assets', {
lineTension: 0, label: 'Number of Assets',
fill: false, lineTension: 0,
backgroundColor: 'rgba(61, 135, 213, 0.6)', fill: false,
borderColor: 'rgba(61, 135, 213, 1)', backgroundColor: 'rgba(61, 135, 213, 0.6)',
borderWidth: 1, borderColor: 'rgba(61, 135, 213, 1)',
data: dtos.map(x => x.count) borderWidth: 1,
}] data: dtos.map(x => x.count)
}
]
}; };
this.chartStorageSize = { this.chartStorageSize = {
labels: createLabels(dtos), labels: createLabels(dtos),
datasets: [ { datasets: [
label: 'Size of Assets (MB)', {
lineTension: 0, label: 'Size of Assets (MB)',
fill: false, lineTension: 0,
backgroundColor: 'rgba(61, 135, 213, 0.6)', fill: false,
borderColor: 'rgba(61, 135, 213, 1)', backgroundColor: 'rgba(61, 135, 213, 0.6)',
borderWidth: 1, borderColor: 'rgba(61, 135, 213, 1)',
data: dtos.map(x => Math.round(10 * (x.size / (1024 * 1024))) / 10) borderWidth: 1,
}] data: dtos.map(x => Math.round(10 * (x.size / (1024 * 1024))) / 10)
}
]
}; };
}); });

6
src/Squidex/app/features/settings/module.ts

@ -50,7 +50,8 @@ const routes: Routes = [
} }
} }
] ]
}, { },
{
path: 'contributors', path: 'contributors',
component: ContributorsPageComponent, component: ContributorsPageComponent,
children: [ children: [
@ -69,7 +70,8 @@ const routes: Routes = [
} }
} }
] ]
}, { },
{
path: 'languages', path: 'languages',
component: LanguagesPageComponent, component: LanguagesPageComponent,
children: [ children: [

21
src/Squidex/app/shared/services/app-clients.service.spec.ts

@ -38,15 +38,18 @@ describe('AppClientsService', () => {
.returns(() => Observable.of( .returns(() => Observable.of(
new Response( new Response(
new ResponseOptions({ new ResponseOptions({
body: [{ body: [
id: 'client1', {
name: 'Client 1', id: 'client1',
secret: 'secret1' name: 'Client 1',
}, { secret: 'secret1'
id: 'client2', },
name: 'Client 2', {
secret: 'secret2' id: 'client2',
}] name: 'Client 2',
secret: 'secret2'
}
]
}) })
) )
)) ))

17
src/Squidex/app/shared/services/app-contributors.service.spec.ts

@ -32,13 +32,16 @@ describe('AppContributorsService', () => {
.returns(() => Observable.of( .returns(() => Observable.of(
new Response( new Response(
new ResponseOptions({ new ResponseOptions({
body: [{ body: [
contributorId: '123', {
permission: 'Owner' contributorId: '123',
}, { permission: 'Owner'
contributorId: '456', },
permission: 'Owner' {
}] contributorId: '456',
permission: 'Owner'
}
]
}) })
) )
)) ))

19
src/Squidex/app/shared/services/app-languages.service.spec.ts

@ -34,14 +34,17 @@ describe('AppLanguagesService', () => {
.returns(() => Observable.of( .returns(() => Observable.of(
new Response( new Response(
new ResponseOptions({ new ResponseOptions({
body: [{ body: [
iso2Code: 'de', {
englishName: 'German', iso2Code: 'de',
isMasterLanguage: true englishName: 'German',
}, { isMasterLanguage: true
iso2Code: 'en', },
englishName: 'English' {
}] iso2Code: 'en',
englishName: 'English'
}
]
}) })
) )
)) ))

29
src/Squidex/app/shared/services/apps.service.spec.ts

@ -33,19 +33,22 @@ describe('AppsService', () => {
.returns(() => Observable.of( .returns(() => Observable.of(
new Response( new Response(
new ResponseOptions({ new ResponseOptions({
body: [{ body: [
id: '123', {
name: 'name1', id: '123',
permission: 'Owner', name: 'name1',
created: '2016-01-01', permission: 'Owner',
lastModified: '2016-02-02' created: '2016-01-01',
}, { lastModified: '2016-02-02'
id: '456', },
name: 'name2', {
permission: 'Owner', id: '456',
created: '2017-01-01', name: 'name2',
lastModified: '2017-02-02' permission: 'Owner',
}] created: '2017-01-01',
lastModified: '2017-02-02'
}
]
}) })
) )
)) ))

61
src/Squidex/app/shared/services/assets.service.spec.ts

@ -53,35 +53,38 @@ describe('AssetsService', () => {
new ResponseOptions({ new ResponseOptions({
body: { body: {
total: 10, total: 10,
items: [{ items: [
id: 'id1', {
created: '2016-12-12T10:10', id: 'id1',
createdBy: 'Created1', created: '2016-12-12T10:10',
lastModified: '2017-12-12T10:10', createdBy: 'Created1',
lastModifiedBy: 'LastModifiedBy1', lastModified: '2017-12-12T10:10',
fileName: 'my-asset1.png', lastModifiedBy: 'LastModifiedBy1',
fileSize: 1024, fileName: 'my-asset1.png',
fileVersion: 2000, fileSize: 1024,
mimeType: 'text/plain', fileVersion: 2000,
isImage: true, mimeType: 'text/plain',
pixelWidth: 1024, isImage: true,
pixelHeight: 2048, pixelWidth: 1024,
version: 11 pixelHeight: 2048,
}, { version: 11
id: 'id2', },
created: '2016-10-12T10:10', {
createdBy: 'Created2', id: 'id2',
lastModified: '2017-10-12T10:10', created: '2016-10-12T10:10',
lastModifiedBy: 'LastModifiedBy2', createdBy: 'Created2',
fileName: 'my-asset2.png', lastModified: '2017-10-12T10:10',
fileSize: 1024, lastModifiedBy: 'LastModifiedBy2',
fileVersion: 2000, fileName: 'my-asset2.png',
mimeType: 'text/plain', fileSize: 1024,
isImage: true, fileVersion: 2000,
pixelWidth: 1024, mimeType: 'text/plain',
pixelHeight: 2048, isImage: true,
version: 22 pixelWidth: 1024,
}] pixelHeight: 2048,
version: 22
}
]
} }
}) })
) )

41
src/Squidex/app/shared/services/contents.service.spec.ts

@ -36,25 +36,28 @@ describe('ContentsService', () => {
new ResponseOptions({ new ResponseOptions({
body: { body: {
total: 10, total: 10,
items: [{ items: [
id: 'id1', {
isPublished: true, id: 'id1',
created: '2016-12-12T10:10', isPublished: true,
createdBy: 'Created1', created: '2016-12-12T10:10',
lastModified: '2017-12-12T10:10', createdBy: 'Created1',
lastModifiedBy: 'LastModifiedBy1', lastModified: '2017-12-12T10:10',
version: 11, lastModifiedBy: 'LastModifiedBy1',
data: {} version: 11,
}, { data: {}
id: 'id2', },
isPublished: true, {
created: '2016-10-12T10:10', id: 'id2',
createdBy: 'Created2', isPublished: true,
lastModified: '2017-10-12T10:10', created: '2016-10-12T10:10',
lastModifiedBy: 'LastModifiedBy2', createdBy: 'Created2',
version: 22, lastModified: '2017-10-12T10:10',
data: {} lastModifiedBy: 'LastModifiedBy2',
}] version: 22,
data: {}
}
]
} }
}) })
) )

29
src/Squidex/app/shared/services/event-consumers.service.spec.ts

@ -30,19 +30,22 @@ describe('EventConsumersService', () => {
.returns(() => Observable.of( .returns(() => Observable.of(
new Response( new Response(
new ResponseOptions({ new ResponseOptions({
body: [{ body: [
name: 'event-consumer1', {
lastHandledEventNumber: 13, name: 'event-consumer1',
isStopped: true, lastHandledEventNumber: 13,
isResetting: true, isStopped: true,
error: 'an error 1' isResetting: true,
}, { error: 'an error 1'
name: 'event-consumer2', },
lastHandledEventNumber: 29, {
isStopped: true, name: 'event-consumer2',
isResetting: true, lastHandledEventNumber: 29,
error: 'an error 2' isStopped: true,
}] isResetting: true,
error: 'an error 2'
}
]
}) })
) )
)) ))

18
src/Squidex/app/shared/services/help.service.spec.ts

@ -27,13 +27,17 @@ describe('AppClientsService', () => {
new Response( new Response(
new ResponseOptions({ new ResponseOptions({
body: { body: {
sections: [{ sections: [
content: 'A test content with' {
}, { content: 'A test content with'
content: 'A test content with a <a href="https://squidex.io">A Link</a>' },
}, { {
content: 'A test content with a <a href="../GLOSSARY.html#content">Glossary Link</a>' content: 'A test content with a <a href="https://squidex.io">A Link</a>'
}] },
{
content: 'A test content with a <a href="../GLOSSARY.html#content">Glossary Link</a>'
}
]
} }
}) })
) )

25
src/Squidex/app/shared/services/history.service.spec.ts

@ -32,17 +32,20 @@ describe('HistoryService', () => {
.returns(() => Observable.of( .returns(() => Observable.of(
new Response( new Response(
new ResponseOptions({ new ResponseOptions({
body: [{ body: [
actor: 'User1', {
eventId: '1', actor: 'User1',
message: 'Message 1', eventId: '1',
created: '2016-12-12T10:10' message: 'Message 1',
}, { created: '2016-12-12T10:10'
actor: 'User2', },
eventId: '2', {
message: 'Message 2', actor: 'User2',
created: '2016-12-13T10:10' eventId: '2',
}] message: 'Message 2',
created: '2016-12-13T10:10'
}
]
}) })
) )
)) ))

17
src/Squidex/app/shared/services/languages.service.spec.ts

@ -30,13 +30,16 @@ describe('LanguageService', () => {
.returns(() => Observable.of( .returns(() => Observable.of(
new Response( new Response(
new ResponseOptions({ new ResponseOptions({
body: [{ body: [
iso2Code: 'de', {
englishName: 'German' iso2Code: 'de',
}, { englishName: 'German'
iso2Code: 'en', },
englishName: 'English' {
}] iso2Code: 'en',
englishName: 'English'
}
]
}) })
) )
)) ))

169
src/Squidex/app/shared/services/schemas.service.spec.ts

@ -45,29 +45,32 @@ describe('SchemasService', () => {
.returns(() => Observable.of( .returns(() => Observable.of(
new Response( new Response(
new ResponseOptions({ new ResponseOptions({
body: [{ body: [
id: 'id1', {
name: 'name1', id: 'id1',
label: 'label1', name: 'name1',
isPublished: true, label: 'label1',
created: '2016-12-12T10:10', isPublished: true,
createdBy: 'Created1', created: '2016-12-12T10:10',
lastModified: '2017-12-12T10:10', createdBy: 'Created1',
lastModifiedBy: 'LastModifiedBy1', lastModified: '2017-12-12T10:10',
version: 11, lastModifiedBy: 'LastModifiedBy1',
data: {} version: 11,
}, { data: {}
id: 'id2', },
name: 'name2', {
label: 'label2', id: 'id2',
isPublished: true, name: 'name2',
created: '2016-10-12T10:10', label: 'label2',
createdBy: 'Created2', isPublished: true,
lastModified: '2017-10-12T10:10', created: '2016-10-12T10:10',
lastModifiedBy: 'LastModifiedBy2', createdBy: 'Created2',
version: 22, lastModified: '2017-10-12T10:10',
data: {} lastModifiedBy: 'LastModifiedBy2',
}] version: 22,
data: {}
}
]
}) })
) )
)) ))
@ -109,63 +112,71 @@ describe('SchemasService', () => {
lastModified: '2017-12-12T10:10', lastModified: '2017-12-12T10:10',
lastModifiedBy: 'LastModifiedBy1', lastModifiedBy: 'LastModifiedBy1',
version: 11, version: 11,
fields: [{ fields: [
fieldId: 1, {
name: 'field1', fieldId: 1,
isHidden: true, name: 'field1',
isDisabled: true, isHidden: true,
properties: { isDisabled: true,
fieldType: 'Number' properties: {
} fieldType: 'Number'
}, { }
fieldId: 2, },
name: 'field2', {
isHidden: true, fieldId: 2,
isDisabled: true, name: 'field2',
properties: { isHidden: true,
fieldType: 'String' isDisabled: true,
} properties: {
}, { fieldType: 'String'
fieldId: 3, }
name: 'field3', },
isHidden: true, {
isDisabled: true, fieldId: 3,
properties: { name: 'field3',
fieldType: 'Boolean' isHidden: true,
} isDisabled: true,
}, { properties: {
fieldId: 4, fieldType: 'Boolean'
name: 'field4', }
isHidden: true, },
isDisabled: true, {
properties: { fieldId: 4,
fieldType: 'DateTime' name: 'field4',
} isHidden: true,
}, { isDisabled: true,
fieldId: 5, properties: {
name: 'field5', fieldType: 'DateTime'
isHidden: true, }
isDisabled: true, },
properties: { {
fieldType: 'Json' fieldId: 5,
} name: 'field5',
}, { isHidden: true,
fieldId: 6, isDisabled: true,
name: 'field6', properties: {
isHidden: true, fieldType: 'Json'
isDisabled: true, }
properties: { },
fieldType: 'Geolocation' {
} fieldId: 6,
}, { name: 'field6',
fieldId: 7, isHidden: true,
name: 'field7', isDisabled: true,
isHidden: true, properties: {
isDisabled: true, fieldType: 'Geolocation'
properties: { }
fieldType: 'Assets' },
{
fieldId: 7,
name: 'field7',
isHidden: true,
isDisabled: true,
properties: {
fieldType: 'Assets'
}
} }
}] ]
} }
}) })
) )

42
src/Squidex/app/shared/services/usages.service.spec.ts

@ -34,15 +34,18 @@ describe('UsagesService', () => {
.returns(() => Observable.of( .returns(() => Observable.of(
new Response( new Response(
new ResponseOptions({ new ResponseOptions({
body: [{ body: [
date: '2017-10-12', {
count: 10, date: '2017-10-12',
averageMs: 130 count: 10,
}, { averageMs: 130
date: '2017-10-13', },
count: 13, {
averageMs: 170 date: '2017-10-13',
}] count: 13,
averageMs: 170
}
]
}) })
) )
)) ))
@ -90,15 +93,18 @@ describe('UsagesService', () => {
.returns(() => Observable.of( .returns(() => Observable.of(
new Response( new Response(
new ResponseOptions({ new ResponseOptions({
body: [{ body: [
date: '2017-10-12', {
count: 10, date: '2017-10-12',
size: 130 count: 10,
}, { size: 130
date: '2017-10-13', },
count: 13, {
size: 170 date: '2017-10-13',
}] count: 13,
size: 170
}
]
}) })
) )
)) ))

116
src/Squidex/app/shared/services/users.service.spec.ts

@ -32,19 +32,22 @@ describe('UsersService', () => {
.returns(() => Observable.of( .returns(() => Observable.of(
new Response( new Response(
new ResponseOptions({ new ResponseOptions({
body: [{ body: [
id: '123', {
email: 'mail1@domain.com', id: '123',
displayName: 'User1', email: 'mail1@domain.com',
pictureUrl: 'path/to/image1', displayName: 'User1',
isLocked: true pictureUrl: 'path/to/image1',
}, { isLocked: true
id: '456', },
email: 'mail2@domain.com', {
displayName: 'User2', id: '456',
pictureUrl: 'path/to/image2', email: 'mail2@domain.com',
isLocked: true displayName: 'User2',
}] pictureUrl: 'path/to/image2',
isLocked: true
}
]
}) })
) )
)) ))
@ -70,19 +73,22 @@ describe('UsersService', () => {
.returns(() => Observable.of( .returns(() => Observable.of(
new Response( new Response(
new ResponseOptions({ new ResponseOptions({
body: [{ body: [
id: '123', {
email: 'mail1@domain.com', id: '123',
displayName: 'User1', email: 'mail1@domain.com',
pictureUrl: 'path/to/image1', displayName: 'User1',
isLocked: true pictureUrl: 'path/to/image1',
}, { isLocked: true
id: '456', },
email: 'mail2@domain.com', {
displayName: 'User2', id: '456',
pictureUrl: 'path/to/image2', email: 'mail2@domain.com',
isLocked: true displayName: 'User2',
}] pictureUrl: 'path/to/image2',
isLocked: true
}
]
}) })
) )
)) ))
@ -148,19 +154,22 @@ describe('UserManagementService', () => {
new ResponseOptions({ new ResponseOptions({
body: { body: {
total: 100, total: 100,
items: [{ items: [
id: '123', {
email: 'mail1@domain.com', id: '123',
displayName: 'User1', email: 'mail1@domain.com',
pictureUrl: 'path/to/image1', displayName: 'User1',
isLocked: true pictureUrl: 'path/to/image1',
}, { isLocked: true
id: '456', },
email: 'mail2@domain.com', {
displayName: 'User2', id: '456',
pictureUrl: 'path/to/image2', email: 'mail2@domain.com',
isLocked: true displayName: 'User2',
}] pictureUrl: 'path/to/image2',
isLocked: true
}
]
} }
}) })
) )
@ -189,19 +198,22 @@ describe('UserManagementService', () => {
new ResponseOptions({ new ResponseOptions({
body: { body: {
total: 100, total: 100,
items: [{ items: [
id: '123', {
email: 'mail1@domain.com', id: '123',
displayName: 'User1', email: 'mail1@domain.com',
pictureUrl: 'path/to/image1', displayName: 'User1',
isLocked: true pictureUrl: 'path/to/image1',
}, { isLocked: true
id: '456', },
email: 'mail2@domain.com', {
displayName: 'User2', id: '456',
pictureUrl: 'path/to/image2', email: 'mail2@domain.com',
isLocked: true displayName: 'User2',
}] pictureUrl: 'path/to/image2',
isLocked: true
}
]
} }
}) })
) )

Loading…
Cancel
Save