Skip to content

Commit

Permalink
152 separate the iot modules from dashboard (#239)
Browse files Browse the repository at this point in the history
* Move components

* Move more component

* Add all component for iot inside its own folder

* Move more iot components, data layer into the module itself

* Fix emmiter typo

* Add mocks for iot

* Use IotRequestsService instead

* Working after changes

* Remove role code from requests

* Fully linted code

* Updated the module

* Update the profile

* Fix linting issue

* Update the io

* Bring back the android build
  • Loading branch information
torabian authored Aug 28, 2018
1 parent 0f6bc0c commit 34ad0db
Show file tree
Hide file tree
Showing 172 changed files with 1,204 additions and 1,335 deletions.
74 changes: 37 additions & 37 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,40 +47,40 @@ matrix:
keep-history: true
on:
branch: master
# - language: android
# android:
# components:
# - tools
# notifications:
# email: false
# before_install:
# - yes | sdkmanager "platforms;android-26"
# install:
# - nvm install 9
# - npm install
# - npm install -g cordova
# - echo y | android update sdk -u --filter android-22,android-23
# - npm run build:mobile
# before_deploy:
# - git config --local user.name "TravisBuildAgent"
# - git config --local user.email "[email protected]"
# - git tag "$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)"
# deploy:
# provider: releases
# api_key:
# secure: hu/XAmiqTJDH+4rGGEgTZATXIlX/9RjYTq3wS2+1ltnmEqNmKuImCLpz4W+Gd2WLa4nE04zVZONSjVwLjx1eNKO/mM5TPMT4NL2zZsEGDkKXajBRe+WiyZafvVZTNfbmTxmPnOoQQW0I3IjNVPEltx6dwBny0423cqkQcR9ORxGgZNvL+Ic/AuHEahQmdZzP74gk2hWFNh75U4sN2O0vstWqH2c1EU3owk0NYaw/1QMfy0Mk5sI7/87tlae8AuZ6wqWIkCYuUQHnEDfyYva3Qj0vPnde4fLvf+MOiDZ1y+uuFP44LjjjFdMntOIeGq8SU+7OrwWyU7t/wbB8e+VXqjnjzxoWEIw0xWtRXi+sPpVcKJgyhayJu5+eJlj3LK22rMKtzRhLg2lTG1xOBL7YLHnanBFPAyZRVGtPH9YFEFcwuJvDLXoQQVuZWy+nOtAxvsBxKf4fPFGXVfnigRdtZrx/7yauVUVer1rJndxsRNrGhIBFrVzLiP5Xg701Lc1XDLk1XxCEEv7HOj0OEiP8jL+FZL0q3JXO2C2yE1X/fLJ3pPFLmHBqbMTNYkQs7LhtVmtN0aKcGosvRChVeFQjevkG23se2wxHuIbx3NMz9ipumzuHUt+TZQOaTn3TqxUmo1b7Uim5hKZKMq6CTGyPoOjHywQDo76gZxj6ZMpAtZ8=
# file: "$TRAVIS_BUILD_DIR/mobile/platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk"
# on:
# repo: owsolutions/angular5-iot-dashboard
# skip_cleanup: true
# overwrite: true
# prerelease: true
# before_script:
# - cordova platform rm android
# - cordova platform add android
# script:
# - cd mobile
# - cordova prepare
# - cordova build android --release -- --ant
# release:
# - exit 0
- language: android
android:
components:
- tools
notifications:
email: false
before_install:
- yes | sdkmanager "platforms;android-26"
install:
- nvm install 9
- npm install
- npm install -g cordova
- echo y | android update sdk -u --filter android-22,android-23
- npm run build:mobile
before_deploy:
- git config --local user.name "TravisBuildAgent"
- git config --local user.email "[email protected]"
- git tag "$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)"
deploy:
provider: releases
api_key:
secure: hu/XAmiqTJDH+4rGGEgTZATXIlX/9RjYTq3wS2+1ltnmEqNmKuImCLpz4W+Gd2WLa4nE04zVZONSjVwLjx1eNKO/mM5TPMT4NL2zZsEGDkKXajBRe+WiyZafvVZTNfbmTxmPnOoQQW0I3IjNVPEltx6dwBny0423cqkQcR9ORxGgZNvL+Ic/AuHEahQmdZzP74gk2hWFNh75U4sN2O0vstWqH2c1EU3owk0NYaw/1QMfy0Mk5sI7/87tlae8AuZ6wqWIkCYuUQHnEDfyYva3Qj0vPnde4fLvf+MOiDZ1y+uuFP44LjjjFdMntOIeGq8SU+7OrwWyU7t/wbB8e+VXqjnjzxoWEIw0xWtRXi+sPpVcKJgyhayJu5+eJlj3LK22rMKtzRhLg2lTG1xOBL7YLHnanBFPAyZRVGtPH9YFEFcwuJvDLXoQQVuZWy+nOtAxvsBxKf4fPFGXVfnigRdtZrx/7yauVUVer1rJndxsRNrGhIBFrVzLiP5Xg701Lc1XDLk1XxCEEv7HOj0OEiP8jL+FZL0q3JXO2C2yE1X/fLJ3pPFLmHBqbMTNYkQs7LhtVmtN0aKcGosvRChVeFQjevkG23se2wxHuIbx3NMz9ipumzuHUt+TZQOaTn3TqxUmo1b7Uim5hKZKMq6CTGyPoOjHywQDo76gZxj6ZMpAtZ8=
file: "$TRAVIS_BUILD_DIR/mobile/platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk"
on:
repo: owsolutions/angular5-iot-dashboard
skip_cleanup: true
overwrite: true
prerelease: true
before_script:
- cordova platform rm android
- cordova platform add android
script:
- cd mobile
- cordova prepare
- cordova build android --release -- --ant
release:
- exit 0
111 changes: 11 additions & 100 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { FormsModule } from '@angular/forms';
import { appReducersGenerator } from './app.reducers';
import { createRoutes } from './app.routes';
import { NgMediaModule } from './ng-media/ng-media-module';
import { RealtimeService } from '@services/realtime.service';
import { NotificationService } from '@services/notification.service';
import { SettingsComponent } from '@components/settings/settings.component';
import { PageHeaderComponent } from '@components/page-header/page-header.component';
Expand All @@ -18,75 +17,37 @@ import { RequestsService } from '@services/requests.service';
import { CheckboxInputComponent } from '@components/forms/checkbox-input/checkbox-input.component';
import { ActionsService } from '@services/actions.service';
import { UserService, AuthGuard } from '@services/user.service';
import { DevicesComponent } from '@components/devices/devices.component';
import { ActivityWidgetComponent } from '@components/activity/activity-widget/activity-widget.component';
import { LocationsComponent } from '@components/locations/locations.component';
import { ActivityComponent } from '@components/activity/activity.component';
import { LocationRowComponent } from '@components/locations/location-row/location-row.component';
import { LocationSingleComponent } from '@components/locations/location-single/location-single.component';
import { OutputPinViewComponent } from '@components/output-pin-view/output-pin-view.component';
import { SwitchWidgetsComponent } from '@components/switch-widgets/switch-widgets.component';
import { IconWidgetsComponent } from '@components/index/icon-widgets/icon-widgets.component';
import { PlacesComponent } from '@components/index/places/places.component';
import { IndexComponent } from '@components/index/index.component';
import { UserWidgetComponent } from '@components/user-widget/user-widget.component';
import { GalleryComponent } from '@components/gallery/gallery.component';
import { LoadingComponent } from '@components/loading/loading.component';
import { NavigationComponent } from '@components/navigation/navigation.component';
import { SidebarWidgetComponent } from '@components/sidebar-widget/sidebar-widget.component';
import { IotSvgService } from '@services/iot-svg/iot-svg.service';
import { DeviceSingleComponent } from 'app/components/device-single/device-single.component';
import { DocsComponent } from '@components/docs/docs.component';
import { DocsApiWorkaroundComponent } from '@components/docs/docs-api-workaround/docs-api-workaround.component';
import { DeviceGeneralInformationComponent } from 'app/components/device-general-information/device-general-information.component';
import { DeviceTemperatureComponent } from '@app/components/device-temperature/device-temperature.component';
import { DeviceLampComponent } from '@app/components/device-lamp/device-lamp.component';
import { DeviceCO2Component } from '@app/components/device-co2/device-co2.component';
import { DeviceHumidityComponent } from '@app/components/device-humidity/device-humidity.component';
import { StatisticsComponent } from '@components/statistics/statistics.component';
import { environment } from '../environments/environment';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { MockInterceptor } from '@services/mock.interceptor';
import { MockService } from '@services/mocks.service';
import { TokenInterceptor } from '@services/token.interceptor';
import { GeneralInterceptorService } from '@services/general-interceptor.service';
import { QuickChartComponent } from './components/quick-chart/quick-chart.component';
import { ProgressLineComponent } from './components/progress-line/progress-line.component';
import { RealtimeDocumentModule } from 'realtime-document';
import { QuickChartComponent } from '@app/components/quick-chart/quick-chart.component';
import { ToasterModule } from 'angular2-toaster';
import { ApplicationsListComponent } from './components/applications-list/applications-list.component';
import { DashboardComponent } from './components/dashboard/dashboard.component';
import { ActivitiesComponent } from './components/widgets/activities/activities.component';
import { HistoryStatisticsComponent } from './components/widgets/history-statistics/history-statistics.component';
import { DailyStatisticsComponent } from '@app/components/widgets/daily-statistics/daily-statistics.component';
import { ExperimentalComponent } from './components/experimental/experimental.component';
import { NgxTooltipModule } from './components/ngx-tooltip/ngx-tooltip.module';
import { SendingInformationHttpsComponent } from './components/docs/sending-information-https/sending-information-https.component';
import { PrivacyPolicyComponent } from './components/privacy-policy/privacy-policy.component';
import { ProfileComponent } from './components/profile/profile.component';
import { DeviceEventsActionsComponent } from '@app/components/device-events-actions/device-events-actions.component';
import { ContactDetailsComponent } from './components/contact-details/contact-details.component';
import { IfExperimentalComponent } from './components/if-experimental/if-experimental.component';
import { GpsComponent } from '@app/components/gps/gps.component';
import { D3neComponent } from './components/d3ne/d3ne.component';
import { LampCardComponent } from '@app/components/widgets/lamp-card//lamp-card.component';
import { HumidityComponent } from '@app/components/widgets/humidity/humidity.component';
import { CO2WidgetComponent } from '@app/components/widgets/co2-widget/co2-widget.component';
import { NgxTooltipModule } from '@app/components/ngx-tooltip/ngx-tooltip.module';
import { PrivacyPolicyComponent } from '@app/components/privacy-policy/privacy-policy.component';
import { ProfileComponent } from '@app/components/profile/profile.component';
import { ContactDetailsComponent } from '@app/components/contact-details/contact-details.component';
import { TranslateModule } from '@ngx-translate/core';
import { TranslateService } from '@ngx-translate/core';
import { Ng5BasicModule } from './ng5-basic/ng5-basic.module';
import pl from './translations/pl';
import fa from './translations/fa';
import { GlobalizationService } from '@app/services/globalization.service';
import { RestfulComponent } from '@app/components/docs/restful/restful.component';
import { IfNotEnglishComponent } from './components/if-not-english/if-not-english.component';
import { WaterBubbleComponent } from './components/water-bubble/water-bubble.component';
import { Co2Component } from './components/co2/co2.component';
import { DOCUMENT } from '@angular/common';
import { UsersModule } from '@app/users/users.module';
import { NgUikitModule } from '@app/ng-uikit/ng-uikit.module';
import { CalendarModule } from 'angular-calendar';
import { AngularCalendarComponent } from './components/angular-calendar/angular-calendar.component';
import { AngularCalendarComponent } from '@app/boilerplate/angular-calendar/angular-calendar.component';
import { IotModule } from '@app/iot/iot.module';

declare var require: any;
const Highcharts = require('highcharts/highstock');
Expand All @@ -98,17 +59,15 @@ window['Highcharts'] = Highcharts;
})
export class AppComponent implements OnInit {
constructor (
private realtime: RealtimeService,
private translate: TranslateService,
private globalization: GlobalizationService,
@Inject(DOCUMENT) private document: Document
) {
this.realtime.ActivateRealtime();
this.RestoreLanguage();
}

ngOnInit() {
this.globalization.layoutDirectionEmmiter.subscribe(direction => {
this.globalization.layoutDirectionEmitter.subscribe(direction => {
this.document.body.setAttribute('dir', direction);
});
}
Expand All @@ -119,7 +78,6 @@ export class AppComponent implements OnInit {
if (_lang === 'en' || _lang === 'pl' || _lang === 'fa') {
lang = _lang;
}

this.translate.setTranslation('pl', pl);
this.translate.setTranslation('fa', fa);
this.translate.use(lang);
Expand All @@ -135,68 +93,28 @@ export class AppComponent implements OnInit {
SettingsComponent,
PageHeaderComponent,
TextInputComponent,
DocsApiWorkaroundComponent,
DeviceSingleComponent,
ProgressLineComponent,
RadioInputComponent,
SelectInputComponent,
DailyStatisticsComponent,
SidebarWidgetComponent,
CheckboxInputComponent,
DevicesComponent,
LampCardComponent,
HumidityComponent,
ActivityWidgetComponent,
LocationsComponent,
ActivityComponent,
DeviceGeneralInformationComponent,
LocationRowComponent,
LocationSingleComponent,
OutputPinViewComponent,
NavigationComponent,
DeviceTemperatureComponent,
DeviceLampComponent,
DeviceCO2Component,
DeviceHumidityComponent,
SwitchWidgetsComponent,
IconWidgetsComponent,
PlacesComponent,
DocsComponent,
QuickChartComponent,
IndexComponent,
UserWidgetComponent,
GalleryComponent,
LoadingComponent,
StatisticsComponent,
ApplicationsListComponent,
DevicesComponent,
CO2WidgetComponent,
LocationsComponent,
DashboardComponent,
ActivitiesComponent,
HistoryStatisticsComponent,
ExperimentalComponent,
SendingInformationHttpsComponent,
PrivacyPolicyComponent,
ProfileComponent,
DeviceEventsActionsComponent,
ContactDetailsComponent,
IfExperimentalComponent,
GpsComponent,
D3neComponent,
RestfulComponent,
IfNotEnglishComponent,
WaterBubbleComponent,
Co2Component,
AngularCalendarComponent,
OutputPinViewComponent,
NavigationComponent,
],
imports: [
RealtimeDocumentModule,
NgxTooltipModule,
BrowserAnimationsModule,
Ng5BasicModule,
BrowserModule,
FormsModule,
IotModule,
UsersModule,
TranslateModule.forRoot(),
CalendarModule.forRoot(),
Expand All @@ -207,10 +125,8 @@ export class AppComponent implements OnInit {
appReducersGenerator()
],
providers: [
RealtimeService,
PermissionsService,
RequestsService,
RealtimeService,
MockService,
ActionsService,
NotificationService,
Expand All @@ -234,9 +150,4 @@ export class AppComponent implements OnInit {
})
export class AppModule {

constructor (
private realtime: RealtimeService,
) {
// Realtime service is imported intentionally
}
}
Loading

0 comments on commit 34ad0db

Please sign in to comment.