├── .firebaserc
├── .gitignore
├── LICENSE
├── README.md
├── firebase.json
└── src
├── 404.html
├── app
├── +collaborator
│ ├── collaborator-detail
│ │ ├── collaborator-detail.component.html
│ │ ├── collaborator-detail.component.ts
│ │ └── index.ts
│ ├── collaborator-list
│ │ ├── collaborator-list.component.html
│ │ ├── collaborator-list.component.ts
│ │ └── index.ts
│ ├── collaborator-register
│ │ ├── collaborator-register.component.html
│ │ ├── collaborator-register.component.ts
│ │ └── index.ts
│ ├── collaborator-reset
│ │ ├── collaborator-reset.component.html
│ │ ├── collaborator-reset.component.ts
│ │ └── index.ts
│ ├── collaborator-signin
│ │ ├── collaborator-signin.component.html
│ │ ├── collaborator-signin.component.ts
│ │ └── index.ts
│ ├── collaborator.interface.ts
│ └── index.ts
├── +customer
│ ├── customer-create
│ │ ├── customer-create.component.html
│ │ ├── customer-create.component.ts
│ │ └── index.ts
│ ├── customer-detail
│ │ ├── customer-detail.component.html
│ │ ├── customer-detail.component.ts
│ │ └── index.ts
│ ├── customer-list
│ │ ├── customer-list.component.html
│ │ ├── customer-list.component.ts
│ │ └── index.ts
│ ├── customer.interface.ts
│ └── index.ts
├── +dashboard
│ ├── dashboard-index
│ │ ├── dashboard-index.component.html
│ │ ├── dashboard-index.component.ts
│ │ └── index.ts
│ └── index.ts
├── +home
│ ├── home-index
│ │ ├── home-index.component.html
│ │ ├── home-index.component.ts
│ │ └── index.ts
│ └── index.ts
├── +mission
│ ├── index.ts
│ ├── mission-create
│ │ ├── index.ts
│ │ ├── mission-create.component.html
│ │ └── mission-create.component.ts
│ ├── mission-detail
│ │ ├── index.ts
│ │ ├── mission-detail.component.html
│ │ └── mission-detail.component.ts
│ ├── mission-list
│ │ ├── index.ts
│ │ ├── mission-list.component.html
│ │ └── mission-list.component.ts
│ └── mission.interface.ts
├── +role
│ ├── index.ts
│ ├── role-create
│ │ ├── index.ts
│ │ ├── role-create.component.html
│ │ └── role-create.component.ts
│ ├── role-list
│ │ ├── index.ts
│ │ ├── role-list.component.html
│ │ └── role-list.component.ts
│ └── role.interface.ts
├── +setting
│ ├── index.ts
│ └── setting-index
│ │ ├── index.ts
│ │ ├── setting-index.component.html
│ │ └── setting-index.component.ts
├── +skill
│ ├── index.ts
│ ├── skill-create
│ │ ├── index.ts
│ │ ├── skill-create.component.html
│ │ └── skill-create.component.ts
│ ├── skill-detail
│ │ ├── index.ts
│ │ ├── skill-detail.component.html
│ │ └── skill-detail.component.ts
│ ├── skill-list
│ │ ├── index.ts
│ │ ├── skill-list.component.html
│ │ └── skill-list.component.ts
│ └── skill.interface.ts
├── app.component.html
├── app.component.ts
├── app.routes.ts
├── index.ts
├── main.ts
└── shared
│ ├── index.ts
│ ├── pipes
│ ├── index.ts
│ └── object-to-array.pipe.ts
│ └── services
│ ├── auth.guard.ts
│ ├── auth.service.ts
│ ├── data.service.ts
│ ├── index.ts
│ └── title-page.service.ts
├── assets
├── css
│ └── styles.css
├── i18n
│ ├── en.json
│ └── fr.json
└── img
│ ├── C.png
│ ├── demo.png
│ └── favicon.ico
├── index.html
├── package.json
├── systemjs.config.js
├── tsconfig.json
├── typings.json
└── typings
├── browser.d.ts
├── browser
└── ambient
│ ├── es6-shim
│ └── index.d.ts
│ ├── firebase
│ └── index.d.ts
│ └── jasmine
│ └── index.d.ts
├── index.d.ts
├── main.d.ts
└── main
└── ambient
├── es6-shim
└── index.d.ts
├── firebase
└── index.d.ts
└── jasmine
└── index.d.ts
/.firebaserc:
--------------------------------------------------------------------------------
1 | {
2 | "projects": {
3 | "default": "blazing-inferno-9370"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | src/typings
2 | node_modules
3 | src/dist
4 | src/node_modules
5 | npm-debug.log
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright © 2016 clamarque
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Angular2_Dashboard
2 | > Angular2_Dashboard is a management platform of collaborators for the entreprises. This platform was developed with Angular RC.4 and Firebase and it is still developing.
3 |
4 | [](https://gitter.im/clamarque/Angular2_Dashboard?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5 | []()
6 | []()
7 |
8 |
9 |
10 |
11 |
12 | ## Demo
13 |
14 | you can run the app: https://blazing-inferno-9370.firebaseapp.com
15 |
16 | Admin:
17 |
18 | * **username**: test@clamarque.io
19 |
20 | * **password**:testtest
21 |
22 | User:
23 |
24 | * Coming soon
25 |
26 | ## Quick Start
27 |
28 | `$ git clone https://github.com/clamarque/Angular2_Dashboard.git`
29 |
30 | `$ cd Angular2_Dashboard/src/`
31 |
32 | `$ npm install`
33 |
34 | `$ npm start`
35 |
36 | ## Stack
37 |
38 | - Angular 2 RC4
39 | - Angular 2 material
40 | - ng2-translate
41 | - ng2-toastr
42 | - Firebase 3
43 | - Typescript
44 |
45 | ## Who wants to help me?
46 |
47 | Want to file a bug, contribute some code, suggest ideas or improve documentation? don't hesitate!
48 |
--------------------------------------------------------------------------------
/firebase.json:
--------------------------------------------------------------------------------
1 | {
2 | "hosting": {
3 | "public": "src",
4 | "rewrites": [{
5 | "source": "**",
6 | "destination": "/index.html"
7 | }],
8 | "ignore": [
9 | "firebase.json",
10 | "**/.*"
11 | ]
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Page Not Found
6 |
71 |
72 |
73 | Page Not Found
74 | This specified file was not found on this website. Please check the URL for mistakes and try again.
75 | Why am I seeing this?
76 | This page was generated by the Firebase Command-Line Interface. To modify it, edit the 404.html
file in your project's configured public directory.
77 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-detail/collaborator-detail.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-detail/collaborator-detail.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Router, ActivatedRoute} from '@angular/router';
3 |
4 | import { Collaborator } from '../collaborator.interface';
5 | import { DataService, ObjectToArrayPipe, TitlePageService } from '../../shared';
6 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
7 | import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
8 | import { MD_CHECKBOX_DIRECTIVES } from '@angular2-material/checkbox';
9 | import { MD_BUTTON_DIRECTIVES} from '@angular2-material/button';
10 | import { MD_LIST_DIRECTIVES} from '@angular2-material/list';
11 |
12 | @Component({
13 | selector: "collaborator-detail",
14 | templateUrl: './app/+collaborator/collaborator-detail/collaborator-detail.component.html',
15 | directives: [ MD_INPUT_DIRECTIVES, MD_CHECKBOX_DIRECTIVES, MD_BUTTON_DIRECTIVES, MD_BUTTON_DIRECTIVES],
16 | providers: [DataService, ObjectToArrayPipe, ToastsManager, TitlePageService ]
17 | })
18 |
19 | export class CollaboratorDetailComponent implements OnInit {
20 |
21 | collaborator: Collaborator;
22 | list_roles: any[];
23 | data: any;
24 | private sub; any;
25 |
26 | constructor(
27 | private _dataService: DataService,
28 | private _router: Router,
29 | private _route: ActivatedRoute,
30 | private _objecToArrayPipe: ObjectToArrayPipe,
31 | private _toastr: ToastsManager,
32 | private _titlePageService: TitlePageService) { }
33 |
34 | cancel() {
35 | this._router.navigate(['/Home/Collaborator']);
36 |
37 | }
38 | onSubmit() {
39 | this.sub = this._route.params.subscribe(params => {
40 | let id = params['id'];
41 | this._dataService.setDataCollaborator(id, this.collaborator);
42 | this._router.navigate(['/Home/Collaborator']);
43 | this._toastr.success('modifications saved');
44 | })
45 | }
46 |
47 | ngOnInit() {
48 | this._titlePageService.setTitle('Collaborator details');
49 |
50 | this.sub = this._route.params.subscribe(params => {
51 | let id = params['id'];
52 | this._dataService.getData('collaborator', id).then((snapshot) => {
53 | this.data = snapshot.val();
54 | this.collaborator = this.data;
55 | })
56 | })
57 |
58 | this._dataService.getAllData('role').then((snapshot) => {
59 | this.data = snapshot.val();
60 | this.list_roles = this._objecToArrayPipe.transform(this.data);
61 | })
62 | }
63 | }
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-detail/index.ts:
--------------------------------------------------------------------------------
1 | export * from './collaborator-detail.component';
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-list/collaborator-list.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | |
5 | Name |
6 | Role |
7 | Active |
8 | Edit |
9 | Delete |
10 |
11 |
12 |
13 |
14 |  |
15 | {{collaborator.username}} |
16 | {{collaborator.role}} |
17 | {{collaborator.active}} |
18 |
19 | mode_edit
20 | |
21 |
22 |
23 | |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-list/collaborator-list.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { ROUTER_DIRECTIVES, Router } from '@angular/router';
3 |
4 | import { DataService, ObjectToArrayPipe, TitlePageService } from '../../shared';
5 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
6 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
7 |
8 | @Component({
9 | selector: 'collaborator-list',
10 | templateUrl: './app/+collaborator/collaborator-list/collaborator-list.component.html',
11 | directives: [ROUTER_DIRECTIVES, MD_BUTTON_DIRECTIVES],
12 | providers: [DataService, ObjectToArrayPipe, ToastsManager, TitlePageService]
13 | })
14 |
15 | export class CollaboratorListComponent implements OnInit {
16 | list_collaborators: any[];
17 | data: any;
18 |
19 | constructor(
20 | private _titlePageService: TitlePageService,
21 | private _dataService: DataService,
22 | private _router: Router,
23 | private _objectToArrayPipe: ObjectToArrayPipe,
24 | private _toastr: ToastsManager) {
25 | }
26 |
27 | deleteCollaborator(collaborator: any) {
28 | this._dataService.deleteData('collaborator', collaborator.id);
29 | this.ngOnInit();
30 | this._toastr.success('Collaborator deleted');
31 | }
32 | orderby() {
33 | let self = this;
34 | /*firebase.database().ref('collaborator').orderByChild('username').on('child_added', function (snapshot) {
35 | // console.log(snapshot.val());
36 | self.data = snapshot.val();
37 | //self.list_collaborators = self._objectToArrayPipe.transform(self.data);
38 | self.list_collaborators = self.data;
39 | console.log(self.list_collaborators);
40 |
41 | })*/
42 | }
43 |
44 | ngOnInit() {
45 | this._titlePageService.setTitle('Collaborators');
46 |
47 | this._dataService.getAllData('collaborator').then((snapshot, prevChildKey) => {
48 | this.data = snapshot.val();
49 | this.list_collaborators = this._objectToArrayPipe.transform(this.data);
50 | })
51 |
52 | }
53 | }
54 |
55 |
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-list/index.ts:
--------------------------------------------------------------------------------
1 | export * from './collaborator-list.component';
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-register/collaborator-register.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-register/collaborator-register.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Router } from '@angular/router';
3 |
4 | import { AuthService, DataService, ObjectToArrayPipe, TitlePageService } from '../../shared';
5 | import { Collaborator } from '../collaborator.interface';
6 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
7 | import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
8 |
9 |
10 | @Component({
11 | selector: 'collaborator-register',
12 | templateUrl: './app/+collaborator/collaborator-register/collaborator-register.component.html',
13 | directives: [MD_BUTTON_DIRECTIVES, MD_INPUT_DIRECTIVES],
14 | providers: [AuthService, DataService, ObjectToArrayPipe, TitlePageService]
15 | })
16 | export class CollaboratorRegisterComponent implements OnInit {
17 | list_infosUser: Collaborator;
18 | list_roles: any[];
19 | temp: any;
20 |
21 | constructor(
22 | private _dataService: DataService,
23 | private _router: Router,
24 | private _authenticationService: AuthService,
25 | private _objectToArrayPipe: ObjectToArrayPipe,
26 | private _titlePageService: TitlePageService) { }
27 |
28 | cancel() {
29 | this._router.navigate(['/Home/Collaborator']);
30 | }
31 |
32 | onSubmit() {
33 | this._authenticationService.signUp(this.list_infosUser);
34 | this._router.navigate(['/Collaborator']);
35 | }
36 |
37 | ngOnInit() {
38 | this._titlePageService.setTitle('Create a collaborator')
39 |
40 | this.list_infosUser = {
41 | active: false,
42 | admin: false,
43 | first: '',
44 | last: '',
45 | username: '',
46 | role: '',
47 | email: '',
48 | password: ''
49 | }
50 |
51 | this._dataService.getAllData('role').then((snapshot) => {
52 | let data = snapshot.val();
53 | this.temp = data;
54 | this.list_roles = this._objectToArrayPipe.transform(this.temp);
55 | })
56 | }
57 | }
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-register/index.ts:
--------------------------------------------------------------------------------
1 | export * from './collaborator-register.component';
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-reset/collaborator-reset.component.html:
--------------------------------------------------------------------------------
1 |
2 |
Reset your Password
3 |
12 |
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-reset/collaborator-reset.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Router, ROUTER_DIRECTIVES } from '@angular/router';
3 |
4 | import { AuthService } from '../../shared';
5 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
6 | import { MD_CARD_DIRECTIVES } from '@angular2-material/card';
7 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
8 | import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
9 |
10 |
11 | @Component({
12 | selector: 'user-reset-password',
13 | templateUrl: './app/+collaborator/collaborator-reset/collaborator-reset.component.html',
14 | directives: [ROUTER_DIRECTIVES, MD_BUTTON_DIRECTIVES, MD_CARD_DIRECTIVES, MD_INPUT_DIRECTIVES],
15 | providers: [AuthService, ToastsManager]
16 | })
17 | export class CollaboratorResetComponent implements OnInit {
18 | email: string;
19 |
20 | constructor(
21 | private _router: Router,
22 | private _authService: AuthService,
23 | private _toastr: ToastsManager
24 | ) { }
25 |
26 | ngOnInit() {
27 | this.email = '';
28 | }
29 |
30 | onClickResetPassword() {
31 | if (this.email != '') {
32 | this._authService.sendPasswordResetEmail(this.email, (error: any) => {
33 | if(error) {
34 | this._toastr.error(error, 'Oops !')
35 | }
36 | else {
37 | this._toastr.success(this.email, 'Thank you! an email is sent to you')
38 | this._router.navigate(['']);
39 | }
40 | });
41 | }
42 | }
43 |
44 | cancel() {
45 | this._router.navigate(['']);
46 | }
47 | }
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-reset/index.ts:
--------------------------------------------------------------------------------
1 | export * from './collaborator-reset.component';
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-signin/collaborator-signin.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-signin/collaborator-signin.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Router, ROUTER_DIRECTIVES } from '@angular/router';
3 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
4 | import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
5 | import { MD_CARD_DIRECTIVES } from '@angular2-material/card';
6 |
7 | import { AuthService } from '../../shared';
8 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
9 |
10 | @Component({
11 | selector: 'signin',
12 | templateUrl: './app/+collaborator/collaborator-signin/collaborator-signin.component.html',
13 | directives: [ROUTER_DIRECTIVES,MD_BUTTON_DIRECTIVES, MD_INPUT_DIRECTIVES, MD_CARD_DIRECTIVES],
14 | providers: [AuthService, ToastsManager]
15 | })
16 |
17 | export class CollaboratorSignInComponent implements OnInit {
18 | email: string;
19 | password: string;
20 |
21 |
22 | constructor(private _authService: AuthService, private _router: Router, private _toastr: ToastsManager) { }
23 |
24 | onSubmit() {
25 | if (this.email != '' && this.password != '') {
26 | this._authService.signIn(this.email, this.password, (error: any) => {
27 | if (error) {
28 | this._toastr.error(error, 'Oops !')
29 | }
30 | else {
31 | this._router.navigate(['/Home']);
32 | this._toastr.success(this.email, 'Welcome back');
33 | }
34 | })
35 | } else {
36 | this._toastr.error('Thank you to complete follow areas', 'Oops!')
37 | }
38 | }
39 |
40 | ngOnInit() {
41 | this.email = '';
42 | this.password = '';
43 | }
44 | }
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator-signin/index.ts:
--------------------------------------------------------------------------------
1 | export * from './collaborator-signin.component';
--------------------------------------------------------------------------------
/src/app/+collaborator/collaborator.interface.ts:
--------------------------------------------------------------------------------
1 | export interface Collaborator {
2 | active: boolean;
3 | admin: boolean;
4 | email: string;
5 | first: string;
6 | last: string;
7 | password: string;
8 | role: string;
9 | username: string
10 | }
--------------------------------------------------------------------------------
/src/app/+collaborator/index.ts:
--------------------------------------------------------------------------------
1 | export * from './collaborator-detail';
2 | export * from './collaborator-list';
3 | export * from './collaborator-register';
4 | export * from './collaborator-reset';
5 | export * from './collaborator-signin';
6 |
--------------------------------------------------------------------------------
/src/app/+customer/customer-create/customer-create.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/+customer/customer-create/customer-create.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Router } from '@angular/router';
3 |
4 | import { DataService, ObjectToArrayPipe, TitlePageService } from '../../shared';
5 | import { Customer } from '../customer.interface';
6 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
7 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
8 | import { MD_CHECKBOX_DIRECTIVES } from '@angular2-material/checkbox';
9 | import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
10 |
11 | @Component({
12 | selector: 'customer-create',
13 | templateUrl: './app/+customer/customer-create/customer-create.component.html',
14 | directives: [MD_BUTTON_DIRECTIVES, MD_CHECKBOX_DIRECTIVES, MD_INPUT_DIRECTIVES],
15 | providers: [DataService, ObjectToArrayPipe, ToastsManager, TitlePageService]
16 | })
17 |
18 | export class CustomerCreateComponent implements OnInit {
19 | data: any;
20 | list_missions: any[];
21 | customer: Customer;
22 |
23 | constructor(
24 | private _dataService: DataService,
25 | private _router: Router,
26 | private _objectToArrayPipe: ObjectToArrayPipe,
27 | private _toastr: ToastsManager,
28 | private _titlePageService: TitlePageService) { }
29 |
30 | cancel() {
31 | this._router.navigate(['/Home/Customer']);
32 | }
33 | onSubmit() {
34 | if (this.customer.mission != '' && this.customer.name != '') {
35 | this._dataService.postDataCustomer(this.customer);
36 | this._router.navigate(['/Home/Customer']);
37 | this._toastr.success('Customer created')
38 | }
39 | else {
40 | this._toastr.error('Thank you to fill the fields', 'Oops!')
41 | }
42 | }
43 |
44 | ngOnInit() {
45 | this._titlePageService.setTitle('Create a customer');
46 |
47 | this.customer = {
48 | active: false,
49 | mission: '',
50 | name: ''
51 | }
52 |
53 | this._dataService.getAllData('mission').then((snapshot) => {
54 | this.data = snapshot.val();
55 | if (this.data != null) {
56 | Object.keys(this.data).forEach((key) => {
57 | if (!this.data[key].active) {
58 | delete this.data[key];
59 | }
60 | })
61 | }
62 | this.list_missions = this._objectToArrayPipe.transform(this.data);
63 | })
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/app/+customer/customer-create/index.ts:
--------------------------------------------------------------------------------
1 | export * from './customer-create.component'
--------------------------------------------------------------------------------
/src/app/+customer/customer-detail/customer-detail.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/+customer/customer-detail/customer-detail.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Router, ActivatedRoute } from '@angular/router';
3 |
4 | import { Customer } from '../customer.interface';
5 | import { DataService, ObjectToArrayPipe, TitlePageService } from '../../shared';
6 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
7 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
8 | import { MD_CHECKBOX_DIRECTIVES } from '@angular2-material/checkbox';
9 | import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
10 |
11 | @Component({
12 | selector: "customer-detail",
13 | templateUrl: './app/+customer/customer-detail/customer-detail.component.html',
14 | directives: [MD_BUTTON_DIRECTIVES, MD_CHECKBOX_DIRECTIVES, MD_INPUT_DIRECTIVES],
15 | providers: [DataService, ObjectToArrayPipe, ToastsManager, TitlePageService]
16 | })
17 |
18 | export class CustomerDetailComponent implements OnInit {
19 | customer: Customer;
20 | list_missions: any[];
21 | data: any;
22 | private sub: any;
23 |
24 | constructor(
25 | private _dataService: DataService,
26 | private _route: ActivatedRoute,
27 | private _router: Router,
28 | private _objecToArrayPipe: ObjectToArrayPipe,
29 | private _toastr: ToastsManager,
30 | private _titlePageService: TitlePageService) { }
31 |
32 | cancel() {
33 | this._router.navigate(['/Home/Customer']);
34 | }
35 |
36 | onSubmit() {
37 | this.sub = this._route.params.subscribe(params => {
38 | let id = params['id'];
39 | this._dataService.setDataCustomer(id, this.customer);
40 | this._router.navigate(['/Home/Customer'])
41 | this._toastr.success('Modifications saved')
42 | })
43 | }
44 |
45 | ngOnInit() {
46 | this._titlePageService.setTitle('Customer details');
47 |
48 | this.sub = this._route.params.subscribe(params => {
49 | let id = params['id'];
50 | this._dataService.getData('customer', id).then((snapshot) => {
51 | this.data = snapshot.val();
52 | this.customer = this.data;
53 | })
54 | })
55 |
56 | this._dataService.getAllData('mission').then((snapshot) => {
57 | this.data = snapshot.val();
58 | if (this.data != null) {
59 | Object.keys(this.data).forEach((key) => {
60 | if (this.data[key].name != this.customer.mission) {
61 | delete this.data[key];
62 | }
63 | })
64 | }
65 | else{
66 | this._toastr.info('no mission there . Please create a mission for this customer');
67 | }
68 | this.list_missions = this._objecToArrayPipe.transform(this.data);
69 | })
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/src/app/+customer/customer-detail/index.ts:
--------------------------------------------------------------------------------
1 | export * from './customer-detail.component';
--------------------------------------------------------------------------------
/src/app/+customer/customer-list/customer-list.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | |
6 | Name |
7 | Mission |
8 | Edit |
9 | Delete |
10 |
11 |
12 |
13 |
14 |  |
15 | {{customer.name}} |
16 | {{customer.mission}} |
17 |
18 | mode_edit
19 | |
20 |
21 |
22 | |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/app/+customer/customer-list/customer-list.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { ROUTER_DIRECTIVES } from '@angular/router';
3 |
4 | import { DataService, ObjectToArrayPipe, TitlePageService } from '../../shared';
5 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
6 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
7 |
8 | @Component({
9 | selector: 'customer-list',
10 | templateUrl: './app/+customer/customer-list/customer-list.component.html',
11 | directives: [ROUTER_DIRECTIVES, MD_BUTTON_DIRECTIVES],
12 | providers: [DataService, ObjectToArrayPipe, ToastsManager, TitlePageService]
13 | })
14 |
15 | export class CustomerListComponent implements OnInit {
16 | list_customers: any[];
17 | data: any;
18 |
19 | constructor(
20 | private _dataService: DataService,
21 | private _objectToArrayPipe: ObjectToArrayPipe,
22 | private _toastr: ToastsManager,
23 | private _titlePageService: TitlePageService) { }
24 |
25 | deleteCustomer(customer: any) {
26 | this._dataService.deleteData('customer', customer.id);
27 | this.ngOnInit();
28 | this._toastr.success('Customer deleted');
29 | }
30 |
31 | ngOnInit() {
32 | this._titlePageService.setTitle('Customers');
33 | this._dataService.getAllData('customer').then((snapshot) => {
34 | this.data = snapshot.val();
35 | this.list_customers = this._objectToArrayPipe.transform(this.data);
36 | })
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/app/+customer/customer-list/index.ts:
--------------------------------------------------------------------------------
1 | export * from './customer-list.component';
--------------------------------------------------------------------------------
/src/app/+customer/customer.interface.ts:
--------------------------------------------------------------------------------
1 | export interface Customer {
2 | active: boolean;
3 | mission: string;
4 | name: string;
5 | }
--------------------------------------------------------------------------------
/src/app/+customer/index.ts:
--------------------------------------------------------------------------------
1 | export * from './customer-create';
2 | export * from './customer-detail';
3 | export * from './customer-list';
4 |
--------------------------------------------------------------------------------
/src/app/+dashboard/dashboard-index/dashboard-index.component.html:
--------------------------------------------------------------------------------
1 |
2 |
Welcome !
3 |
Version 0.3.0
4 |
5 | - add angular2-material (new design !)
6 | - add first prototype dynamic title page
7 | - add material icon (remove font awesome)
8 | - bug fixe
9 | - delete folder JS (don't need now)
10 | - supression of some unused CSS lines (Flexbox too)
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/app/+dashboard/dashboard-index/dashboard-index.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { ROUTER_DIRECTIVES } from '@angular/router';
3 | import { MD_GRID_LIST_DIRECTIVES } from '@angular2-material/grid-list';
4 | import { MD_CARD_DIRECTIVES } from '@angular2-material/card'
5 |
6 | import { AuthService, DataService, ObjectToArrayPipe, TitlePageService } from '../../shared';
7 |
8 | @Component({
9 | selector: 'dashboard-index',
10 | templateUrl: './app/+dashboard/dashboard-index/dashboard-index.component.html',
11 | directives: [ROUTER_DIRECTIVES, MD_GRID_LIST_DIRECTIVES, MD_CARD_DIRECTIVES],
12 | providers: [DataService, TitlePageService]
13 | })
14 |
15 | export class DashboardIndexComponent implements OnInit {
16 | customersCount: number;
17 | missionsCount: number;
18 | usersCount: number;
19 | skillsCount: number;
20 | date: Date;
21 | public infos: any = {};
22 |
23 | constructor(private _dataService: DataService, private _titlePageService: TitlePageService) {
24 |
25 | this.date = new Date();
26 | this.usersCount = 0;
27 | this.missionsCount = 0;
28 | this.customersCount = 0;
29 | this.skillsCount = 0;
30 |
31 | let self = this;
32 |
33 | firebase.database().ref('collaborator/').on('value', function (data) {
34 | self.usersCount = data.numChildren();
35 | })
36 |
37 | firebase.database().ref('mission/').on('value', function (data) {
38 | self.missionsCount = data.numChildren();
39 | })
40 | firebase.database().ref('customer/').on('value', function (data) {
41 | self.customersCount = data.numChildren();
42 | })
43 | }
44 |
45 | ngOnInit() {
46 | this._titlePageService.setTitle('Dashboard');
47 |
48 | let user = firebase.auth().currentUser;
49 | ///console.log(user.uid);
50 | if (user) {
51 | this._dataService.getData('collaborator', user.uid).then((snapshot) => {
52 | this.infos = snapshot.val();
53 | //console.log(this.infos.admin);
54 | })
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/src/app/+dashboard/dashboard-index/index.ts:
--------------------------------------------------------------------------------
1 | export * from './dashboard-index.component';
--------------------------------------------------------------------------------
/src/app/+dashboard/index.ts:
--------------------------------------------------------------------------------
1 | export * from './dashboard-index';
--------------------------------------------------------------------------------
/src/app/+home/home-index/home-index.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |

6 |
7 |
8 |
{{first}} {{last}}
9 |
{{email}}
10 |
11 |
12 |
49 |
50 |
51 | Angular Dashboard keyboard_arrow_right {{title}}
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/src/app/+home/home-index/home-index.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit, Input } from '@angular/core';
2 | import { Router, ROUTER_DIRECTIVES } from '@angular/router';
3 |
4 | import { AuthService, DataService, ObjectToArrayPipe, TitlePageService } from '../../shared';
5 | import { MD_SIDENAV_DIRECTIVES } from '@angular2-material/sidenav'
6 | import { MD_TOOLBAR_DIRECTIVES } from '@angular2-material/toolbar/toolbar';
7 |
8 | @Component({
9 | selector: 'home-index',
10 | templateUrl: './app/+home/home-index/home-index.component.html',
11 | directives: [ROUTER_DIRECTIVES, MD_SIDENAV_DIRECTIVES, MD_TOOLBAR_DIRECTIVES],
12 | providers: [AuthService, DataService, ObjectToArrayPipe, TitlePageService]
13 | })
14 |
15 | export class HomeIndexComponent implements OnInit {
16 |
17 | data: any;
18 |
19 | public first: string;
20 | public last: string;
21 | public email: string;
22 | public infos: any = {};
23 | title: any;
24 |
25 | constructor(private _titlePageService: TitlePageService, private _authService: AuthService, private _dataService: DataService, private _router: Router, private _objectToArrayPipe: ObjectToArrayPipe) { }
26 |
27 | onSignOut() {
28 | this._authService.signOut();
29 | }
30 |
31 | ngOnInit() {
32 | setInterval(() => {
33 | this.title = this._titlePageService.getTitle();
34 | }, 1000)
35 |
36 | let user = firebase.auth().currentUser;
37 | if (user) {
38 | this._dataService.getData('collaborator', user.uid).then((snapshot) => {
39 | this.infos = snapshot.val();
40 | this.email = user.email;
41 |
42 | if (this.infos != null) {
43 | this.first = this.infos.first;
44 | this.last = this.infos.last;
45 | }
46 | else{
47 | console.log("infos this users doesn't exist");
48 | }
49 |
50 | })
51 | }
52 | else {
53 | console.log("this user doesn't exit");
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/app/+home/home-index/index.ts:
--------------------------------------------------------------------------------
1 | export * from './home-index.component';
--------------------------------------------------------------------------------
/src/app/+home/index.ts:
--------------------------------------------------------------------------------
1 | export * from './home-index';
2 |
--------------------------------------------------------------------------------
/src/app/+mission/index.ts:
--------------------------------------------------------------------------------
1 | export * from './mission-create';
2 | export * from './mission-detail';
3 | export * from './mission-list';
4 |
--------------------------------------------------------------------------------
/src/app/+mission/mission-create/index.ts:
--------------------------------------------------------------------------------
1 | export * from './mission-create.component';
--------------------------------------------------------------------------------
/src/app/+mission/mission-create/mission-create.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/+mission/mission-create/mission-create.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Router } from '@angular/router';
3 |
4 | import { DataService, ObjectToArrayPipe, TitlePageService } from '../../shared';
5 | import { Mission } from '../mission.interface';
6 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
7 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
8 | import { MD_CHECKBOX_DIRECTIVES } from '@angular2-material/checkbox';
9 | import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
10 |
11 | @Component({
12 | selector: 'mission-create',
13 | templateUrl: './app/+mission/mission-create/mission-create.component.html',
14 | directives: [MD_BUTTON_DIRECTIVES, MD_CHECKBOX_DIRECTIVES, MD_INPUT_DIRECTIVES],
15 | providers: [DataService, ObjectToArrayPipe, ToastsManager, TitlePageService]
16 | })
17 |
18 | export class MissionCreateComponent implements OnInit {
19 |
20 | data: any;
21 | list_collaborators: any[];
22 | mission: Mission;
23 |
24 | constructor(
25 | private _dataService: DataService,
26 | private _router: Router,
27 | private _objectToArrayPipe: ObjectToArrayPipe,
28 | private _toastr: ToastsManager,
29 | private _titlePageService: TitlePageService) { }
30 |
31 | cancel() {
32 | this._router.navigate(['/Home/Mission']);
33 | }
34 |
35 | onSubmit() {
36 | if (this.mission.name != '') {
37 | this._dataService.postDataMission(this.mission);
38 | this._router.navigate(['/Home/Mission']);
39 | }
40 | else {
41 | this._toastr.error('Thank you to fill the fields', 'Oops!')
42 | }
43 | }
44 |
45 | ngOnInit() {
46 | this._titlePageService.setTitle('Create a mission');
47 |
48 | this.mission = {
49 | active: false,
50 | name: '',
51 | description: '',
52 | dateStart: '',
53 | dateEnd: '',
54 | collaborator: '',
55 | }
56 |
57 | this._dataService.getAllData('collaborator').then((snapshot) => {
58 | this.data = snapshot.val();
59 |
60 | if (this.data != null) {
61 | Object.keys(this.data).forEach((key) => {
62 | if (!this.data[key].active) {
63 | delete this.data[key];
64 | }
65 | })
66 | }
67 |
68 | this.list_collaborators = this._objectToArrayPipe.transform(this.data);
69 | })
70 | }
71 |
72 | }
--------------------------------------------------------------------------------
/src/app/+mission/mission-detail/index.ts:
--------------------------------------------------------------------------------
1 | export * from './mission-detail.component';
--------------------------------------------------------------------------------
/src/app/+mission/mission-detail/mission-detail.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/+mission/mission-detail/mission-detail.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Router, ActivatedRoute } from '@angular/router';
3 |
4 | import { DataService, ObjectToArrayPipe, TitlePageService } from "../../shared";
5 | import { Mission } from '../mission.interface';
6 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
7 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
8 | import { MD_CHECKBOX_DIRECTIVES } from '@angular2-material/checkbox';
9 | import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
10 |
11 | @Component({
12 | selector: "mission-detail",
13 | templateUrl: '/app/+mission/mission-detail/mission-detail.component.html',
14 | directives: [MD_BUTTON_DIRECTIVES, MD_CHECKBOX_DIRECTIVES, MD_INPUT_DIRECTIVES],
15 | providers: [DataService, ObjectToArrayPipe, ToastsManager, TitlePageService]
16 | })
17 |
18 | export class MissionDetailComponent implements OnInit {
19 | date: Date;
20 | date1: Date;
21 | date2: Date;
22 | data: any;
23 | list_collaborators: any[];
24 | mission: Mission;
25 | private sub; any;
26 |
27 | constructor(
28 | private _dataService: DataService,
29 | private _router: Router,
30 | private _route: ActivatedRoute,
31 | private _objecToArray: ObjectToArrayPipe,
32 | private _toastr: ToastsManager,
33 | private _titlePageService: TitlePageService) {
34 |
35 | }
36 |
37 | cancel() {
38 | this._router.navigate(['/Home/Mission']);
39 | }
40 |
41 | onSubmit() {
42 | this.sub = this._route.params.subscribe(params => {
43 | let id = params['id'];
44 | this._dataService.setDataMission(id, this.mission);
45 | this._router.navigate(['/Home/Mission']);
46 | this._toastr.success('modifications saved');
47 | })
48 | }
49 |
50 | ngOnInit() {
51 | this._titlePageService.setTitle('Mission details');
52 |
53 | this.sub = this._route.params.subscribe(params => {
54 | let id = params['id'];
55 | this._dataService.getData('mission', id).then((snapshot) => {
56 | this.data = snapshot.val();
57 | this.mission = this.data;
58 |
59 | this.date = new Date();
60 | this.date1 = new Date(this.mission.dateStart)
61 | this.date2 = new Date(this.mission.dateEnd);
62 | if (this.date >= this.date1 && this.date <= this.date2) {
63 | this.mission.active = true;
64 | console.log('mission active')
65 | }
66 | else {
67 | this.mission.active = false;
68 | console.log('mission not actived')
69 | }
70 | })
71 | })
72 |
73 | this._dataService.getAllData('collaborator').then((snapshot) => {
74 | this.data = snapshot.val();
75 | if (this.data != null) {
76 | Object.keys(this.data).forEach((key) => {
77 | if (!this.data[key].active) {
78 | delete this.data[key];
79 | }
80 | })
81 | }
82 | else {
83 | this._toastr.info("no employee exists. please create a collaborator to assign it to a mission");
84 | }
85 |
86 | this.list_collaborators = this._objecToArray.transform(this.data);
87 | })
88 |
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/src/app/+mission/mission-list/index.ts:
--------------------------------------------------------------------------------
1 | export * from './mission-list.component';
--------------------------------------------------------------------------------
/src/app/+mission/mission-list/mission-list.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # |
6 | {{'project.table-name' | translate}} |
7 | Active |
8 | {{'generic.table-edit' | translate}} |
9 | {{'generic.table-delete' | translate}} |
10 |
11 |
12 |
13 |
14 | {{i}} |
15 | {{mission.name}} |
16 | {{mission.active}} |
17 | mode_edit |
18 | |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/app/+mission/mission-list/mission-list.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { ROUTER_DIRECTIVES } from '@angular/router';
3 |
4 | import { DataService, ObjectToArrayPipe, TitlePageService } from "../../shared";
5 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
6 |
7 | @Component({
8 | selector: 'mission-list',
9 | templateUrl: './app/+mission/mission-list/mission-list.component.html',
10 | directives: [ROUTER_DIRECTIVES, MD_BUTTON_DIRECTIVES],
11 | providers: [DataService, ObjectToArrayPipe, TitlePageService]
12 | })
13 |
14 | export class MissionListComponent implements OnInit {
15 | list_missions: any[];
16 | data: any;
17 |
18 | constructor(
19 | private _dataService: DataService,
20 | private _objectToArrayPipe: ObjectToArrayPipe,
21 | private _titlePageService: TitlePageService) { }
22 |
23 | deleteMission(mission: any) {
24 | console.log(mission.id);
25 | this._dataService.deleteData('mission',mission.id);
26 | this.ngOnInit();
27 | }
28 |
29 | ngOnInit() {
30 | this._titlePageService.setTitle('Missions');
31 | this._dataService.getAllData('mission').then((snapshot) => {
32 | this.data = snapshot.val();
33 | this.list_missions = this._objectToArrayPipe.transform(this.data);
34 | })
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/app/+mission/mission.interface.ts:
--------------------------------------------------------------------------------
1 | export interface Mission {
2 | active: boolean;
3 | name: string;
4 | description: string;
5 | dateStart: string;
6 | dateEnd: string;
7 | collaborator: string;
8 | }
9 |
--------------------------------------------------------------------------------
/src/app/+role/index.ts:
--------------------------------------------------------------------------------
1 | export * from './role-create';
2 | export * from './role-list';
3 | //export * from './role-view;
--------------------------------------------------------------------------------
/src/app/+role/role-create/index.ts:
--------------------------------------------------------------------------------
1 | export * from './role-create.component';
--------------------------------------------------------------------------------
/src/app/+role/role-create/role-create.component.html:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/src/app/+role/role-create/role-create.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Router } from '@angular/router';
3 |
4 | import { DataService, TitlePageService } from "../../shared";
5 | import { Role } from '../role.interface';
6 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
7 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
8 | import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
9 |
10 | @Component({
11 | selector: 'role-create',
12 | templateUrl: './app/+role/role-create/role-create.component.html',
13 | directives: [MD_BUTTON_DIRECTIVES, MD_INPUT_DIRECTIVES],
14 | providers: [DataService, ToastsManager, TitlePageService]
15 | })
16 |
17 | export class RoleCreateComponent implements OnInit {
18 |
19 | role: Role;
20 |
21 | constructor(private _dataService: DataService, private _router: Router, private _toastr: ToastsManager, private _titlePageService: TitlePageService) { }
22 |
23 | cancel(){
24 | this._router.navigate(['/Home/Role'])
25 |
26 | }
27 | onSubmit() {
28 | if (this.role.name != '') {
29 | this._dataService.postDataRole(this.role);
30 | this._router.navigate(['/Home/Role'])
31 | this._toastr.success('Role created')
32 | }
33 | else {
34 | this._toastr.error('Thank you to fill the field', 'Oops!')
35 | }
36 | }
37 |
38 | ngOnInit() {
39 | this._titlePageService.setTitle('Create a role');
40 | this.role = {
41 | name: ''
42 | }
43 | }
44 | }
--------------------------------------------------------------------------------
/src/app/+role/role-list/index.ts:
--------------------------------------------------------------------------------
1 | export * from './role-list.component';
--------------------------------------------------------------------------------
/src/app/+role/role-list/role-list.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # |
6 | name |
7 | Delete |
8 |
9 |
10 |
11 |
12 | {{i}} |
13 | {{role.name}} |
14 |
15 |
16 | |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/app/+role/role-list/role-list.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { ROUTER_DIRECTIVES } from '@angular/router';
3 |
4 | import { DataService, ObjectToArrayPipe, TitlePageService } from "../../shared";
5 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
6 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
7 |
8 | @Component({
9 | selector: 'role-list',
10 | templateUrl: './app/+role/role-list/role-list.component.html',
11 | directives: [ROUTER_DIRECTIVES, MD_BUTTON_DIRECTIVES],
12 | providers: [DataService, ObjectToArrayPipe, ToastsManager]
13 | })
14 |
15 | export class RoleListComponent implements OnInit {
16 | list_roles: any[];
17 | data: any;
18 |
19 | constructor(private _dataService: DataService, private _objectToArrayPipe: ObjectToArrayPipe, private _toastr: ToastsManager, private _titlePageService: TitlePageService) { }
20 |
21 | deleteRole(role: any) {
22 | this._dataService.deleteData('role',role.id);
23 | this.ngOnInit();
24 | this._toastr.success('role deleted');
25 | }
26 |
27 | ngOnInit() {
28 | this._titlePageService.setTitle('Roles');
29 | this._dataService.getAllData('role').then((snapshot) => {
30 | this.data = snapshot.val();
31 | this.list_roles = this._objectToArrayPipe.transform(this.data);
32 | })
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/app/+role/role.interface.ts:
--------------------------------------------------------------------------------
1 | export interface Role {
2 | name: string;
3 | }
--------------------------------------------------------------------------------
/src/app/+setting/index.ts:
--------------------------------------------------------------------------------
1 | export * from './setting-index';
--------------------------------------------------------------------------------
/src/app/+setting/setting-index/index.ts:
--------------------------------------------------------------------------------
1 | export * from './setting-index.component';
--------------------------------------------------------------------------------
/src/app/+setting/setting-index/setting-index.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/+setting/setting-index/setting-index.component.ts:
--------------------------------------------------------------------------------
1 | import { FORM_DIRECTIVES, Control } from '@angular/common';
2 | import { Component } from '@angular/core';
3 |
4 | import { TranslateService } from 'ng2-translate/ng2-translate';
5 | import { MD_SLIDE_TOGGLE_DIRECTIVES } from '@angular2-material/slide-toggle';
6 | import { TitlePageService } from '../../shared';
7 |
8 | @Component({
9 | selector: 'setting-index',
10 | templateUrl: './app/+setting/setting-index/setting-index.component.html',
11 | directives: [FORM_DIRECTIVES, MD_SLIDE_TOGGLE_DIRECTIVES],
12 | providers: [TitlePageService]
13 | })
14 |
15 | export class SettingIndexComponent {
16 | language: Control = new Control(false);
17 |
18 | constructor(private _translate: TranslateService, private _titlePageService: TitlePageService) {
19 | this._titlePageService.setTitle('Settings');
20 | }
21 |
22 | changeLanguage(value) {
23 | if (value) {
24 | this._translate.use('en');
25 | } else {
26 | this._translate.use('fr');
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/src/app/+skill/index.ts:
--------------------------------------------------------------------------------
1 | export * from './skill-create';
2 | export * from './skill-detail';
3 | export * from './skill-list';
4 |
--------------------------------------------------------------------------------
/src/app/+skill/skill-create/index.ts:
--------------------------------------------------------------------------------
1 | export * from './skill-create.component';
--------------------------------------------------------------------------------
/src/app/+skill/skill-create/skill-create.component.html:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/src/app/+skill/skill-create/skill-create.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Router } from '@angular/router';
3 |
4 | import { Skill } from '../skill.interface';
5 | import { DataService, TitlePageService } from '../../shared';
6 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
7 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
8 | import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
9 |
10 | @Component({
11 | selector: 'skill-create',
12 | templateUrl: './app/+skill/skill-create/skill-create.component.html',
13 | directives: [MD_BUTTON_DIRECTIVES, MD_INPUT_DIRECTIVES],
14 | providers: [DataService, ToastsManager, TitlePageService]
15 | })
16 |
17 | export class SkillCreateComponent implements OnInit {
18 | skill: Skill;
19 |
20 | constructor(private _dataService: DataService, private _router: Router, private _toastr: ToastsManager, private _titlePageService: TitlePageService) { }
21 |
22 | cancel() {
23 | this._router.navigate(['/Home/Skill'])
24 | }
25 | onSubmit() {
26 | if (this.skill.name != '') {
27 | this._dataService.postData('skill', this.skill);
28 | this._router.navigate(['/Home/Skill'])
29 | this._toastr.success('Skill created')
30 | }
31 | else {
32 | this._toastr.error('Thank you to fill the field', 'Oops!')
33 | }
34 | }
35 |
36 | ngOnInit() {
37 | this._titlePageService.setTitle('Create a skill');
38 | this.skill = {
39 | name: ''
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/src/app/+skill/skill-detail/index.ts:
--------------------------------------------------------------------------------
1 | export * from './skill-detail.component';
--------------------------------------------------------------------------------
/src/app/+skill/skill-detail/skill-detail.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/+skill/skill-detail/skill-detail.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Router, ActivatedRoute } from '@angular/router';
3 |
4 | import { DataService, TitlePageService } from '../../shared';
5 | import { Skill } from '../skill.interface';
6 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
7 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
8 | import { MD_INPUT_DIRECTIVES } from '@angular2-material/input';
9 |
10 | @Component({
11 | selector: "skill-detail",
12 | templateUrl: './app/+skill/skill-detail/skill-detail.component.html',
13 | directives: [MD_BUTTON_DIRECTIVES, MD_INPUT_DIRECTIVES],
14 | providers: [DataService, ToastsManager, TitlePageService]
15 | })
16 |
17 | export class SkillDetailComponent implements OnInit {
18 | list_skills: any[];
19 | data: any;
20 | private sub: any;
21 | skill: Skill;
22 |
23 | constructor(private _dataService: DataService, private _router: Router, private _route: ActivatedRoute, private _toastr: ToastsManager, private _titlePageService: TitlePageService) { }
24 |
25 | cancel() {
26 | this._router.navigate(['/Home/Skill']);
27 | }
28 | onSubmit() {
29 | this.sub = this._route.params.subscribe(params => {
30 | let id = params['id'];
31 | this._dataService.setDataSkill(id, this.list_skills);
32 | this._router.navigate(['/Home/Skill'])
33 | this._toastr.success('Modifications saved')
34 | })
35 | }
36 | ngOnInit() {
37 | this._titlePageService.setTitle('Skill details');
38 | this.sub = this._route.params.subscribe(params => {
39 | let id = params['id'];
40 | this._dataService.getData('skill', id).then((snapshot) => {
41 | this.data = snapshot.val();
42 | this.list_skills = this.data;
43 | })
44 | })
45 | }
46 | }
--------------------------------------------------------------------------------
/src/app/+skill/skill-list/index.ts:
--------------------------------------------------------------------------------
1 | export * from './skill-list.component';
--------------------------------------------------------------------------------
/src/app/+skill/skill-list/skill-list.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # |
6 | Name |
7 | Edit |
8 | Delete |
9 |
10 |
11 |
12 |
13 | {{i}} |
14 | {{skill.name}} |
15 |
16 | mode_edit
17 | |
18 |
19 |
20 | |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/app/+skill/skill-list/skill-list.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { ROUTER_DIRECTIVES} from '@angular/router';
3 |
4 | import { DataService, ObjectToArrayPipe, TitlePageService } from '../../shared';
5 | import { ToastsManager } from 'ng2-toastr/ng2-toastr';
6 | import { MD_BUTTON_DIRECTIVES } from '@angular2-material/button';
7 |
8 | @Component({
9 | selector: 'skill-list',
10 | templateUrl: './app/+skill/skill-list/skill-list.component.html',
11 | directives: [ROUTER_DIRECTIVES, MD_BUTTON_DIRECTIVES],
12 | providers: [DataService, ObjectToArrayPipe, ToastsManager, TitlePageService]
13 | })
14 |
15 | export class SkillListComponent implements OnInit {
16 | list_skills: any[];
17 | data: any;
18 |
19 | constructor(private _dataService: DataService, private _objectToArrayPipe: ObjectToArrayPipe, private _toastr: ToastsManager, private _titlePAgeService: TitlePageService) { }
20 |
21 | deleteData(skill: any) {
22 | this._dataService.deleteData('skill',skill.id);
23 | this.ngOnInit();
24 | this._toastr.success('Skill deleted');
25 | }
26 | ngOnInit() {
27 | this._titlePAgeService.setTitle('Skills');
28 | this._dataService.getAllData('skill').then((snapshot) => {
29 | this.data = snapshot.val();
30 | this.list_skills = this._objectToArrayPipe.transform(this.data);
31 | })
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/app/+skill/skill.interface.ts:
--------------------------------------------------------------------------------
1 | export interface Skill {
2 | name:string
3 | }
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Router, ROUTER_DIRECTIVES } from '@angular/router';
3 |
4 | import { TranslateService, TranslatePipe } from 'ng2-translate/ng2-translate';
5 |
6 | @Component({
7 | selector: 'my-app',
8 | templateUrl: './app/app.component.html',
9 | directives: [ROUTER_DIRECTIVES]
10 | })
11 |
12 | export class AppComponent implements OnInit {
13 |
14 | constructor(private _router: Router, private _translate: TranslateService) { }
15 |
16 | ngOnInit() {
17 | this._translate.setDefaultLang('en');
18 | this._translate.use('en');
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/app/app.routes.ts:
--------------------------------------------------------------------------------
1 | import { provideRouter, RouterConfig } from '@angular/router';
2 | import { AuthGuard } from './shared';
3 | import {
4 | CollaboratorListComponent,
5 | CollaboratorRegisterComponent,
6 | CollaboratorResetComponent,
7 | CollaboratorSignInComponent,
8 | CollaboratorDetailComponent,
9 | CustomerCreateComponent,
10 | CustomerListComponent,
11 | CustomerDetailComponent,
12 | DashboardIndexComponent,
13 | HomeIndexComponent,
14 | MissionCreateComponent,
15 | MissionListComponent,
16 | MissionDetailComponent,
17 | RoleListComponent,
18 | RoleCreateComponent,
19 | SettingIndexComponent,
20 | SkillListComponent,
21 | SkillCreateComponent,
22 | SkillDetailComponent,
23 | }from './';
24 |
25 | export const APP_ROUTES: RouterConfig = [
26 | //{ path: 'SignIn', component: CollaboratorSignInComponent },
27 | { path: 'Reset-password', component: CollaboratorResetComponent},
28 | { path: '', component: CollaboratorSignInComponent },
29 | {
30 | path: 'Home', component: HomeIndexComponent, canActivate: [AuthGuard],
31 | children: [
32 | { path: '', component: DashboardIndexComponent },
33 | { path: 'Mission', component: MissionListComponent },
34 | { path: 'CreateMission', component: MissionCreateComponent },
35 | { path: 'DetailMission/:id', component: MissionDetailComponent },
36 | { path: 'Collaborator', component: CollaboratorListComponent, data: {admin: true} },
37 | { path: 'Register', component: CollaboratorRegisterComponent },
38 | { path: 'DetailCollaborator/:id', component: CollaboratorDetailComponent },
39 | { path: 'Customer', component: CustomerListComponent },
40 | { path: 'CreateCustomer', component: CustomerCreateComponent },
41 | { path: 'DetailCustomer/:id', component: CustomerDetailComponent },
42 | { path: 'Setting', component: SettingIndexComponent },
43 | { path: 'Skill', component: SkillListComponent },
44 | { path: 'CreateSkill', component: SkillCreateComponent },
45 | { path: 'DetailSkill/:id', component: SkillDetailComponent },
46 | { path: 'Role', component: RoleListComponent },
47 | { path: 'CreateRole', component: RoleCreateComponent }
48 | ]
49 | },
50 | { path: '**', redirectTo: '/Home', pathMatch: 'full'}
51 | ]
52 |
53 | export const appRouterProviders = [
54 | provideRouter(APP_ROUTES)
55 | ];
--------------------------------------------------------------------------------
/src/app/index.ts:
--------------------------------------------------------------------------------
1 | export * from './+collaborator';
2 | export * from './+customer';
3 | export * from './+dashboard';
4 | export * from './+mission';
5 | export * from './+role';
6 | export * from './+setting';
7 | export * from './+skill';
8 | export * from './shared';
9 | export * from './+home';
10 | export { AppComponent } from './app.component';
11 |
--------------------------------------------------------------------------------
/src/app/main.ts:
--------------------------------------------------------------------------------
1 | import { provide, PLATFORM_PIPES, enableProdMode } from '@angular/core';
2 | import { HTTP_PROVIDERS, Http } from '@angular/http';
3 | import { bootstrap } from '@angular/platform-browser-dynamic';
4 | import { disableDeprecatedForms, provideForms } from '@angular/forms';
5 |
6 |
7 | import { appRouterProviders } from './app.routes';
8 | import { AppComponent } from './app.component';
9 | import { TranslateLoader, TranslateStaticLoader, TRANSLATE_PROVIDERS, TranslateService, TranslatePipe } from 'ng2-translate/ng2-translate';
10 |
11 | import { AuthGuard } from './shared';
12 |
13 | enableProdMode();
14 |
15 | bootstrap(AppComponent, [
16 | appRouterProviders,
17 | AuthGuard,
18 | HTTP_PROVIDERS,
19 | disableDeprecatedForms(),
20 | provideForms(),
21 | TRANSLATE_PROVIDERS,
22 | TranslateService,
23 | provide(TranslateLoader, { useFactory: (http: Http) => new TranslateStaticLoader(http, 'assets/i18n', '.json'), deps: [Http] }),
24 | provide(PLATFORM_PIPES, { useValue: [TranslatePipe], multi: true })
25 | ])
26 | .catch(err => console.error(err));
27 |
28 |
--------------------------------------------------------------------------------
/src/app/shared/index.ts:
--------------------------------------------------------------------------------
1 | export * from './pipes';
2 | export * from './services';
--------------------------------------------------------------------------------
/src/app/shared/pipes/index.ts:
--------------------------------------------------------------------------------
1 | export * from './object-to-array.pipe';
--------------------------------------------------------------------------------
/src/app/shared/pipes/object-to-array.pipe.ts:
--------------------------------------------------------------------------------
1 | import { Pipe, PipeTransform } from '@angular/core';
2 |
3 | @Pipe({name: 'objectoToArray'})
4 |
5 | export class ObjectToArrayPipe implements PipeTransform {
6 | transform(value: any): Object[] {
7 | let dataArr: any[] = [];
8 |
9 | if(value != undefined && value != null){
10 | Object.keys(value).forEach(function(key){
11 | value[key].id = key;
12 | dataArr.push(value[key]);
13 | })
14 | }
15 | return dataArr;
16 | }
17 | }
--------------------------------------------------------------------------------
/src/app/shared/services/auth.guard.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';
3 | import { Observable } from 'rxjs/Rx';
4 | import { DataService } from './';
5 | import { ObjectToArrayPipe } from '../';
6 |
7 | @Injectable()
8 |
9 | export class AuthGuard implements CanActivate {
10 |
11 | public infos = {};
12 | constructor( private _router: Router) { }
13 |
14 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | boolean {
15 | //if(!this.isAuthenticated()) return false;
16 | return this.isAuthenticated();
17 |
18 | /*if(route.data['admin']){
19 |
20 | }*/
21 | }
22 |
23 | isAuthenticated() {
24 | let user = firebase.auth().currentUser;
25 | //console.log(user);
26 | if (user) {
27 | console.log('connected');
28 | return true;
29 | } else {
30 | console.log('not connected');
31 | this._router.navigate(['']);
32 | return false;
33 | }
34 | }
35 | isAdmin(info: any) {
36 | /*let self = this;
37 | firebase.database().ref('collaborator/' + info.uid).once('value').then(function (snapshot) {
38 | self.infos = snapshot.val();
39 | console.log(self.infos);
40 | if (self.infos.admin == true) {
41 | return true
42 | }
43 | else {
44 | //this._router.navigate(['Home']);
45 | return false
46 | }
47 | })*/
48 | }
49 | }
--------------------------------------------------------------------------------
/src/app/shared/services/auth.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Router } from '@angular/router';
3 |
4 | import { Collaborator } from '../../+collaborator/collaborator.interface'
5 |
6 | declare var firebase: any;
7 |
8 | @Injectable()
9 |
10 | export class AuthService {
11 | constructor(private _router: Router) { }
12 |
13 |
14 | signIn(email: string, password: string, callback: any) {
15 | firebase.auth().signInWithEmailAndPassword(email, password).then(
16 | (user: any) => callback(),
17 | (error: any) => callback(error)
18 | );
19 | }
20 |
21 | signOut() {
22 | let self = this;
23 | firebase.auth().signOut().then(function () {
24 | self._router.navigate(['']);
25 | }), function (error) {
26 | console.log(error)
27 | }
28 |
29 | }
30 |
31 | signUp(collaborator: any) {
32 | firebase.auth().createUserWithEmailAndPassword(collaborator.email, collaborator.password).then(
33 | (collaborator: any) => this.createUserResume(collaborator.uid, collaborator)
34 |
35 | )
36 | }
37 | sendPasswordResetEmail(email: string, callback: any) {
38 | firebase.auth().sendPasswordResetEmail(email).then(
39 | () => callback(),
40 | (error: any) => callback(error)
41 | );
42 | }
43 |
44 | /*
45 | createUser(userDetails: any) {
46 | firebase.auth().createUserWithEmailAndPassword(userDetails.email, userDetails.password).then(
47 | (user: any) => this.createUserResume(user.uid, userDetails)
48 |
49 | )
50 | }
51 | */
52 |
53 | private createUserResume(uid: string, userDetails: any) {
54 | //console.log(userDetails.password);
55 | this.signIn(userDetails.email, userDetails.password, (error: any) => {
56 | firebase.database().ref('collaborator').child(uid).set({
57 | active: true, admin: false, first: userDetails.first,last: userDetails.last,username: userDetails.username,role: userDetails.role,email: userDetails.email
58 | });
59 |
60 | });
61 | }
62 |
63 | isAuthenticated() {
64 | let user = firebase.auth().currentUser;
65 | if (user) {
66 | return true;
67 | } else {
68 | return false;
69 | }
70 | }
71 | }
--------------------------------------------------------------------------------
/src/app/shared/services/data.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Observable } from 'rxjs/Observable';
3 |
4 | declare var firebase: any;
5 |
6 | @Injectable()
7 |
8 | export class DataService {
9 |
10 | constructor() { }
11 |
12 | //Common
13 | postData(category: string, detail: any) {
14 | firebase.database().ref(category).push({ name: detail.name })
15 | }
16 | getData(category: string, id: string) {
17 | return firebase.database().ref(category + '/' + id).once('value');
18 | }
19 | getAllData(category: string) {
20 | return firebase.database().ref(category).once('value');
21 | // firebase.database().ref('collaborator').orderByChild('username').on('child_added'
22 | }
23 | setData(category: string, id: string, detail: any) {
24 | firebase.database().ref(category + '/' + id).set({ name: detail.name, role: detail.role });
25 | }
26 | deleteData(category: string, id: string) {
27 | firebase.database().ref(category + '/' + id).remove();
28 | }
29 |
30 | //Collaborator
31 | setDataCollaborator(id: string, Detail: any) {
32 | firebase.database().ref('collaborator/' + id).set({
33 | active: Detail.active,
34 | admin: Detail.admin,
35 | email: Detail.email,
36 | first: Detail.first,
37 | last: Detail.last,
38 | username: Detail.username,
39 | role: Detail.role
40 | });
41 | }
42 |
43 | //Customer
44 | postDataCustomer(Detail: any) {
45 | return firebase.database().ref('customer/').push({
46 | active: Detail.active,
47 | mission: Detail.mission,
48 | name: Detail.name
49 | })
50 | }
51 | setDataCustomer(id: string, Detail: any) {
52 | firebase.database().ref('customer/' + id).set({
53 | active: Detail.active,
54 | mission: Detail.mission,
55 | name: Detail.name
56 | });
57 | }
58 |
59 | //Mission
60 | postDataMission(Detail: any) {
61 | firebase.database().ref('mission/').push({
62 | active: Detail.active,
63 | name: Detail.name,
64 | description: Detail.description,
65 | dateStart: Detail.dateStart,
66 | dateEnd: Detail.dateEnd,
67 | collaborator: Detail.collaborator
68 | })
69 | }
70 | setDataMission(id: string, Detail: any) {
71 | firebase.database().ref('mission/' + id).set({
72 | active: Detail.active,
73 | name: Detail.name,
74 | description: Detail.description,
75 | dateStart: Detail.dateStart,
76 | dateEnd: Detail.dateEnd,
77 | collaborator: Detail.collaborator
78 | })
79 | }
80 |
81 | //Role
82 | postDataRole(Detail: any) {
83 | firebase.database().ref('role/').push({ name: Detail.name })
84 | //firebase.database().ref('role/').child('id').push({name})
85 | }
86 | //Skill
87 | setDataSkill(id: string, Detail: any) {
88 | firebase.database().ref('skill/' + id).set({ name: Detail.name })
89 | }
90 |
91 | //test
92 | Oderby(category: string) {
93 | return firebase.database().ref(category).orderByChild('username').on('child_added')
94 | //, function (snapshot) {
95 | // console.log(snapshot.val());
96 | }
97 |
98 | }
--------------------------------------------------------------------------------
/src/app/shared/services/index.ts:
--------------------------------------------------------------------------------
1 | export * from './auth.guard';
2 | export * from './auth.service';
3 | export * from './data.service';
4 | export * from './title-page.service';
--------------------------------------------------------------------------------
/src/app/shared/services/title-page.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable, Input } from '@angular/core';
2 | import { Observable } from 'rxjs/Observable';
3 |
4 |
5 | @Injectable()
6 |
7 | export class TitlePageService {
8 | constructor() { }
9 |
10 | title: string;
11 | //public title: any = 'default title';
12 |
13 | //let self = this;
14 | getTitle() {
15 | return localStorage.getItem('title');
16 |
17 |
18 | //return this.title;
19 |
20 | }
21 | setTitle(newTitle) {
22 | this.title = newTitle;
23 | localStorage.removeItem('title');
24 | localStorage.setItem('title', this.title);
25 | }
26 | }
--------------------------------------------------------------------------------
/src/assets/css/styles.css:
--------------------------------------------------------------------------------
1 | body,
2 | html {
3 | overflow-x: hidden;
4 | margin: 0;
5 | padding: 0;
6 | width: 100%;
7 | height: 100%;
8 | background: #FFF;
9 | color: #424242;
10 | font-size: 14px;
11 | font-family: 'Roboto', sans-serif;
12 | line-height: 26px;
13 | }
14 |
15 |
16 | /*
17 | * COMMON *
18 | */
19 |
20 | a {
21 | color: rgb(255,87,34);
22 | text-decoration: none;
23 | }
24 |
25 |
26 | /*
27 | * image *
28 | */
29 |
30 | .cl-circle {
31 | width: 100%;
32 | height: auto;
33 | border: 2px solid #FFF;
34 | border-radius: 50%;
35 | }
36 |
37 |
38 | /*
39 | * title *
40 | */
41 |
42 |
43 | h4 {
44 | font-size: 18px;
45 | color: #505458;
46 | }
47 |
48 | /*
49 | * BOOTSTRAP *
50 | */
51 |
52 | #container__spinner {
53 | display: flex;
54 | flex-direction: column;
55 | justify-content: center;
56 | min-height: 100vh;
57 | color: #F44336;
58 | }
59 |
60 | .spinner__icon {
61 | margin: auto auto 5px;
62 | }
63 |
64 | .spinner__txt {
65 | margin: 5px auto auto;
66 | }
67 |
68 | /*
69 | * LOGIN *
70 | */
71 |
72 | .login {
73 | padding: 40px 0;
74 | height: auto;
75 | text-align: center;
76 | }
77 |
78 | .login form {
79 | margin-top: 20px;
80 | }
81 |
82 | form .form-control:focus {
83 | border-color: #F44336 !important;
84 | box-shadow: none;
85 | }
86 |
87 | .login h2 {
88 | margin-top: 20px;
89 | color: #FFF;
90 | text-align: center;
91 | }
92 |
93 | .login .btn {
94 | margin-bottom: 15px;
95 | width: 100%;
96 | border: 1px solid #F44336;
97 | background-color: #F44336;
98 | color: #FFF;
99 | font-size: 18px;
100 | }
101 |
102 | .login__img {
103 | width: 200px;
104 | height: 200px;
105 | }
106 |
107 | .login__error {
108 | margin: 10px;
109 | color: #F44336;
110 | letter-spacing: 1px;
111 | font-size: 18px;
112 | }
113 |
114 |
115 | /*
116 | * TEAMS | mission | CUSTOMER
117 | */
118 |
119 |
120 | home-index .row:nth-child(4),
121 | role-list .row:nth-child(2),
122 | skill-list .row:nth-child(2),
123 | customer-list .row:nth-child(2),
124 | mission-list .row:nth-child(2),
125 | collaborator-list .row:nth-child(2) {
126 | position: relative;
127 | margin-top: 100px;
128 | }
129 |
130 | home-index .btn-floating,
131 | role-list .btn-floating,
132 | skill-list .btn-floating,
133 | customer-list .btn-floating,
134 | collaborator-list .btn-floating,
135 | mission-list .btn-floating {
136 | position: absolute;
137 | right: 0;
138 | bottom: 0;
139 | margin: 20px;
140 | }
141 |
142 | home-index a,
143 | home-index button,
144 | role-list a,
145 | role-list button,
146 | skill-list a,
147 | skill-list button,
148 | customer-list a,
149 | customer-list button,
150 | mission-list a,
151 | mission-list button,
152 | collaborator-list a,
153 | collaborator-list button {
154 | border: none;
155 | background: transparent;
156 | color: rgb(255,87,34);
157 | cursor: pointer;
158 | outline: 0;
159 | }
160 |
161 |
162 |
163 | customer-list img,
164 | collaborator-list img {
165 | width: 60px !important;
166 | }
167 |
168 | table {
169 | width: 100%;
170 | border-spacing: 0;
171 | box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12);
172 | font-size: 13px;
173 | }
174 |
175 | th {
176 | padding: 0 56px 0 24px;
177 | height: 56px;
178 | border-bottom: 1px solid rgba(0, 0, 0, 0.12);
179 | color: rgba(0, 0, 0, .54);
180 | text-align: left;
181 | font-weight: 500;
182 | }
183 |
184 | tbody > tr:hover {
185 | background-color: #EEE;
186 | }
187 |
188 | tr {
189 | height: 48px;
190 | }
191 |
192 | tr:last-child td {
193 | border-bottom: none;
194 | }
195 |
196 | td {
197 | padding: 0 56px 0 24px;
198 | height: 48px;
199 | border-bottom: 1px solid rgba(0, 0, 0, 0.12);
200 | }
201 |
202 | td:nth-child(2) {
203 | color: #F44336;
204 | text-transform: uppercase;
205 | }
206 |
207 |
208 | /*
209 | * home-index *
210 | */
211 |
212 |
213 | .card-banner-header {
214 | padding: 12px;
215 | background: #424242;
216 | color: #FFF;
217 | }
218 |
219 | .card-content {
220 | min-height: 120px;
221 | padding: 16px;
222 | }
223 |
224 | .card-content h2 {
225 | font-size: 20px;
226 | font-weight: 500;
227 | margin-bottom: 8px;
228 | }
229 |
230 | .card-content p {
231 | color: rgba(0, 0, 0, 0.54);
232 | font-size: 13px;
233 | line-height: 20px;
234 | }
235 |
236 | .card-link {
237 | padding: 4px 4px 4px 16px;
238 | min-height: 44px;
239 | }
240 |
241 | .card-link a {
242 | font-size: 14px;
243 | line-height: 20px;
244 | padding: 8px 0;
245 | }
246 |
247 | .col-md-3:nth-child(4) .cl-home__item {
248 | background-color: #FF7043;
249 | }
250 |
251 | .cl-home__item {
252 | position: relative;
253 | overflow: hidden;
254 | margin: 20px 0 50px;
255 | padding: 30px 20px;
256 | border-radius: 2px;
257 | background-color: #424242;
258 | }
259 |
260 | .cl-home__item > .fa {
261 | position: absolute;
262 | bottom: -20%;
263 | left: -5%;
264 | color: rgba(255, 255, 255, 0.15);
265 | font-size: 100px;
266 | }
267 |
268 | .cl-home__item h3 {
269 | margin: 0;
270 | text-align: right;
271 | font-size: 36px;
272 | color: white;
273 | }
274 |
275 | .cl-home__item h3 > small {
276 | display: block;
277 | font-size: 17px;
278 | text-transform: capitalize;
279 | color: rgba(255, 255, 255, 0.7);
280 | }
281 |
282 |
283 | /*
284 | * RESPONSIVE
285 | */
286 |
287 | @media screen and (min-width: 480px) {
288 | .login {
289 | margin: 40px auto;
290 | max-width: 500px;
291 | width: 400px;
292 | }
293 | }
294 |
295 | @media screen and (max-width:480px) {
296 | header h1 {
297 | text-align: center;
298 | margin-left: inherit;
299 | }
300 | .login {
301 | width: 50vw;
302 | margin: 0 auto;
303 | }
304 | .login__img {
305 | width: 100px;
306 | height: 100px;
307 | }
308 | .container {
309 | padding: 0px;
310 | }
311 | table {
312 | box-shadow: none;
313 | }
314 | table th,
315 | table td {
316 | padding: 0;
317 | }
318 | }
319 |
320 | @media (min-width: 768px) {}
321 |
322 | @media screen and (max-width:768px) {
323 | .sidebar ul li:nth-child(n+2) {
324 | /* display: none;*/
325 | }
326 | header h1 {
327 | text-align: center;
328 | margin-left: inherit;
329 | }
330 | home {
331 | display: block;
332 | }
333 | .container {
334 | margin-top: 0;
335 | }
336 | .flex-container {
337 | display: block;
338 | }
339 | th:nth-child(4n-7),
340 | td:nth-child(4n-7) {
341 | display: none;
342 | }
343 | }
344 |
345 | @media only screen and (max-width:970px) {
346 | header h1 {
347 | text-align: center;
348 | margin-left: inherit;
349 | }
350 | }
351 |
352 | @media (min-width: 1200px) {}
353 |
354 | /*
355 | * NEW CSS 03/08/2016 *
356 | */
357 |
358 | /* NAVIGATION */
359 |
360 | .mdl-navigation > a {
361 | font-weight: 500;
362 | }
363 | .mdl-navigation > a > span {
364 | margin-left: 24px;
365 | color: #37474F;
366 | }
367 | .mdl-navigation > a:nth-child(11) {
368 | padding: 16px;
369 | text-align: center;
370 | }
371 | .mdl-navigation > a:nth-child(11) > i {
372 | vertical-align: middle;
373 | }
374 | .mdl-navigation__link:hover a {
375 | color: rgb(255,87,34);
376 | }
377 |
378 | .mdl-layout__drawer .mdl-navigation .mdl-navigation__link {
379 | padding: 16px;
380 | }
381 |
382 |
383 | .cl-header {
384 | background-image: url(http://moltran.coderthemes.com/dark_2/assets/images/big/bg.jpg);
385 | background-size: cover;
386 | color: #FFF;
387 | text-align: center;
388 | height: 151px;
389 | }
390 |
391 | .cl-header h1 {
392 | overflow: hidden;
393 | padding-bottom: 20px;
394 | font-weight: normal;
395 | font-size: 20px;
396 | }
397 |
398 | .cl-header__avatar {
399 | margin-bottom: 16px;
400 | padding: 24px 24px 0 24px;
401 | text-align: left;
402 | }
403 |
404 | .cl-header__avatar img {
405 | width: 72px;
406 | height: 72px;
407 | }
408 |
409 | .cl-header__info {
410 | padding: 8px 24px;
411 | min-height: 56px;
412 | text-align: left;
413 | font-size: 14px;
414 | line-height: 8px;
415 | }
416 |
417 | .cl-header__info p:first-child {
418 | font-weight: 500;
419 | }
420 |
421 | /* RIGHT CONTAINER */
422 |
423 | .cl-content {
424 | max-width: 1080px;
425 | }
426 |
427 | .demo-header.mdl-layout__header i {
428 | color: #FFF;
429 | }
430 |
431 | /* input */
432 | md-input {
433 | display: block !important;
434 | margin: 20px 0;
435 | }
436 | .md-input-wrapper {
437 | margin: 20px 0 !important;
438 | }
439 | .md-input-underline {
440 | margin-top: 10px !important;
441 | }
442 |
443 |
444 | .cl-user__details {
445 | background-image: url(http://moltran.coderthemes.com/dark_2/assets/images/big/bg.jpg);
446 | background-size: cover;
447 | color: #FFF;
448 | text-align: center;
449 | }
450 | .cl-user__photo {
451 | padding: 24px 24px 0 24px;
452 | text-align: left;
453 | }
454 | .cl-user__photo img {
455 | width: 72px;
456 | height: 72px;
457 | }
458 | .cl-user__info {
459 | padding: 8px 24px;
460 | min-height: 56px;
461 | text-align: left;
462 | font-size: 14px;
463 | line-height: 8px;
464 | }
465 | .cl-user__info p:first-child {
466 | font-weight: 500;
467 | }
468 | #navigation ul {
469 | margin: 0;
470 | padding-left: 0;
471 | list-style: none;
472 | text-align: left;
473 | }
474 | #navigation ul > li {
475 | padding: 8px 24px;
476 | min-height: 48px;
477 | line-height: 48px;
478 | }
479 | #navigation ul > li:hover {
480 | background: #EEEEEE;
481 | }
482 | #navigation ul > li > a {
483 | color: #37474F;
484 | font-weight: 500;
485 | }
486 | #navigation ul > li > a > span {
487 | margin-left: 24px;
488 | }
489 | i.material-icons {
490 | vertical-align: middle;
491 | }
492 | .app-content {
493 | padding: 20px;
494 | }
495 | md-toolbar i {
496 | color: #FFF;
497 | }
498 | .md-input-placeholder.md-focused {
499 | color: rgb(255,87,34) !important;
500 | }
501 | button.md-primary,
502 | .md-checkbox-checked .md-checkbox-background,
503 | md-toolbar.md-primary,
504 | [md-fab], .md-input-ripple {
505 | background: rgb(255,87,34) !important;
506 |
507 | }
508 | .cl-form__profil {
509 | display: block;
510 | margin: 0 auto;
511 | border: 1px solid #EEE;
512 | border-radius: 50%;
513 | }
514 | /*
515 | * OLD INPUT *
516 | */
517 | .field {
518 | position: relative;
519 | padding: 16px 0 8px 0;
520 | height: 72px;
521 | text-align: left;
522 | }
523 | .field::after, .field::before {
524 | position: absolute;
525 | bottom: 30px;
526 | left: 0;
527 | width: 100%;
528 | height: 1px;
529 | background-color: #BDBDBD;
530 | content: '';
531 | }
532 | .field-input {
533 | position: relative;
534 | display: block;
535 | padding: 8px 0;
536 | width: 100%;
537 | height: auto;
538 | outline: none;
539 | border: none;
540 | background: transparent;
541 | color: #F44336;
542 | font-size: 16px;
543 | font-family: Roboto;
544 | line-height: 16px;
545 | }
546 |
547 |
548 | /*
549 | * SETTING *
550 | */
551 | .switch label .lever {
552 | content: "";
553 | display: inline-block;
554 | position: relative;
555 | width: 40px;
556 | height: 15px;
557 | background-color: #BDBDBD;
558 | border-radius: 15px;
559 | margin-right: 10px;
560 | transition: background 0.3s ease;
561 | vertical-align: middle;
562 | margin: 0 16px;
563 | }
564 | .switch label input[type=checkbox]:checked+.lever {
565 | background-color: #FF7043;
566 | }
567 |
568 | .switch label [type="checkbox"]:not(:checked),
569 | .switch label [type="checkbox"]:checked {
570 | position: absolute;
571 | left: -9999px;
572 | opacity: 0;
573 | }
574 | .switch label input[type=checkbox]:checked+.lever:after {
575 | background-color: #FF5722;
576 | left: 24px;
577 | }
578 | .switch label .lever:after {
579 | content: "";
580 | position: absolute;
581 | display: inline-block;
582 | width: 21px;
583 | height: 21px;
584 | background-color: #E0E0E0;
585 | border-radius: 21px;
586 | box-shadow: 0 1px 3px 1px rgba(0,0,0,0.4);
587 | left: -5px;
588 | top: -3px;
589 | transition: left 0.3s ease, background .3s ease, box-shadow 0.1s ease;
590 | }
--------------------------------------------------------------------------------
/src/assets/i18n/en.json:
--------------------------------------------------------------------------------
1 | {
2 | "generic": {
3 | "welcome-title": "Welcome to the admin platform",
4 | "btn-cancel": "Cancel",
5 | "btn-save":"Save",
6 | "btn-delete":"Delete",
7 | "table-edit": "Edit",
8 | "table-delete":"Delete"
9 | },
10 | "login": {
11 | "username": "username",
12 | "password": "password",
13 | "btn": "Sign in",
14 | "forgot": "Forgot password?",
15 | "remember":"remember-me"
16 | },
17 | "project": {
18 | "title": "List missions",
19 | "table-name":"Name mission",
20 | "table-date": "Created",
21 | "title-create":"Create a mission",
22 | "title-edit":"Edit a mission",
23 | "form-name":"Name mission",
24 | "form-description":"Description mission"
25 | },
26 | "footer": {
27 | "language": "Choose your Language",
28 | "copyright-notice": "Check our Legal notices",
29 | "copyright-or": "or",
30 | "copyright-contact": "contact us"
31 | },
32 | "index": {
33 | "Dashboard": "Dashboard",
34 | "Customer": "Customers",
35 | "Consultant": "Collaborators",
36 | "Mission": "Missions",
37 | "Setting": "Settings",
38 | "Sign-out": "Sign out",
39 | "Skill": "Skills"
40 | }
41 | }
--------------------------------------------------------------------------------
/src/assets/i18n/fr.json:
--------------------------------------------------------------------------------
1 | {
2 | "generic": {
3 | "welcome-title": "Bienvenue sur la plateforme d'administration",
4 | "btn-cancel": "Annuler",
5 | "btn-save":"Enregistrer",
6 | "btn-delete":"supprimer",
7 | "table-edit": "Editer",
8 | "table-delete":"Supprimer"
9 | },
10 | "login": {
11 | "username": "nom d'utilisateur",
12 | "password": "mot de passe",
13 | "btn": "Se connecter",
14 | "forgot": "Mot de passe oublié?",
15 | "remember":"Se rappeler de moi"
16 | },
17 | "project": {
18 | "title": "Liste des missions",
19 | "table-name":"Nom mission",
20 | "table-date": "Créé",
21 | "title-create":"Créer une mission",
22 | "title-edit":"Editer mission",
23 | "form-name":"Nom mission",
24 | "form-description":"Description mission"
25 | },
26 | "footer": {
27 | "language": "Choisissez votre langage",
28 | "copyright-notice": "Consultez nos Mentions légales",
29 | "copyright-or": "ou",
30 | "copyright-contact": "contactez-nous"
31 | },
32 | "index": {
33 | "Dashboard": "Tableau de bord",
34 | "Customer": "Clients",
35 | "Consultant": "Collaborateurs",
36 | "Mission": "Missions",
37 | "Setting": "Paramètres",
38 | "Sign-out": "Se déconnecter",
39 | "Skill": "Compétences"
40 | }
41 | }
--------------------------------------------------------------------------------
/src/assets/img/C.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clamarque/Angular2_Dashboard/1fff99fccd942cfd0d0167253aacea8cb7625cf4/src/assets/img/C.png
--------------------------------------------------------------------------------
/src/assets/img/demo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clamarque/Angular2_Dashboard/1fff99fccd942cfd0d0167253aacea8cb7625cf4/src/assets/img/demo.png
--------------------------------------------------------------------------------
/src/assets/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clamarque/Angular2_Dashboard/1fff99fccd942cfd0d0167253aacea8cb7625cf4/src/assets/img/favicon.ico
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Angular Dashboard
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
39 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
Loading...
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Angular2_Dashboard",
3 | "version": "1.0.0",
4 | "description": "Admin dashboard angular2",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
8 | "tsc": "tsc",
9 | "tsc:w": "tsc -w",
10 | "lite": "lite-server",
11 | "typings": "typings",
12 | "postinstall": "typings install",
13 | "test": "karma start"
14 | },
15 | "author": "Charles Lamarque",
16 | "license": "ISC",
17 | "devDependencies": {
18 | "concurrently": "^2.0.0",
19 | "lite-server": "^2.2.0",
20 | "typescript": "^1.8.10",
21 | "typings": "^1.3.1"
22 | },
23 | "dependencies": {
24 | "@angular/common": "^2.0.0-rc.4",
25 | "@angular/compiler": "^2.0.0-rc.4",
26 | "@angular/core": "^2.0.0-rc.4",
27 | "@angular/forms": "^0.2.0",
28 | "@angular/http": "^2.0.0-rc.4",
29 | "@angular/platform-browser": "^2.0.0-rc.4",
30 | "@angular/platform-browser-dynamic": "^2.0.0-rc.4",
31 | "@angular/router": "^3.0.0-beta.2",
32 | "@angular2-material/button": "^2.0.0-alpha.6",
33 | "@angular2-material/card": "^2.0.0-alpha.6",
34 | "@angular2-material/checkbox": "^2.0.0-alpha.6",
35 | "@angular2-material/core": "^2.0.0-alpha.6",
36 | "@angular2-material/grid-list": "^2.0.0-alpha.6",
37 | "@angular2-material/input": "2.0.0-alpha.6",
38 | "@angular2-material/list": "^2.0.0-alpha.6",
39 | "@angular2-material/menu": "^2.0.0-alpha.6-2",
40 | "@angular2-material/sidenav": "^2.0.0-alpha.6",
41 | "@angular2-material/slide-toggle": "^2.0.0-alpha.6",
42 | "@angular2-material/toolbar": "^2.0.0-alpha.6",
43 | "angular2-in-memory-web-api": "0.0.14",
44 | "es6-shim": "^0.35.0",
45 | "firebase": "^3.2.0",
46 | "ng2-toastr": "^0.3.0",
47 | "ng2-translate": "^2.2.2",
48 | "reflect-metadata": "^0.1.3",
49 | "rxjs": "^5.0.0-beta.6",
50 | "systemjs": "^0.19.36",
51 | "typings": "^1.3.2",
52 | "zone.js": "^0.6.12"
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/systemjs.config.js:
--------------------------------------------------------------------------------
1 | (function(global) {
2 |
3 | const systemConfigPackages = {};
4 |
5 | // map tells the System loader where to look for things
6 | var map = {
7 | 'app': '/dist/app', // 'dist',
8 | 'rxjs': 'node_modules/rxjs',
9 | 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
10 | '@angular': 'node_modules/@angular',
11 | '@angular2-material': 'node_modules/@angular2-material',
12 | 'ng2-translate': 'node_modules/ng2-translate',
13 | 'firebase': 'node_modules/firebase/lib/firebase-web.js',
14 |
15 | './': 'app/',
16 | '+collaborator': 'app/+collaborator',
17 | 'collaborator-signin': 'app/+collaborator/collaborator-signin',
18 | 'collaborator-detail': 'app/+collaborator/collaborator-detail',
19 | 'collaborator-list': 'app/+collaborator/collaborator-list',
20 | 'collaborator-reset': 'app/+collaborator/collaborator-reset',
21 | 'collaborator-register': 'app/+collaborator/collaborator-register',
22 | '+customer': 'app/+customer',
23 | 'customer-create': 'app/+customer/customer-create',
24 | 'customer-detail': 'app/+customer/customer-detail',
25 | 'customer-list': 'app/+customer/customer-list',
26 | '+dashboard': 'app/+dashboard',
27 | 'dashboard-list': 'app/+dashboard/dashboard-list',
28 | '+home': 'app/+home',
29 | 'home-list': 'app/+home/home-list',
30 | '+mission': 'app/+mission',
31 | 'mission-create': 'app/+mission/mission-create',
32 | 'mission-detail': 'app/+mission/mission-detail',
33 | 'mission-list': 'app/+mission/mission-list',
34 | '+role': 'app/+role',
35 | 'role-create': 'app/+role/role-create',
36 | 'role-list': 'app/+role/role-list',
37 | '+setting': 'app/+setting',
38 | 'setting-list': 'app/+setting/setting-list',
39 | '+skill': 'app/+skill',
40 | 'skill-create': 'app/+skill/skill-create',
41 | 'skill-detail': 'app/+skill/skill-detail',
42 | 'skill-list': 'app/+skill/skill-list',
43 | 'shared': 'app/shared',
44 | 'pipes': 'app/shared/pipes',
45 | 'services': 'app/shared/services'
46 | };
47 |
48 | // packages tells the System loader how to load when no filename and/or no extension
49 | var packages = {
50 | 'app': { main: 'main.js', defaultExtension: 'js' },
51 | 'rxjs': { defaultExtension: 'js' },
52 | 'angular2-in-memory-web-api': { defaultExtension: 'js' },
53 | 'ng2-translate': { defaultExtension: 'js'},
54 | '@angular2-material/card': { main: 'card.js', defaultExtension: 'js'},
55 | '@angular2-material/core': { main: 'core.js', defaultExtension: 'js'},
56 | '@angular2-material/checkbox': { main: 'checkbox.js', defaultExtension: 'js'},
57 | '@angular2-material/button': { main: 'button.js', defaultExtension: 'js'},
58 | '@angular2-material/list': { main: 'list.js', defaultExtension: 'js'},
59 | '@angular2-material/grid-list': { main:'grid-list.js', defaultExtension: 'js'},
60 | '@angular2-material/input': { main: 'input.js', defaultExtension: 'js'},
61 | '@angular2-material/menu': { main: 'menu.js', defaultExtension: 'js'},
62 | '@angular2-material/sidenav': { main: 'sidenav.js', defaultExtension:'js'},
63 | '@angular2-material/slide-toggle': { main: 'slide-toggle.js', defaultExtension: 'js'},
64 | '@angular2-material/toolbar': { main: 'js', defaultExtension: 'js'}
65 | };
66 |
67 | var packageNames = [
68 | '@angular/common',
69 | '@angular/compiler',
70 | '@angular/core',
71 | '@angular/forms',
72 | '@angular/http',
73 | '@angular/platform-browser',
74 | '@angular/platform-browser-dynamic',
75 | '@angular/router',
76 | '@angular/router-deprecated',
77 | '@angular/testing',
78 | '@angular/upgrade',
79 |
80 | 'app/',
81 | 'app/+collaborator',
82 | 'app/+collaborator/collaborator-detail',
83 | 'app/+collaborator/collaborator-list',
84 | 'app/+collaborator/collaborator-register',
85 | 'app/+collaborator/collaborator-reset',
86 | 'app/+collaborator/collaborator-signin',
87 | 'app/+customer',
88 | 'app/+customer/customer-create',
89 | 'app/+customer/customer-detail',
90 | 'app/+customer/customer-list',
91 | 'app/+dashboard',
92 | 'app/+dashboard/dashboard-index',
93 | 'app/+home',
94 | 'app/+home/home-index',
95 | 'app/+mission',
96 | 'app/+mission/mission-create',
97 | 'app/+mission/mission-detail',
98 | 'app/+mission/mission-list',
99 | 'app/+role',
100 | 'app/+role/role-create',
101 | 'app/+role/role-list',
102 | 'app/+setting',
103 | 'app/+setting/setting-index',
104 | 'app/+skill',
105 | 'app/+skill/skill-create',
106 | 'app/+skill/skill-detail',
107 | 'app/+skill/skill-list',
108 | 'app/shared',
109 | 'app/shared/pipes',
110 | 'app/shared/services'
111 | ];
112 |
113 | // add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' }
114 | packageNames.forEach(function(pkgName) {
115 | packages[pkgName] = { main: 'index.js', defaultExtension: 'js' };
116 | });
117 |
118 | var config = {
119 | map: map,
120 | packages: packages
121 | }
122 |
123 | // filterSystemConfig - index.html's chance to modify config before we register it.
124 | if (global.filterSystemConfig) { global.filterSystemConfig(config); }
125 |
126 | System.config(config);
127 |
128 | })(this);
--------------------------------------------------------------------------------
/src/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "sourceMap": true,
5 | "experimentalDecorators": true,
6 | "emitDecoratorMetadata": true,
7 | "module": "commonjs",
8 | "noImplicitAny": false,
9 | "outDir": "./dist"
10 | },
11 | "exclude": [
12 | "node_modules",
13 | "typings/main",
14 | "typings/main.d.ts"
15 | ]
16 | }
--------------------------------------------------------------------------------
/src/typings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ambientDependencies": {
3 | "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
4 | "firebase": "registry:dt/firebase#2.4.1+20160412125105",
5 | "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/typings/browser.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 |
5 | declare var firebase: any;
--------------------------------------------------------------------------------
/src/typings/browser/ambient/firebase/index.d.ts:
--------------------------------------------------------------------------------
1 | // Generated by typings
2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/73fa26213aa5d2e1de5d7c2cc74118108cb2e5fa/firebase/firebase.d.ts
3 | // Type definitions for Firebase API 2.4.1
4 | // Project: https://www.firebase.com/docs/javascript/firebase
5 | // Definitions by: Vincent Botone , Shin1 Kashimura , Sebastien Dubois , Szymon Stasik
6 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7 |
8 | interface FirebaseAuthResult {
9 | auth: any;
10 | expires: number;
11 | }
12 |
13 | interface FirebaseDataSnapshot {
14 | /**
15 | * Returns true if this DataSnapshot contains any data.
16 | * It is slightly more efficient than using snapshot.val() !== null.
17 | */
18 | exists(): boolean;
19 | /**
20 | * Gets the JavaScript object representation of the DataSnapshot.
21 | */
22 | val(): any;
23 | /**
24 | * Gets a DataSnapshot for the location at the specified relative path.
25 | */
26 | child(childPath: string): FirebaseDataSnapshot;
27 | /**
28 | * Enumerates through the DataSnapshot’s children (in the default order).
29 | */
30 | forEach(childAction: (childSnapshot: FirebaseDataSnapshot) => void): boolean;
31 | forEach(childAction: (childSnapshot: FirebaseDataSnapshot) => boolean): boolean;
32 | /**
33 | * Returns true if the specified child exists.
34 | */
35 | hasChild(childPath: string): boolean;
36 | /**
37 | * Returns true if the DataSnapshot has any children.
38 | */
39 | hasChildren(): boolean;
40 | /**
41 | * Gets the key name of the location that generated this DataSnapshot.
42 | */
43 | key(): string;
44 | /**
45 | * @deprecated Use key() instead.
46 | * Gets the key name of the location that generated this DataSnapshot.
47 | */
48 | name(): string;
49 | /**
50 | * Gets the number of children for this DataSnapshot.
51 | */
52 | numChildren(): number;
53 | /**
54 | * Gets the Firebase reference for the location that generated this DataSnapshot.
55 | */
56 | ref(): Firebase;
57 | /**
58 | * Gets the priority of the data in this DataSnapshot.
59 | * @returns {string, number, null} The priority, or null if no priority was set.
60 | */
61 | getPriority(): any; // string or number
62 | /**
63 | * Exports the entire contents of the DataSnapshot as a JavaScript object.
64 | */
65 | exportVal(): Object;
66 | }
67 |
68 | interface FirebaseOnDisconnect {
69 | /**
70 | * Ensures the data at this location is set to the specified value when the client is disconnected
71 | * (due to closing the browser, navigating to a new page, or network issues).
72 | */
73 | set(value: any, onComplete: (error: any) => void): void;
74 | set(value: any): Promise;
75 | /**
76 | * Ensures the data at this location is set to the specified value and priority when the client is disconnected
77 | * (due to closing the browser, navigating to a new page, or network issues).
78 | */
79 | setWithPriority(value: any, priority: string|number, onComplete: (error: any) => void): void;
80 | setWithPriority(value: any, priority: string|number): Promise;
81 | /**
82 | * Writes the enumerated children at this Firebase location when the client is disconnected
83 | * (due to closing the browser, navigating to a new page, or network issues).
84 | */
85 | update(value: Object, onComplete: (error: any) => void): void;
86 | update(value: Object): Promise;
87 | /**
88 | * Ensures the data at this location is deleted when the client is disconnected
89 | * (due to closing the browser, navigating to a new page, or network issues).
90 | */
91 | remove(onComplete: (error: any) => void): void;
92 | remove(): Promise;
93 | /**
94 | * Cancels all previously queued onDisconnect() set or update events for this location and all children.
95 | */
96 | cancel(onComplete: (error: any) => void): void;
97 | cancel(): Promise;
98 | }
99 |
100 | interface FirebaseQuery {
101 | /**
102 | * Listens for data changes at a particular location.
103 | */
104 | on(eventType: string, callback: (dataSnapshot: FirebaseDataSnapshot, prevChildName?: string) => void, cancelCallback?: (error: any) => void, context?: Object): (dataSnapshot: FirebaseDataSnapshot, prevChildName?: string) => void;
105 | /**
106 | * Detaches a callback previously attached with on().
107 | */
108 | off(eventType?: string, callback?: (dataSnapshot: FirebaseDataSnapshot, prevChildName?: string) => void, context?: Object): void;
109 | /**
110 | * Listens for exactly one event of the specified event type, and then stops listening.
111 | */
112 | once(eventType: string, successCallback: (dataSnapshot: FirebaseDataSnapshot) => void, context?: Object): void;
113 | once(eventType: string, successCallback: (dataSnapshot: FirebaseDataSnapshot) => void, failureCallback?: (error: any) => void, context?: Object): void;
114 | once(eventType: string): Promise
115 | /**
116 | * Generates a new Query object ordered by the specified child key.
117 | */
118 | orderByChild(key: string): FirebaseQuery;
119 | /**
120 | * Generates a new Query object ordered by key name.
121 | */
122 | orderByKey(): FirebaseQuery;
123 | /**
124 | * Generates a new Query object ordered by child values.
125 | */
126 | orderByValue(): FirebaseQuery;
127 | /**
128 | * Generates a new Query object ordered by priority.
129 | */
130 | orderByPriority(): FirebaseQuery;
131 | /**
132 | * @deprecated Use limitToFirst() and limitToLast() instead.
133 | * Generates a new Query object limited to the specified number of children.
134 | */
135 | limit(limit: number): FirebaseQuery;
136 | /**
137 | * Creates a Query with the specified starting point.
138 | * The generated Query includes children which match the specified starting point.
139 | */
140 | startAt(value: string, key?: string): FirebaseQuery;
141 | startAt(value: number, key?: string): FirebaseQuery;
142 | /**
143 | * Creates a Query with the specified ending point.
144 | * The generated Query includes children which match the specified ending point.
145 | */
146 | endAt(value: string, key?: string): FirebaseQuery;
147 | endAt(value: number, key?: string): FirebaseQuery;
148 | /**
149 | * Creates a Query which includes children which match the specified value.
150 | */
151 | equalTo(value: string|number|boolean, key?: string): FirebaseQuery;
152 | /**
153 | * Generates a new Query object limited to the first certain number of children.
154 | */
155 | limitToFirst(limit: number): FirebaseQuery;
156 | /**
157 | * Generates a new Query object limited to the last certain number of children.
158 | */
159 | limitToLast(limit: number): FirebaseQuery;
160 | /**
161 | * Gets a Firebase reference to the Query's location.
162 | */
163 | ref(): Firebase;
164 | }
165 |
166 | interface Firebase extends FirebaseQuery {
167 | /**
168 | * @deprecated Use authWithCustomToken() instead.
169 | * Authenticates a Firebase client using the provided authentication token or Firebase Secret.
170 | */
171 | auth(authToken: string, onComplete: (error: any, result: FirebaseAuthResult) => void, onCancel?:(error: any) => void): void;
172 | auth(authToken: string): Promise;
173 | /**
174 | * Authenticates a Firebase client using an authentication token or Firebase Secret.
175 | */
176 | authWithCustomToken(autoToken: string, onComplete: (error: any, authData: FirebaseAuthData) => void, options?:Object): void;
177 | authWithCustomToken(autoToken: string, options?:Object): Promise;
178 | /**
179 | * Authenticates a Firebase client using a new, temporary guest account.
180 | */
181 | authAnonymously(onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
182 | authAnonymously(options?: Object): Promise;
183 | /**
184 | * Authenticates a Firebase client using an email / password combination.
185 | */
186 | authWithPassword(credentials: FirebaseCredentials, onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
187 | authWithPassword(credentials: FirebaseCredentials, options?: Object): Promise;
188 | /**
189 | * Authenticates a Firebase client using a popup-based OAuth flow.
190 | */
191 | authWithOAuthPopup(provider: string, onComplete:(error: any, authData: FirebaseAuthData) => void, options?: Object): void;
192 | authWithOAuthPopup(provider: string, options?: Object): Promise;
193 | /**
194 | * Authenticates a Firebase client using a redirect-based OAuth flow.
195 | */
196 | authWithOAuthRedirect(provider: string, onComplete: (error: any) => void, options?: Object): void;
197 | authWithOAuthRedirect(provider: string, options?: Object): Promise;
198 | /**
199 | * Authenticates a Firebase client using OAuth access tokens or credentials.
200 | */
201 | authWithOAuthToken(provider: string, credentials: string|Object, onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
202 | authWithOAuthToken(provider: string, credentials: string|Object, options?: Object): Promise;
203 | /**
204 | * Synchronously access the current authentication state of the client.
205 | */
206 | getAuth(): FirebaseAuthData;
207 | /**
208 | * Listen for changes to the client's authentication state.
209 | */
210 | onAuth(onComplete: (authData: FirebaseAuthData) => void, context?: Object): void;
211 | /**
212 | * Detaches a callback previously attached with onAuth().
213 | */
214 | offAuth(onComplete: (authData: FirebaseAuthData) => void, context?: Object): void;
215 | /**
216 | * Unauthenticates a Firebase client.
217 | */
218 | unauth(): void;
219 | /**
220 | * Gets a Firebase reference for the location at the specified relative path.
221 | */
222 | child(childPath: string): Firebase;
223 | /**
224 | * Gets a Firebase reference to the parent location.
225 | */
226 | parent(): Firebase;
227 | /**
228 | * Gets a Firebase reference to the root of the Firebase.
229 | */
230 | root(): Firebase;
231 | /**
232 | * Returns the last token in a Firebase location.
233 | */
234 | key(): string;
235 | /**
236 | * @deprecated Use key() instead.
237 | * Returns the last token in a Firebase location.
238 | */
239 | name(): string;
240 | /**
241 | * Gets the absolute URL corresponding to this Firebase reference's location.
242 | */
243 | toString(): string;
244 | /**
245 | * Writes data to this Firebase location.
246 | */
247 | set(value: any, onComplete: (error: any) => void): void;
248 | set(value: any): Promise;
249 | /**
250 | * Writes the enumerated children to this Firebase location.
251 | */
252 | update(value: Object, onComplete: (error: any) => void): void;
253 | update(value: Object): Promise;
254 | /**
255 | * Removes the data at this Firebase location.
256 | */
257 | remove(onComplete: (error: any) => void): void;
258 | remove(): Promise;
259 | /**
260 | * Generates a new child location using a unique name and returns a Firebase reference to it.
261 | * @returns {Firebase} A Firebase reference for the generated location.
262 | */
263 | push(value?: any, onComplete?: (error: any) => void): FirebaseWithPromise;
264 | /**
265 | * Writes data to this Firebase location. Like set() but also specifies the priority for that data.
266 | */
267 | setWithPriority(value: any, priority: string|number, onComplete: (error: any) => void): void;
268 | setWithPriority(value: any, priority: string|number): Promise;
269 | /**
270 | * Sets a priority for the data at this Firebase location.
271 | */
272 | setPriority(priority: string|number, onComplete: (error: any) => void): void;
273 | setPriority(priority: string|number): Promise;
274 | /**
275 | * Atomically modifies the data at this location.
276 | */
277 | transaction(updateFunction: (currentData: any)=> any, onComplete?: (error: any, committed: boolean, snapshot: FirebaseDataSnapshot) => void, applyLocally?: boolean): void;
278 | /**
279 | * Creates a new user account using an email / password combination.
280 | */
281 | createUser(credentials: FirebaseCredentials, onComplete: (error: any, userData: any) => void): void;
282 | /**
283 | * Updates the email associated with an email / password user account.
284 | */
285 | changeEmail(credentials: FirebaseChangeEmailCredentials, onComplete: (error: any) => void): void;
286 | /**
287 | * Change the password of an existing user using an email / password combination.
288 | */
289 | changePassword(credentials: FirebaseChangePasswordCredentials, onComplete: (error: any) => void): void;
290 | /**
291 | * Removes an existing user account using an email / password combination.
292 | */
293 | removeUser(credentials: FirebaseCredentials, onComplete: (error: any) => void): void;
294 | /**
295 | * Sends a password-reset email to the owner of the account, containing a token that may be used to authenticate and change the user password.
296 | */
297 | resetPassword(credentials: FirebaseResetPasswordCredentials, onComplete: (error: any) => void): void;
298 | onDisconnect(): FirebaseOnDisconnect;
299 | }
300 |
301 | interface FirebaseWithPromise extends Firebase, Promise {}
302 |
303 | interface FirebaseStatic {
304 | /**
305 | * Constructs a new Firebase reference from a full Firebase URL.
306 | */
307 | new (firebaseURL: string): Firebase;
308 | /**
309 | * Manually disconnects the Firebase client from the server and disables automatic reconnection.
310 | */
311 | goOffline(): void;
312 | /**
313 | * Manually reestablishes a connection to the Firebase server and enables automatic reconnection.
314 | */
315 | goOnline(): void;
316 |
317 | ServerValue: {
318 | /**
319 | * A placeholder value for auto-populating the current timestamp
320 | * (time since the Unix epoch, in milliseconds) by the Firebase servers.
321 | */
322 | TIMESTAMP: any;
323 | };
324 | }
325 | declare var Firebase: FirebaseStatic;
326 |
327 | declare module 'firebase' {
328 | export = Firebase;
329 | }
330 |
331 | // Reference: https://www.firebase.com/docs/web/api/firebase/getauth.html
332 | interface FirebaseAuthData {
333 | uid: string;
334 | provider: string;
335 | token: string;
336 | expires: number;
337 | auth: Object;
338 | google?: FirebaseAuthDataGoogle;
339 | twitter?: FirebaseAuthDataTwitter;
340 | github?: FirebaseAuthDataGithub;
341 | facebook?: FirebaseAuthDataFacebook;
342 | password?: FirebaseAuthDataPassword;
343 | anonymous?: any;
344 | }
345 |
346 | interface FirebaseAuthDataPassword{
347 | email: string;
348 | isTemporaryPassword: boolean;
349 | profileImageURL: string;
350 | }
351 |
352 | interface FirebaseAuthDataTwitter{
353 | id: string;
354 | accessToken: string;
355 | accessTokenSecret: string;
356 | displayName: string;
357 | username: string;
358 | profileImageURL: string;
359 | cachedUserProfile: any;
360 | }
361 |
362 | interface FirebaseAuthDataGithub{
363 | id: string;
364 | accessToken: string;
365 | displayName: string;
366 | email?: string;
367 | username: string;
368 | profileImageURL: string;
369 | cachedUserProfile: any;
370 | }
371 |
372 | interface FirebaseAuthDataFacebook{
373 | id: string;
374 | accessToken: string;
375 | displayName: string;
376 | email?: string;
377 | profileImageURL: string;
378 | cachedUserProfile: any;
379 | }
380 |
381 | interface FirebaseAuthDataGoogle {
382 | accessToken: string;
383 | cachedUserProfile: FirebaseAuthDataGoogleCachedUserProfile;
384 | displayName: string;
385 | email?: string;
386 | id: string;
387 | profileImageURL: string;
388 | }
389 |
390 | interface FirebaseAuthDataGoogleCachedUserProfile {
391 | "family name"?: string;
392 | gender?: string;
393 | "given name"?: string;
394 | id?: string;
395 | link?: string;
396 | locale?: string;
397 | name?: string;
398 | picture?: string;
399 | }
400 |
401 | interface FirebaseCredentials {
402 | email: string;
403 | password: string;
404 | }
405 |
406 | interface FirebaseChangePasswordCredentials {
407 | email: string;
408 | oldPassword: string;
409 | newPassword: string;
410 | }
411 |
412 | interface FirebaseChangeEmailCredentials {
413 | oldEmail: string;
414 | newEmail: string;
415 | password: string;
416 | }
417 |
418 | interface FirebaseResetPasswordCredentials {
419 | email: string;
420 | }
--------------------------------------------------------------------------------
/src/typings/browser/ambient/jasmine/index.d.ts:
--------------------------------------------------------------------------------
1 | // Generated by typings
2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/jasmine/jasmine.d.ts
3 | // Type definitions for Jasmine 2.2
4 | // Project: http://jasmine.github.io/
5 | // Definitions by: Boris Yankov , Theodore Brown , David Pärsson
6 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7 |
8 |
9 | // For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts
10 |
11 | declare function describe(description: string, specDefinitions: () => void): void;
12 | declare function fdescribe(description: string, specDefinitions: () => void): void;
13 | declare function xdescribe(description: string, specDefinitions: () => void): void;
14 |
15 | declare function it(expectation: string, assertion?: () => void, timeout?: number): void;
16 | declare function it(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
17 | declare function fit(expectation: string, assertion?: () => void, timeout?: number): void;
18 | declare function fit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
19 | declare function xit(expectation: string, assertion?: () => void, timeout?: number): void;
20 | declare function xit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
21 |
22 | /** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */
23 | declare function pending(reason?: string): void;
24 |
25 | declare function beforeEach(action: () => void, timeout?: number): void;
26 | declare function beforeEach(action: (done: () => void) => void, timeout?: number): void;
27 | declare function afterEach(action: () => void, timeout?: number): void;
28 | declare function afterEach(action: (done: () => void) => void, timeout?: number): void;
29 |
30 | declare function beforeAll(action: () => void, timeout?: number): void;
31 | declare function beforeAll(action: (done: () => void) => void, timeout?: number): void;
32 | declare function afterAll(action: () => void, timeout?: number): void;
33 | declare function afterAll(action: (done: () => void) => void, timeout?: number): void;
34 |
35 | declare function expect(spy: Function): jasmine.Matchers;
36 | declare function expect(actual: any): jasmine.Matchers;
37 |
38 | declare function fail(e?: any): void;
39 |
40 | declare function spyOn(object: any, method: string): jasmine.Spy;
41 |
42 | declare function runs(asyncMethod: Function): void;
43 | declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void;
44 | declare function waits(timeout?: number): void;
45 |
46 | declare namespace jasmine {
47 |
48 | var clock: () => Clock;
49 |
50 | function any(aclass: any): Any;
51 | function anything(): Any;
52 | function arrayContaining(sample: any[]): ArrayContaining;
53 | function objectContaining(sample: any): ObjectContaining;
54 | function createSpy(name: string, originalFn?: Function): Spy;
55 | function createSpyObj(baseName: string, methodNames: any[]): any;
56 | function createSpyObj(baseName: string, methodNames: any[]): T;
57 | function pp(value: any): string;
58 | function getEnv(): Env;
59 | function addCustomEqualityTester(equalityTester: CustomEqualityTester): void;
60 | function addMatchers(matchers: CustomMatcherFactories): void;
61 | function stringMatching(str: string): Any;
62 | function stringMatching(str: RegExp): Any;
63 |
64 | interface Any {
65 |
66 | new (expectedClass: any): any;
67 |
68 | jasmineMatches(other: any): boolean;
69 | jasmineToString(): string;
70 | }
71 |
72 | // taken from TypeScript lib.core.es6.d.ts, applicable to CustomMatchers.contains()
73 | interface ArrayLike {
74 | length: number;
75 | [n: number]: T;
76 | }
77 |
78 | interface ArrayContaining {
79 | new (sample: any[]): any;
80 |
81 | asymmetricMatch(other: any): boolean;
82 | jasmineToString(): string;
83 | }
84 |
85 | interface ObjectContaining {
86 | new (sample: any): any;
87 |
88 | jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean;
89 | jasmineToString(): string;
90 | }
91 |
92 | interface Block {
93 |
94 | new (env: Env, func: SpecFunction, spec: Spec): any;
95 |
96 | execute(onComplete: () => void): void;
97 | }
98 |
99 | interface WaitsBlock extends Block {
100 | new (env: Env, timeout: number, spec: Spec): any;
101 | }
102 |
103 | interface WaitsForBlock extends Block {
104 | new (env: Env, timeout: number, latchFunction: SpecFunction, message: string, spec: Spec): any;
105 | }
106 |
107 | interface Clock {
108 | install(): void;
109 | uninstall(): void;
110 | /** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */
111 | tick(ms: number): void;
112 | mockDate(date?: Date): void;
113 | }
114 |
115 | interface CustomEqualityTester {
116 | (first: any, second: any): boolean;
117 | }
118 |
119 | interface CustomMatcher {
120 | compare(actual: T, expected: T): CustomMatcherResult;
121 | compare(actual: any, expected: any): CustomMatcherResult;
122 | }
123 |
124 | interface CustomMatcherFactory {
125 | (util: MatchersUtil, customEqualityTesters: Array): CustomMatcher;
126 | }
127 |
128 | interface CustomMatcherFactories {
129 | [index: string]: CustomMatcherFactory;
130 | }
131 |
132 | interface CustomMatcherResult {
133 | pass: boolean;
134 | message?: string;
135 | }
136 |
137 | interface MatchersUtil {
138 | equals(a: any, b: any, customTesters?: Array): boolean;
139 | contains(haystack: ArrayLike | string, needle: any, customTesters?: Array): boolean;
140 | buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array): string;
141 | }
142 |
143 | interface Env {
144 | setTimeout: any;
145 | clearTimeout: void;
146 | setInterval: any;
147 | clearInterval: void;
148 | updateInterval: number;
149 |
150 | currentSpec: Spec;
151 |
152 | matchersClass: Matchers;
153 |
154 | version(): any;
155 | versionString(): string;
156 | nextSpecId(): number;
157 | addReporter(reporter: Reporter): void;
158 | execute(): void;
159 | describe(description: string, specDefinitions: () => void): Suite;
160 | // ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these
161 | beforeEach(beforeEachFunction: () => void): void;
162 | beforeAll(beforeAllFunction: () => void): void;
163 | currentRunner(): Runner;
164 | afterEach(afterEachFunction: () => void): void;
165 | afterAll(afterAllFunction: () => void): void;
166 | xdescribe(desc: string, specDefinitions: () => void): XSuite;
167 | it(description: string, func: () => void): Spec;
168 | // iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these
169 | xit(desc: string, func: () => void): XSpec;
170 | compareRegExps_(a: RegExp, b: RegExp, mismatchKeys: string[], mismatchValues: string[]): boolean;
171 | compareObjects_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean;
172 | equals_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean;
173 | contains_(haystack: any, needle: any): boolean;
174 | addCustomEqualityTester(equalityTester: CustomEqualityTester): void;
175 | addMatchers(matchers: CustomMatcherFactories): void;
176 | specFilter(spec: Spec): boolean;
177 | }
178 |
179 | interface FakeTimer {
180 |
181 | new (): any;
182 |
183 | reset(): void;
184 | tick(millis: number): void;
185 | runFunctionsWithinRange(oldMillis: number, nowMillis: number): void;
186 | scheduleFunction(timeoutKey: any, funcToCall: () => void, millis: number, recurring: boolean): void;
187 | }
188 |
189 | interface HtmlReporter {
190 | new (): any;
191 | }
192 |
193 | interface HtmlSpecFilter {
194 | new (): any;
195 | }
196 |
197 | interface Result {
198 | type: string;
199 | }
200 |
201 | interface NestedResults extends Result {
202 | description: string;
203 |
204 | totalCount: number;
205 | passedCount: number;
206 | failedCount: number;
207 |
208 | skipped: boolean;
209 |
210 | rollupCounts(result: NestedResults): void;
211 | log(values: any): void;
212 | getItems(): Result[];
213 | addResult(result: Result): void;
214 | passed(): boolean;
215 | }
216 |
217 | interface MessageResult extends Result {
218 | values: any;
219 | trace: Trace;
220 | }
221 |
222 | interface ExpectationResult extends Result {
223 | matcherName: string;
224 | passed(): boolean;
225 | expected: any;
226 | actual: any;
227 | message: string;
228 | trace: Trace;
229 | }
230 |
231 | interface Trace {
232 | name: string;
233 | message: string;
234 | stack: any;
235 | }
236 |
237 | interface PrettyPrinter {
238 |
239 | new (): any;
240 |
241 | format(value: any): void;
242 | iterateObject(obj: any, fn: (property: string, isGetter: boolean) => void): void;
243 | emitScalar(value: any): void;
244 | emitString(value: string): void;
245 | emitArray(array: any[]): void;
246 | emitObject(obj: any): void;
247 | append(value: any): void;
248 | }
249 |
250 | interface StringPrettyPrinter extends PrettyPrinter {
251 | }
252 |
253 | interface Queue {
254 |
255 | new (env: any): any;
256 |
257 | env: Env;
258 | ensured: boolean[];
259 | blocks: Block[];
260 | running: boolean;
261 | index: number;
262 | offset: number;
263 | abort: boolean;
264 |
265 | addBefore(block: Block, ensure?: boolean): void;
266 | add(block: any, ensure?: boolean): void;
267 | insertNext(block: any, ensure?: boolean): void;
268 | start(onComplete?: () => void): void;
269 | isRunning(): boolean;
270 | next_(): void;
271 | results(): NestedResults;
272 | }
273 |
274 | interface Matchers {
275 |
276 | new (env: Env, actual: any, spec: Env, isNot?: boolean): any;
277 |
278 | env: Env;
279 | actual: any;
280 | spec: Env;
281 | isNot?: boolean;
282 | message(): any;
283 |
284 | toBe(expected: any, expectationFailOutput?: any): boolean;
285 | toEqual(expected: any, expectationFailOutput?: any): boolean;
286 | toMatch(expected: string | RegExp, expectationFailOutput?: any): boolean;
287 | toBeDefined(expectationFailOutput?: any): boolean;
288 | toBeUndefined(expectationFailOutput?: any): boolean;
289 | toBeNull(expectationFailOutput?: any): boolean;
290 | toBeNaN(): boolean;
291 | toBeTruthy(expectationFailOutput?: any): boolean;
292 | toBeFalsy(expectationFailOutput?: any): boolean;
293 | toHaveBeenCalled(): boolean;
294 | toHaveBeenCalledWith(...params: any[]): boolean;
295 | toHaveBeenCalledTimes(expected: number): boolean;
296 | toContain(expected: any, expectationFailOutput?: any): boolean;
297 | toBeLessThan(expected: number, expectationFailOutput?: any): boolean;
298 | toBeGreaterThan(expected: number, expectationFailOutput?: any): boolean;
299 | toBeCloseTo(expected: number, precision: any, expectationFailOutput?: any): boolean;
300 | toThrow(expected?: any): boolean;
301 | toThrowError(message?: string | RegExp): boolean;
302 | toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): boolean;
303 | not: Matchers;
304 |
305 | Any: Any;
306 | }
307 |
308 | interface Reporter {
309 | reportRunnerStarting(runner: Runner): void;
310 | reportRunnerResults(runner: Runner): void;
311 | reportSuiteResults(suite: Suite): void;
312 | reportSpecStarting(spec: Spec): void;
313 | reportSpecResults(spec: Spec): void;
314 | log(str: string): void;
315 | }
316 |
317 | interface MultiReporter extends Reporter {
318 | addReporter(reporter: Reporter): void;
319 | }
320 |
321 | interface Runner {
322 |
323 | new (env: Env): any;
324 |
325 | execute(): void;
326 | beforeEach(beforeEachFunction: SpecFunction): void;
327 | afterEach(afterEachFunction: SpecFunction): void;
328 | beforeAll(beforeAllFunction: SpecFunction): void;
329 | afterAll(afterAllFunction: SpecFunction): void;
330 | finishCallback(): void;
331 | addSuite(suite: Suite): void;
332 | add(block: Block): void;
333 | specs(): Spec[];
334 | suites(): Suite[];
335 | topLevelSuites(): Suite[];
336 | results(): NestedResults;
337 | }
338 |
339 | interface SpecFunction {
340 | (spec?: Spec): void;
341 | }
342 |
343 | interface SuiteOrSpec {
344 | id: number;
345 | env: Env;
346 | description: string;
347 | queue: Queue;
348 | }
349 |
350 | interface Spec extends SuiteOrSpec {
351 |
352 | new (env: Env, suite: Suite, description: string): any;
353 |
354 | suite: Suite;
355 |
356 | afterCallbacks: SpecFunction[];
357 | spies_: Spy[];
358 |
359 | results_: NestedResults;
360 | matchersClass: Matchers;
361 |
362 | getFullName(): string;
363 | results(): NestedResults;
364 | log(arguments: any): any;
365 | runs(func: SpecFunction): Spec;
366 | addToQueue(block: Block): void;
367 | addMatcherResult(result: Result): void;
368 | expect(actual: any): any;
369 | waits(timeout: number): Spec;
370 | waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec;
371 | fail(e?: any): void;
372 | getMatchersClass_(): Matchers;
373 | addMatchers(matchersPrototype: CustomMatcherFactories): void;
374 | finishCallback(): void;
375 | finish(onComplete?: () => void): void;
376 | after(doAfter: SpecFunction): void;
377 | execute(onComplete?: () => void): any;
378 | addBeforesAndAftersToQueue(): void;
379 | explodes(): void;
380 | spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy;
381 | removeAllSpies(): void;
382 | }
383 |
384 | interface XSpec {
385 | id: number;
386 | runs(): void;
387 | }
388 |
389 | interface Suite extends SuiteOrSpec {
390 |
391 | new (env: Env, description: string, specDefinitions: () => void, parentSuite: Suite): any;
392 |
393 | parentSuite: Suite;
394 |
395 | getFullName(): string;
396 | finish(onComplete?: () => void): void;
397 | beforeEach(beforeEachFunction: SpecFunction): void;
398 | afterEach(afterEachFunction: SpecFunction): void;
399 | beforeAll(beforeAllFunction: SpecFunction): void;
400 | afterAll(afterAllFunction: SpecFunction): void;
401 | results(): NestedResults;
402 | add(suiteOrSpec: SuiteOrSpec): void;
403 | specs(): Spec[];
404 | suites(): Suite[];
405 | children(): any[];
406 | execute(onComplete?: () => void): void;
407 | }
408 |
409 | interface XSuite {
410 | execute(): void;
411 | }
412 |
413 | interface Spy {
414 | (...params: any[]): any;
415 |
416 | identity: string;
417 | and: SpyAnd;
418 | calls: Calls;
419 | mostRecentCall: { args: any[]; };
420 | argsForCall: any[];
421 | wasCalled: boolean;
422 | }
423 |
424 | interface SpyAnd {
425 | /** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */
426 | callThrough(): Spy;
427 | /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */
428 | returnValue(val: any): Spy;
429 | /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */
430 | callFake(fn: Function): Spy;
431 | /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */
432 | throwError(msg: string): Spy;
433 | /** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */
434 | stub(): Spy;
435 | }
436 |
437 | interface Calls {
438 | /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. **/
439 | any(): boolean;
440 | /** By chaining the spy with calls.count(), will return the number of times the spy was called **/
441 | count(): number;
442 | /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index **/
443 | argsFor(index: number): any[];
444 | /** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/
445 | allArgs(): any[];
446 | /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/
447 | all(): CallInfo[];
448 | /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/
449 | mostRecent(): CallInfo;
450 | /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/
451 | first(): CallInfo;
452 | /** By chaining the spy with calls.reset(), will clears all tracking for a spy **/
453 | reset(): void;
454 | }
455 |
456 | interface CallInfo {
457 | /** The context (the this) for the call */
458 | object: any;
459 | /** All arguments passed to the call */
460 | args: any[];
461 | /** The return value of the call */
462 | returnValue: any;
463 | }
464 |
465 | interface Util {
466 | inherit(childClass: Function, parentClass: Function): any;
467 | formatException(e: any): any;
468 | htmlEscape(str: string): string;
469 | argsToArray(args: any): any;
470 | extend(destination: any, source: any): any;
471 | }
472 |
473 | interface JsApiReporter extends Reporter {
474 |
475 | started: boolean;
476 | finished: boolean;
477 | result: any;
478 | messages: any;
479 |
480 | new (): any;
481 |
482 | suites(): Suite[];
483 | summarize_(suiteOrSpec: SuiteOrSpec): any;
484 | results(): any;
485 | resultsForSpec(specId: any): any;
486 | log(str: any): any;
487 | resultsForSpecs(specIds: any): any;
488 | summarizeResult_(result: any): any;
489 | }
490 |
491 | interface Jasmine {
492 | Spec: Spec;
493 | clock: Clock;
494 | util: Util;
495 | }
496 |
497 | export var HtmlReporter: HtmlReporter;
498 | export var HtmlSpecFilter: HtmlSpecFilter;
499 | export var DEFAULT_TIMEOUT_INTERVAL: number;
500 | }
--------------------------------------------------------------------------------
/src/typings/index.d.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/clamarque/Angular2_Dashboard/1fff99fccd942cfd0d0167253aacea8cb7625cf4/src/typings/index.d.ts
--------------------------------------------------------------------------------
/src/typings/main.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 |
--------------------------------------------------------------------------------
/src/typings/main/ambient/firebase/index.d.ts:
--------------------------------------------------------------------------------
1 | // Generated by typings
2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/73fa26213aa5d2e1de5d7c2cc74118108cb2e5fa/firebase/firebase.d.ts
3 | // Type definitions for Firebase API 2.4.1
4 | // Project: https://www.firebase.com/docs/javascript/firebase
5 | // Definitions by: Vincent Botone , Shin1 Kashimura , Sebastien Dubois , Szymon Stasik
6 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7 |
8 | interface FirebaseAuthResult {
9 | auth: any;
10 | expires: number;
11 | }
12 |
13 | interface FirebaseDataSnapshot {
14 | /**
15 | * Returns true if this DataSnapshot contains any data.
16 | * It is slightly more efficient than using snapshot.val() !== null.
17 | */
18 | exists(): boolean;
19 | /**
20 | * Gets the JavaScript object representation of the DataSnapshot.
21 | */
22 | val(): any;
23 | /**
24 | * Gets a DataSnapshot for the location at the specified relative path.
25 | */
26 | child(childPath: string): FirebaseDataSnapshot;
27 | /**
28 | * Enumerates through the DataSnapshot’s children (in the default order).
29 | */
30 | forEach(childAction: (childSnapshot: FirebaseDataSnapshot) => void): boolean;
31 | forEach(childAction: (childSnapshot: FirebaseDataSnapshot) => boolean): boolean;
32 | /**
33 | * Returns true if the specified child exists.
34 | */
35 | hasChild(childPath: string): boolean;
36 | /**
37 | * Returns true if the DataSnapshot has any children.
38 | */
39 | hasChildren(): boolean;
40 | /**
41 | * Gets the key name of the location that generated this DataSnapshot.
42 | */
43 | key(): string;
44 | /**
45 | * @deprecated Use key() instead.
46 | * Gets the key name of the location that generated this DataSnapshot.
47 | */
48 | name(): string;
49 | /**
50 | * Gets the number of children for this DataSnapshot.
51 | */
52 | numChildren(): number;
53 | /**
54 | * Gets the Firebase reference for the location that generated this DataSnapshot.
55 | */
56 | ref(): Firebase;
57 | /**
58 | * Gets the priority of the data in this DataSnapshot.
59 | * @returns {string, number, null} The priority, or null if no priority was set.
60 | */
61 | getPriority(): any; // string or number
62 | /**
63 | * Exports the entire contents of the DataSnapshot as a JavaScript object.
64 | */
65 | exportVal(): Object;
66 | }
67 |
68 | interface FirebaseOnDisconnect {
69 | /**
70 | * Ensures the data at this location is set to the specified value when the client is disconnected
71 | * (due to closing the browser, navigating to a new page, or network issues).
72 | */
73 | set(value: any, onComplete: (error: any) => void): void;
74 | set(value: any): Promise;
75 | /**
76 | * Ensures the data at this location is set to the specified value and priority when the client is disconnected
77 | * (due to closing the browser, navigating to a new page, or network issues).
78 | */
79 | setWithPriority(value: any, priority: string|number, onComplete: (error: any) => void): void;
80 | setWithPriority(value: any, priority: string|number): Promise;
81 | /**
82 | * Writes the enumerated children at this Firebase location when the client is disconnected
83 | * (due to closing the browser, navigating to a new page, or network issues).
84 | */
85 | update(value: Object, onComplete: (error: any) => void): void;
86 | update(value: Object): Promise;
87 | /**
88 | * Ensures the data at this location is deleted when the client is disconnected
89 | * (due to closing the browser, navigating to a new page, or network issues).
90 | */
91 | remove(onComplete: (error: any) => void): void;
92 | remove(): Promise;
93 | /**
94 | * Cancels all previously queued onDisconnect() set or update events for this location and all children.
95 | */
96 | cancel(onComplete: (error: any) => void): void;
97 | cancel(): Promise;
98 | }
99 |
100 | interface FirebaseQuery {
101 | /**
102 | * Listens for data changes at a particular location.
103 | */
104 | on(eventType: string, callback: (dataSnapshot: FirebaseDataSnapshot, prevChildName?: string) => void, cancelCallback?: (error: any) => void, context?: Object): (dataSnapshot: FirebaseDataSnapshot, prevChildName?: string) => void;
105 | /**
106 | * Detaches a callback previously attached with on().
107 | */
108 | off(eventType?: string, callback?: (dataSnapshot: FirebaseDataSnapshot, prevChildName?: string) => void, context?: Object): void;
109 | /**
110 | * Listens for exactly one event of the specified event type, and then stops listening.
111 | */
112 | once(eventType: string, successCallback: (dataSnapshot: FirebaseDataSnapshot) => void, context?: Object): void;
113 | once(eventType: string, successCallback: (dataSnapshot: FirebaseDataSnapshot) => void, failureCallback?: (error: any) => void, context?: Object): void;
114 | once(eventType: string): Promise
115 | /**
116 | * Generates a new Query object ordered by the specified child key.
117 | */
118 | orderByChild(key: string): FirebaseQuery;
119 | /**
120 | * Generates a new Query object ordered by key name.
121 | */
122 | orderByKey(): FirebaseQuery;
123 | /**
124 | * Generates a new Query object ordered by child values.
125 | */
126 | orderByValue(): FirebaseQuery;
127 | /**
128 | * Generates a new Query object ordered by priority.
129 | */
130 | orderByPriority(): FirebaseQuery;
131 | /**
132 | * @deprecated Use limitToFirst() and limitToLast() instead.
133 | * Generates a new Query object limited to the specified number of children.
134 | */
135 | limit(limit: number): FirebaseQuery;
136 | /**
137 | * Creates a Query with the specified starting point.
138 | * The generated Query includes children which match the specified starting point.
139 | */
140 | startAt(value: string, key?: string): FirebaseQuery;
141 | startAt(value: number, key?: string): FirebaseQuery;
142 | /**
143 | * Creates a Query with the specified ending point.
144 | * The generated Query includes children which match the specified ending point.
145 | */
146 | endAt(value: string, key?: string): FirebaseQuery;
147 | endAt(value: number, key?: string): FirebaseQuery;
148 | /**
149 | * Creates a Query which includes children which match the specified value.
150 | */
151 | equalTo(value: string|number|boolean, key?: string): FirebaseQuery;
152 | /**
153 | * Generates a new Query object limited to the first certain number of children.
154 | */
155 | limitToFirst(limit: number): FirebaseQuery;
156 | /**
157 | * Generates a new Query object limited to the last certain number of children.
158 | */
159 | limitToLast(limit: number): FirebaseQuery;
160 | /**
161 | * Gets a Firebase reference to the Query's location.
162 | */
163 | ref(): Firebase;
164 | }
165 |
166 | interface Firebase extends FirebaseQuery {
167 | /**
168 | * @deprecated Use authWithCustomToken() instead.
169 | * Authenticates a Firebase client using the provided authentication token or Firebase Secret.
170 | */
171 | auth(authToken: string, onComplete: (error: any, result: FirebaseAuthResult) => void, onCancel?:(error: any) => void): void;
172 | auth(authToken: string): Promise;
173 | /**
174 | * Authenticates a Firebase client using an authentication token or Firebase Secret.
175 | */
176 | authWithCustomToken(autoToken: string, onComplete: (error: any, authData: FirebaseAuthData) => void, options?:Object): void;
177 | authWithCustomToken(autoToken: string, options?:Object): Promise;
178 | /**
179 | * Authenticates a Firebase client using a new, temporary guest account.
180 | */
181 | authAnonymously(onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
182 | authAnonymously(options?: Object): Promise;
183 | /**
184 | * Authenticates a Firebase client using an email / password combination.
185 | */
186 | authWithPassword(credentials: FirebaseCredentials, onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
187 | authWithPassword(credentials: FirebaseCredentials, options?: Object): Promise;
188 | /**
189 | * Authenticates a Firebase client using a popup-based OAuth flow.
190 | */
191 | authWithOAuthPopup(provider: string, onComplete:(error: any, authData: FirebaseAuthData) => void, options?: Object): void;
192 | authWithOAuthPopup(provider: string, options?: Object): Promise;
193 | /**
194 | * Authenticates a Firebase client using a redirect-based OAuth flow.
195 | */
196 | authWithOAuthRedirect(provider: string, onComplete: (error: any) => void, options?: Object): void;
197 | authWithOAuthRedirect(provider: string, options?: Object): Promise;
198 | /**
199 | * Authenticates a Firebase client using OAuth access tokens or credentials.
200 | */
201 | authWithOAuthToken(provider: string, credentials: string|Object, onComplete: (error: any, authData: FirebaseAuthData) => void, options?: Object): void;
202 | authWithOAuthToken(provider: string, credentials: string|Object, options?: Object): Promise;
203 | /**
204 | * Synchronously access the current authentication state of the client.
205 | */
206 | getAuth(): FirebaseAuthData;
207 | /**
208 | * Listen for changes to the client's authentication state.
209 | */
210 | onAuth(onComplete: (authData: FirebaseAuthData) => void, context?: Object): void;
211 | /**
212 | * Detaches a callback previously attached with onAuth().
213 | */
214 | offAuth(onComplete: (authData: FirebaseAuthData) => void, context?: Object): void;
215 | /**
216 | * Unauthenticates a Firebase client.
217 | */
218 | unauth(): void;
219 | /**
220 | * Gets a Firebase reference for the location at the specified relative path.
221 | */
222 | child(childPath: string): Firebase;
223 | /**
224 | * Gets a Firebase reference to the parent location.
225 | */
226 | parent(): Firebase;
227 | /**
228 | * Gets a Firebase reference to the root of the Firebase.
229 | */
230 | root(): Firebase;
231 | /**
232 | * Returns the last token in a Firebase location.
233 | */
234 | key(): string;
235 | /**
236 | * @deprecated Use key() instead.
237 | * Returns the last token in a Firebase location.
238 | */
239 | name(): string;
240 | /**
241 | * Gets the absolute URL corresponding to this Firebase reference's location.
242 | */
243 | toString(): string;
244 | /**
245 | * Writes data to this Firebase location.
246 | */
247 | set(value: any, onComplete: (error: any) => void): void;
248 | set(value: any): Promise;
249 | /**
250 | * Writes the enumerated children to this Firebase location.
251 | */
252 | update(value: Object, onComplete: (error: any) => void): void;
253 | update(value: Object): Promise;
254 | /**
255 | * Removes the data at this Firebase location.
256 | */
257 | remove(onComplete: (error: any) => void): void;
258 | remove(): Promise;
259 | /**
260 | * Generates a new child location using a unique name and returns a Firebase reference to it.
261 | * @returns {Firebase} A Firebase reference for the generated location.
262 | */
263 | push(value?: any, onComplete?: (error: any) => void): FirebaseWithPromise;
264 | /**
265 | * Writes data to this Firebase location. Like set() but also specifies the priority for that data.
266 | */
267 | setWithPriority(value: any, priority: string|number, onComplete: (error: any) => void): void;
268 | setWithPriority(value: any, priority: string|number): Promise;
269 | /**
270 | * Sets a priority for the data at this Firebase location.
271 | */
272 | setPriority(priority: string|number, onComplete: (error: any) => void): void;
273 | setPriority(priority: string|number): Promise;
274 | /**
275 | * Atomically modifies the data at this location.
276 | */
277 | transaction(updateFunction: (currentData: any)=> any, onComplete?: (error: any, committed: boolean, snapshot: FirebaseDataSnapshot) => void, applyLocally?: boolean): void;
278 | /**
279 | * Creates a new user account using an email / password combination.
280 | */
281 | createUser(credentials: FirebaseCredentials, onComplete: (error: any, userData: any) => void): void;
282 | /**
283 | * Updates the email associated with an email / password user account.
284 | */
285 | changeEmail(credentials: FirebaseChangeEmailCredentials, onComplete: (error: any) => void): void;
286 | /**
287 | * Change the password of an existing user using an email / password combination.
288 | */
289 | changePassword(credentials: FirebaseChangePasswordCredentials, onComplete: (error: any) => void): void;
290 | /**
291 | * Removes an existing user account using an email / password combination.
292 | */
293 | removeUser(credentials: FirebaseCredentials, onComplete: (error: any) => void): void;
294 | /**
295 | * Sends a password-reset email to the owner of the account, containing a token that may be used to authenticate and change the user password.
296 | */
297 | resetPassword(credentials: FirebaseResetPasswordCredentials, onComplete: (error: any) => void): void;
298 | onDisconnect(): FirebaseOnDisconnect;
299 | }
300 |
301 | interface FirebaseWithPromise extends Firebase, Promise {}
302 |
303 | interface FirebaseStatic {
304 | /**
305 | * Constructs a new Firebase reference from a full Firebase URL.
306 | */
307 | new (firebaseURL: string): Firebase;
308 | /**
309 | * Manually disconnects the Firebase client from the server and disables automatic reconnection.
310 | */
311 | goOffline(): void;
312 | /**
313 | * Manually reestablishes a connection to the Firebase server and enables automatic reconnection.
314 | */
315 | goOnline(): void;
316 |
317 | ServerValue: {
318 | /**
319 | * A placeholder value for auto-populating the current timestamp
320 | * (time since the Unix epoch, in milliseconds) by the Firebase servers.
321 | */
322 | TIMESTAMP: any;
323 | };
324 | }
325 | declare var Firebase: FirebaseStatic;
326 |
327 | declare module 'firebase' {
328 | export = Firebase;
329 | }
330 |
331 | // Reference: https://www.firebase.com/docs/web/api/firebase/getauth.html
332 | interface FirebaseAuthData {
333 | uid: string;
334 | provider: string;
335 | token: string;
336 | expires: number;
337 | auth: Object;
338 | google?: FirebaseAuthDataGoogle;
339 | twitter?: FirebaseAuthDataTwitter;
340 | github?: FirebaseAuthDataGithub;
341 | facebook?: FirebaseAuthDataFacebook;
342 | password?: FirebaseAuthDataPassword;
343 | anonymous?: any;
344 | }
345 |
346 | interface FirebaseAuthDataPassword{
347 | email: string;
348 | isTemporaryPassword: boolean;
349 | profileImageURL: string;
350 | }
351 |
352 | interface FirebaseAuthDataTwitter{
353 | id: string;
354 | accessToken: string;
355 | accessTokenSecret: string;
356 | displayName: string;
357 | username: string;
358 | profileImageURL: string;
359 | cachedUserProfile: any;
360 | }
361 |
362 | interface FirebaseAuthDataGithub{
363 | id: string;
364 | accessToken: string;
365 | displayName: string;
366 | email?: string;
367 | username: string;
368 | profileImageURL: string;
369 | cachedUserProfile: any;
370 | }
371 |
372 | interface FirebaseAuthDataFacebook{
373 | id: string;
374 | accessToken: string;
375 | displayName: string;
376 | email?: string;
377 | profileImageURL: string;
378 | cachedUserProfile: any;
379 | }
380 |
381 | interface FirebaseAuthDataGoogle {
382 | accessToken: string;
383 | cachedUserProfile: FirebaseAuthDataGoogleCachedUserProfile;
384 | displayName: string;
385 | email?: string;
386 | id: string;
387 | profileImageURL: string;
388 | }
389 |
390 | interface FirebaseAuthDataGoogleCachedUserProfile {
391 | "family name"?: string;
392 | gender?: string;
393 | "given name"?: string;
394 | id?: string;
395 | link?: string;
396 | locale?: string;
397 | name?: string;
398 | picture?: string;
399 | }
400 |
401 | interface FirebaseCredentials {
402 | email: string;
403 | password: string;
404 | }
405 |
406 | interface FirebaseChangePasswordCredentials {
407 | email: string;
408 | oldPassword: string;
409 | newPassword: string;
410 | }
411 |
412 | interface FirebaseChangeEmailCredentials {
413 | oldEmail: string;
414 | newEmail: string;
415 | password: string;
416 | }
417 |
418 | interface FirebaseResetPasswordCredentials {
419 | email: string;
420 | }
--------------------------------------------------------------------------------
/src/typings/main/ambient/jasmine/index.d.ts:
--------------------------------------------------------------------------------
1 | // Generated by typings
2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/7de6c3dd94feaeb21f20054b9f30d5dabc5efabd/jasmine/jasmine.d.ts
3 | // Type definitions for Jasmine 2.2
4 | // Project: http://jasmine.github.io/
5 | // Definitions by: Boris Yankov , Theodore Brown , David Pärsson
6 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7 |
8 |
9 | // For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts
10 |
11 | declare function describe(description: string, specDefinitions: () => void): void;
12 | declare function fdescribe(description: string, specDefinitions: () => void): void;
13 | declare function xdescribe(description: string, specDefinitions: () => void): void;
14 |
15 | declare function it(expectation: string, assertion?: () => void, timeout?: number): void;
16 | declare function it(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
17 | declare function fit(expectation: string, assertion?: () => void, timeout?: number): void;
18 | declare function fit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
19 | declare function xit(expectation: string, assertion?: () => void, timeout?: number): void;
20 | declare function xit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void;
21 |
22 | /** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */
23 | declare function pending(reason?: string): void;
24 |
25 | declare function beforeEach(action: () => void, timeout?: number): void;
26 | declare function beforeEach(action: (done: () => void) => void, timeout?: number): void;
27 | declare function afterEach(action: () => void, timeout?: number): void;
28 | declare function afterEach(action: (done: () => void) => void, timeout?: number): void;
29 |
30 | declare function beforeAll(action: () => void, timeout?: number): void;
31 | declare function beforeAll(action: (done: () => void) => void, timeout?: number): void;
32 | declare function afterAll(action: () => void, timeout?: number): void;
33 | declare function afterAll(action: (done: () => void) => void, timeout?: number): void;
34 |
35 | declare function expect(spy: Function): jasmine.Matchers;
36 | declare function expect(actual: any): jasmine.Matchers;
37 |
38 | declare function fail(e?: any): void;
39 |
40 | declare function spyOn(object: any, method: string): jasmine.Spy;
41 |
42 | declare function runs(asyncMethod: Function): void;
43 | declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void;
44 | declare function waits(timeout?: number): void;
45 |
46 | declare namespace jasmine {
47 |
48 | var clock: () => Clock;
49 |
50 | function any(aclass: any): Any;
51 | function anything(): Any;
52 | function arrayContaining(sample: any[]): ArrayContaining;
53 | function objectContaining(sample: any): ObjectContaining;
54 | function createSpy(name: string, originalFn?: Function): Spy;
55 | function createSpyObj(baseName: string, methodNames: any[]): any;
56 | function createSpyObj(baseName: string, methodNames: any[]): T;
57 | function pp(value: any): string;
58 | function getEnv(): Env;
59 | function addCustomEqualityTester(equalityTester: CustomEqualityTester): void;
60 | function addMatchers(matchers: CustomMatcherFactories): void;
61 | function stringMatching(str: string): Any;
62 | function stringMatching(str: RegExp): Any;
63 |
64 | interface Any {
65 |
66 | new (expectedClass: any): any;
67 |
68 | jasmineMatches(other: any): boolean;
69 | jasmineToString(): string;
70 | }
71 |
72 | // taken from TypeScript lib.core.es6.d.ts, applicable to CustomMatchers.contains()
73 | interface ArrayLike {
74 | length: number;
75 | [n: number]: T;
76 | }
77 |
78 | interface ArrayContaining {
79 | new (sample: any[]): any;
80 |
81 | asymmetricMatch(other: any): boolean;
82 | jasmineToString(): string;
83 | }
84 |
85 | interface ObjectContaining {
86 | new (sample: any): any;
87 |
88 | jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean;
89 | jasmineToString(): string;
90 | }
91 |
92 | interface Block {
93 |
94 | new (env: Env, func: SpecFunction, spec: Spec): any;
95 |
96 | execute(onComplete: () => void): void;
97 | }
98 |
99 | interface WaitsBlock extends Block {
100 | new (env: Env, timeout: number, spec: Spec): any;
101 | }
102 |
103 | interface WaitsForBlock extends Block {
104 | new (env: Env, timeout: number, latchFunction: SpecFunction, message: string, spec: Spec): any;
105 | }
106 |
107 | interface Clock {
108 | install(): void;
109 | uninstall(): void;
110 | /** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */
111 | tick(ms: number): void;
112 | mockDate(date?: Date): void;
113 | }
114 |
115 | interface CustomEqualityTester {
116 | (first: any, second: any): boolean;
117 | }
118 |
119 | interface CustomMatcher {
120 | compare(actual: T, expected: T): CustomMatcherResult;
121 | compare(actual: any, expected: any): CustomMatcherResult;
122 | }
123 |
124 | interface CustomMatcherFactory {
125 | (util: MatchersUtil, customEqualityTesters: Array): CustomMatcher;
126 | }
127 |
128 | interface CustomMatcherFactories {
129 | [index: string]: CustomMatcherFactory;
130 | }
131 |
132 | interface CustomMatcherResult {
133 | pass: boolean;
134 | message?: string;
135 | }
136 |
137 | interface MatchersUtil {
138 | equals(a: any, b: any, customTesters?: Array): boolean;
139 | contains(haystack: ArrayLike | string, needle: any, customTesters?: Array): boolean;
140 | buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array): string;
141 | }
142 |
143 | interface Env {
144 | setTimeout: any;
145 | clearTimeout: void;
146 | setInterval: any;
147 | clearInterval: void;
148 | updateInterval: number;
149 |
150 | currentSpec: Spec;
151 |
152 | matchersClass: Matchers;
153 |
154 | version(): any;
155 | versionString(): string;
156 | nextSpecId(): number;
157 | addReporter(reporter: Reporter): void;
158 | execute(): void;
159 | describe(description: string, specDefinitions: () => void): Suite;
160 | // ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these
161 | beforeEach(beforeEachFunction: () => void): void;
162 | beforeAll(beforeAllFunction: () => void): void;
163 | currentRunner(): Runner;
164 | afterEach(afterEachFunction: () => void): void;
165 | afterAll(afterAllFunction: () => void): void;
166 | xdescribe(desc: string, specDefinitions: () => void): XSuite;
167 | it(description: string, func: () => void): Spec;
168 | // iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these
169 | xit(desc: string, func: () => void): XSpec;
170 | compareRegExps_(a: RegExp, b: RegExp, mismatchKeys: string[], mismatchValues: string[]): boolean;
171 | compareObjects_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean;
172 | equals_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean;
173 | contains_(haystack: any, needle: any): boolean;
174 | addCustomEqualityTester(equalityTester: CustomEqualityTester): void;
175 | addMatchers(matchers: CustomMatcherFactories): void;
176 | specFilter(spec: Spec): boolean;
177 | }
178 |
179 | interface FakeTimer {
180 |
181 | new (): any;
182 |
183 | reset(): void;
184 | tick(millis: number): void;
185 | runFunctionsWithinRange(oldMillis: number, nowMillis: number): void;
186 | scheduleFunction(timeoutKey: any, funcToCall: () => void, millis: number, recurring: boolean): void;
187 | }
188 |
189 | interface HtmlReporter {
190 | new (): any;
191 | }
192 |
193 | interface HtmlSpecFilter {
194 | new (): any;
195 | }
196 |
197 | interface Result {
198 | type: string;
199 | }
200 |
201 | interface NestedResults extends Result {
202 | description: string;
203 |
204 | totalCount: number;
205 | passedCount: number;
206 | failedCount: number;
207 |
208 | skipped: boolean;
209 |
210 | rollupCounts(result: NestedResults): void;
211 | log(values: any): void;
212 | getItems(): Result[];
213 | addResult(result: Result): void;
214 | passed(): boolean;
215 | }
216 |
217 | interface MessageResult extends Result {
218 | values: any;
219 | trace: Trace;
220 | }
221 |
222 | interface ExpectationResult extends Result {
223 | matcherName: string;
224 | passed(): boolean;
225 | expected: any;
226 | actual: any;
227 | message: string;
228 | trace: Trace;
229 | }
230 |
231 | interface Trace {
232 | name: string;
233 | message: string;
234 | stack: any;
235 | }
236 |
237 | interface PrettyPrinter {
238 |
239 | new (): any;
240 |
241 | format(value: any): void;
242 | iterateObject(obj: any, fn: (property: string, isGetter: boolean) => void): void;
243 | emitScalar(value: any): void;
244 | emitString(value: string): void;
245 | emitArray(array: any[]): void;
246 | emitObject(obj: any): void;
247 | append(value: any): void;
248 | }
249 |
250 | interface StringPrettyPrinter extends PrettyPrinter {
251 | }
252 |
253 | interface Queue {
254 |
255 | new (env: any): any;
256 |
257 | env: Env;
258 | ensured: boolean[];
259 | blocks: Block[];
260 | running: boolean;
261 | index: number;
262 | offset: number;
263 | abort: boolean;
264 |
265 | addBefore(block: Block, ensure?: boolean): void;
266 | add(block: any, ensure?: boolean): void;
267 | insertNext(block: any, ensure?: boolean): void;
268 | start(onComplete?: () => void): void;
269 | isRunning(): boolean;
270 | next_(): void;
271 | results(): NestedResults;
272 | }
273 |
274 | interface Matchers {
275 |
276 | new (env: Env, actual: any, spec: Env, isNot?: boolean): any;
277 |
278 | env: Env;
279 | actual: any;
280 | spec: Env;
281 | isNot?: boolean;
282 | message(): any;
283 |
284 | toBe(expected: any, expectationFailOutput?: any): boolean;
285 | toEqual(expected: any, expectationFailOutput?: any): boolean;
286 | toMatch(expected: string | RegExp, expectationFailOutput?: any): boolean;
287 | toBeDefined(expectationFailOutput?: any): boolean;
288 | toBeUndefined(expectationFailOutput?: any): boolean;
289 | toBeNull(expectationFailOutput?: any): boolean;
290 | toBeNaN(): boolean;
291 | toBeTruthy(expectationFailOutput?: any): boolean;
292 | toBeFalsy(expectationFailOutput?: any): boolean;
293 | toHaveBeenCalled(): boolean;
294 | toHaveBeenCalledWith(...params: any[]): boolean;
295 | toHaveBeenCalledTimes(expected: number): boolean;
296 | toContain(expected: any, expectationFailOutput?: any): boolean;
297 | toBeLessThan(expected: number, expectationFailOutput?: any): boolean;
298 | toBeGreaterThan(expected: number, expectationFailOutput?: any): boolean;
299 | toBeCloseTo(expected: number, precision: any, expectationFailOutput?: any): boolean;
300 | toThrow(expected?: any): boolean;
301 | toThrowError(message?: string | RegExp): boolean;
302 | toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): boolean;
303 | not: Matchers;
304 |
305 | Any: Any;
306 | }
307 |
308 | interface Reporter {
309 | reportRunnerStarting(runner: Runner): void;
310 | reportRunnerResults(runner: Runner): void;
311 | reportSuiteResults(suite: Suite): void;
312 | reportSpecStarting(spec: Spec): void;
313 | reportSpecResults(spec: Spec): void;
314 | log(str: string): void;
315 | }
316 |
317 | interface MultiReporter extends Reporter {
318 | addReporter(reporter: Reporter): void;
319 | }
320 |
321 | interface Runner {
322 |
323 | new (env: Env): any;
324 |
325 | execute(): void;
326 | beforeEach(beforeEachFunction: SpecFunction): void;
327 | afterEach(afterEachFunction: SpecFunction): void;
328 | beforeAll(beforeAllFunction: SpecFunction): void;
329 | afterAll(afterAllFunction: SpecFunction): void;
330 | finishCallback(): void;
331 | addSuite(suite: Suite): void;
332 | add(block: Block): void;
333 | specs(): Spec[];
334 | suites(): Suite[];
335 | topLevelSuites(): Suite[];
336 | results(): NestedResults;
337 | }
338 |
339 | interface SpecFunction {
340 | (spec?: Spec): void;
341 | }
342 |
343 | interface SuiteOrSpec {
344 | id: number;
345 | env: Env;
346 | description: string;
347 | queue: Queue;
348 | }
349 |
350 | interface Spec extends SuiteOrSpec {
351 |
352 | new (env: Env, suite: Suite, description: string): any;
353 |
354 | suite: Suite;
355 |
356 | afterCallbacks: SpecFunction[];
357 | spies_: Spy[];
358 |
359 | results_: NestedResults;
360 | matchersClass: Matchers;
361 |
362 | getFullName(): string;
363 | results(): NestedResults;
364 | log(arguments: any): any;
365 | runs(func: SpecFunction): Spec;
366 | addToQueue(block: Block): void;
367 | addMatcherResult(result: Result): void;
368 | expect(actual: any): any;
369 | waits(timeout: number): Spec;
370 | waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec;
371 | fail(e?: any): void;
372 | getMatchersClass_(): Matchers;
373 | addMatchers(matchersPrototype: CustomMatcherFactories): void;
374 | finishCallback(): void;
375 | finish(onComplete?: () => void): void;
376 | after(doAfter: SpecFunction): void;
377 | execute(onComplete?: () => void): any;
378 | addBeforesAndAftersToQueue(): void;
379 | explodes(): void;
380 | spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy;
381 | removeAllSpies(): void;
382 | }
383 |
384 | interface XSpec {
385 | id: number;
386 | runs(): void;
387 | }
388 |
389 | interface Suite extends SuiteOrSpec {
390 |
391 | new (env: Env, description: string, specDefinitions: () => void, parentSuite: Suite): any;
392 |
393 | parentSuite: Suite;
394 |
395 | getFullName(): string;
396 | finish(onComplete?: () => void): void;
397 | beforeEach(beforeEachFunction: SpecFunction): void;
398 | afterEach(afterEachFunction: SpecFunction): void;
399 | beforeAll(beforeAllFunction: SpecFunction): void;
400 | afterAll(afterAllFunction: SpecFunction): void;
401 | results(): NestedResults;
402 | add(suiteOrSpec: SuiteOrSpec): void;
403 | specs(): Spec[];
404 | suites(): Suite[];
405 | children(): any[];
406 | execute(onComplete?: () => void): void;
407 | }
408 |
409 | interface XSuite {
410 | execute(): void;
411 | }
412 |
413 | interface Spy {
414 | (...params: any[]): any;
415 |
416 | identity: string;
417 | and: SpyAnd;
418 | calls: Calls;
419 | mostRecentCall: { args: any[]; };
420 | argsForCall: any[];
421 | wasCalled: boolean;
422 | }
423 |
424 | interface SpyAnd {
425 | /** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */
426 | callThrough(): Spy;
427 | /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */
428 | returnValue(val: any): Spy;
429 | /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */
430 | callFake(fn: Function): Spy;
431 | /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */
432 | throwError(msg: string): Spy;
433 | /** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */
434 | stub(): Spy;
435 | }
436 |
437 | interface Calls {
438 | /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. **/
439 | any(): boolean;
440 | /** By chaining the spy with calls.count(), will return the number of times the spy was called **/
441 | count(): number;
442 | /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index **/
443 | argsFor(index: number): any[];
444 | /** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/
445 | allArgs(): any[];
446 | /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/
447 | all(): CallInfo[];
448 | /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/
449 | mostRecent(): CallInfo;
450 | /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/
451 | first(): CallInfo;
452 | /** By chaining the spy with calls.reset(), will clears all tracking for a spy **/
453 | reset(): void;
454 | }
455 |
456 | interface CallInfo {
457 | /** The context (the this) for the call */
458 | object: any;
459 | /** All arguments passed to the call */
460 | args: any[];
461 | /** The return value of the call */
462 | returnValue: any;
463 | }
464 |
465 | interface Util {
466 | inherit(childClass: Function, parentClass: Function): any;
467 | formatException(e: any): any;
468 | htmlEscape(str: string): string;
469 | argsToArray(args: any): any;
470 | extend(destination: any, source: any): any;
471 | }
472 |
473 | interface JsApiReporter extends Reporter {
474 |
475 | started: boolean;
476 | finished: boolean;
477 | result: any;
478 | messages: any;
479 |
480 | new (): any;
481 |
482 | suites(): Suite[];
483 | summarize_(suiteOrSpec: SuiteOrSpec): any;
484 | results(): any;
485 | resultsForSpec(specId: any): any;
486 | log(str: any): any;
487 | resultsForSpecs(specIds: any): any;
488 | summarizeResult_(result: any): any;
489 | }
490 |
491 | interface Jasmine {
492 | Spec: Spec;
493 | clock: Clock;
494 | util: Util;
495 | }
496 |
497 | export var HtmlReporter: HtmlReporter;
498 | export var HtmlSpecFilter: HtmlSpecFilter;
499 | export var DEFAULT_TIMEOUT_INTERVAL: number;
500 | }
--------------------------------------------------------------------------------