diff --git a/src/app/core/pipes/getById.pipe.ts b/src/app/core/pipes/getById.pipe.ts
index fbbf6895..e2797aad 100644
--- a/src/app/core/pipes/getById.pipe.ts
+++ b/src/app/core/pipes/getById.pipe.ts
@@ -3,10 +3,10 @@ import { Pipe, PipeTransform } from '@angular/core';
@Pipe({name: 'getById'})
export class GetByIdPipe implements PipeTransform
{
- transform(value: any[], id: number, property: string ): any
+ transform(value: any[], id: number, property: string): any
{
const foundItem = value.find(item => {
- if ( item.id )
+ if ( item.id !== undefined )
{
return item.id === id;
}
diff --git a/src/app/core/pipes/pipes.module.ts b/src/app/core/pipes/pipes.module.ts
index a5f01259..613a8514 100644
--- a/src/app/core/pipes/pipes.module.ts
+++ b/src/app/core/pipes/pipes.module.ts
@@ -3,21 +3,18 @@ import { NgModule } from '@angular/core';
import { KeysPipe } from './keys.pipe';
import { GetByIdPipe } from './getById.pipe';
import { HtmlToPlaintextPipe } from './htmlToPlaintext.pipe';
-import { SearchPipe } from './search.pipe';
@NgModule({
declarations: [
KeysPipe,
GetByIdPipe,
- HtmlToPlaintextPipe,
- SearchPipe
+ HtmlToPlaintextPipe
],
imports : [],
exports : [
KeysPipe,
GetByIdPipe,
- HtmlToPlaintextPipe,
- SearchPipe
+ HtmlToPlaintextPipe
]
})
diff --git a/src/app/core/pipes/search.pipe.ts b/src/app/core/pipes/search.pipe.ts
deleted file mode 100644
index afa0e955..00000000
--- a/src/app/core/pipes/search.pipe.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { Pipe, PipeTransform } from '@angular/core';
-
-@Pipe({
- name: 'filter'
-})
-export class SearchPipe implements PipeTransform
-{
- transform(items: any, term: string): any
- {
- if ( term === undefined )
- {
- return items;
- }
-
- return this.filter(items, term);
- }
-
- filter(items: any, term: string)
- {
- return items.filter(item => {
-
- for ( const property in item )
- {
- if ( !item.hasOwnProperty(property) || !item[property] )
- {
- console.log('continueing...');
- continue;
- }
-
- if ( Array.isArray(item[property]) )
- {
- console.log('is Array');
- return this.filter(item[property], term);
- }
-
- if ( item[property].toString().toLowerCase().includes(term.toLowerCase()) )
- {
- console.log('found!');
- return true;
- }
- }
-
- return false;
- }
- );
- }
-}
-
-
diff --git a/src/app/fuse-fake-db/fuse-fake-db.service.ts b/src/app/fuse-fake-db/fuse-fake-db.service.ts
index 143b82d6..552e0cb8 100644
--- a/src/app/fuse-fake-db/fuse-fake-db.service.ts
+++ b/src/app/fuse-fake-db/fuse-fake-db.service.ts
@@ -1,13 +1,14 @@
-import {InMemoryDbService} from 'angular-in-memory-web-api';
-import {MailFakeDb} from './mail';
+import { InMemoryDbService } from 'angular-in-memory-web-api';
+import { MailFakeDb } from './mail';
export class FuseFakeDbService implements InMemoryDbService
{
createDb()
{
return {
- 'mail-mails' : MailFakeDb.mails,
+ 'mail-mails' : MailFakeDb.mails,
'mail-folders': MailFakeDb.folders,
+ 'mail-filters': MailFakeDb.filters,
'mail-labels' : MailFakeDb.labels
};
}
diff --git a/src/app/fuse-fake-db/mail.ts b/src/app/fuse-fake-db/mail.ts
index 54e365aa..af387198 100644
--- a/src/app/fuse-fake-db/mail.ts
+++ b/src/app/fuse-fake-db/mail.ts
@@ -47,11 +47,7 @@ export class MailFakeDb
'labels' : [
1
],
- 'folders' : [
- 0,
- 1,
- 2
- ]
+ 'folder' : 0
},
{
'id' : '154588a0864d2881124',
@@ -74,11 +70,7 @@ export class MailFakeDb
'important' : false,
'hasAttachments': false,
'labels' : [],
- 'folders' : [
- 0,
- 1,
- 2
- ]
+ 'folder' : 0
},
{
'id' : '15453ba60d3baa5daaf',
@@ -104,11 +96,7 @@ export class MailFakeDb
3,
2
],
- 'folders' : [
- 0,
- 1,
- 2
- ]
+ 'folder' : 0
},
{
'id' : '15453a06c08fb021776',
@@ -134,11 +122,7 @@ export class MailFakeDb
3,
4
],
- 'folders' : [
- 0,
- 1,
- 2
- ]
+ 'folder' : 0
},
{
'id' : '154537435d5b32bf11a',
@@ -161,11 +145,7 @@ export class MailFakeDb
'important' : false,
'hasAttachments': false,
'labels' : [],
- 'folders' : [
- 0,
- 1,
- 2
- ]
+ 'folder' : 0
},
{
'id' : '1544e43dcdae6ebf876',
@@ -190,11 +170,7 @@ export class MailFakeDb
'labels' : [
2
],
- 'folders' : [
- 0,
- 1,
- 2
- ]
+ 'folder' : 0
},
{
'id' : '1543ee3a5b43e0f9f45',
@@ -217,11 +193,7 @@ export class MailFakeDb
'important' : false,
'hasAttachments': false,
'labels' : [],
- 'folders' : [
- 0,
- 1,
- 2
- ]
+ 'folder' : 0
},
{
'id' : '1543cc4515df3146112',
@@ -244,11 +216,7 @@ export class MailFakeDb
'important' : false,
'hasAttachments': false,
'labels' : [],
- 'folders' : [
- 0,
- 1,
- 2
- ]
+ 'folder' : 0
},
{
'id' : '154398a4770d7aaf9a2',
@@ -271,11 +239,7 @@ export class MailFakeDb
'important' : false,
'hasAttachments': false,
'labels' : [],
- 'folders' : [
- 0,
- 1,
- 2
- ]
+ 'folder' : 0
},
{
'id' : '15438351f87dcd68567',
@@ -298,11 +262,7 @@ export class MailFakeDb
'important' : false,
'hasAttachments': false,
'labels' : [],
- 'folders' : [
- 0,
- 1,
- 2
- ]
+ 'folder' : 0
},
{
'id' : '1542d75d929a603125',
@@ -325,11 +285,7 @@ export class MailFakeDb
'important' : false,
'hasAttachments': false,
'labels' : [],
- 'folders' : [
- 0,
- 1,
- 2
- ]
+ 'folder' : 0
},
{
'id' : '1541ca7af66da284177',
@@ -352,11 +308,7 @@ export class MailFakeDb
'important' : false,
'hasAttachments': false,
'labels' : [],
- 'folders' : [
- 0,
- 1,
- 2
- ]
+ 'folder' : 0
},
{
'id' : '154297167e781781745',
@@ -379,11 +331,7 @@ export class MailFakeDb
'important' : false,
'hasAttachments': false,
'labels' : [],
- 'folders' : [
- 0,
- 1,
- 2
- ]
+ 'folder' : 0
},
{
'id' : '15427f4c1b7f3953234',
@@ -406,9 +354,7 @@ export class MailFakeDb
'important' : false,
'hasAttachments': false,
'labels' : [],
- 'folders' : [
- 3
- ]
+ 'folder' : 3
},
{
'id' : '154204e45a59b168453',
@@ -431,9 +377,7 @@ export class MailFakeDb
'important' : false,
'hasAttachments': false,
'labels' : [],
- 'folders' : [
- 3
- ]
+ 'folder' : 3
},
{
'id' : '1541dd1e05dfc439216',
@@ -456,9 +400,7 @@ export class MailFakeDb
'important' : false,
'hasAttachments': false,
'labels' : [],
- 'folders' : [
- 3
- ]
+ 'folder' : 3
}
];
@@ -492,15 +434,18 @@ export class MailFakeDb
'handle': 'trash',
'title' : 'Trash',
'icon' : 'delete'
- },
+ }
+ ];
+
+ public static filters = [
{
- 'id' : 5,
+ 'id' : 0,
'handle': 'starred',
'title' : 'Starred',
'icon' : 'star'
},
{
- 'id' : 6,
+ 'id' : 1,
'handle': 'important',
'title' : 'Important',
'icon' : 'label'
diff --git a/src/app/main/apps/mail/mail-details/mail-details.component.html b/src/app/main/apps/mail/mail-details/mail-details.component.html
index 3b7e5a5c..41d2c451 100644
--- a/src/app/main/apps/mail/mail-details/mail-details.component.html
+++ b/src/app/main/apps/mail/mail-details/mail-details.component.html
@@ -60,16 +60,9 @@
-
- Show Details
-
-
-
- Hide Details
+
+ Show Details
+ Hide Details
@@ -88,16 +81,13 @@
-
-