Skip to content
Permalink
Browse files

fix: issues with Cloudinary resolved in prod build

  • Loading branch information...
evereq committed Sep 22, 2019
1 parent 7212c96 commit db51a90a83054d81d2483b7c79d107f7f7bc03c9
Showing with 112 additions and 67 deletions.
  1. +10 −8 apps/gauzy/src/app/app.component.ts
  2. +59 −57 apps/gauzy/src/app/app.module.ts
  3. +41 −0 apps/gauzy/src/environments/environment.prod.ts
  4. +1 −1 package.json
  5. +1 −1 yarn.lock
@@ -5,17 +5,19 @@
*/
import { Component, OnInit } from '@angular/core';
import { AnalyticsService } from './@core/utils/analytics.service';
import { Cloudinary } from '@cloudinary/angular-5.x';

@Component({
selector: 'ga-app',
template: '<router-outlet></router-outlet>',
selector: 'ga-app',
template: '<router-outlet></router-outlet>'
})
export class AppComponent implements OnInit {
constructor(
private analytics: AnalyticsService,
private _cloudinary: Cloudinary
) {}

constructor(private analytics: AnalyticsService) {
}

ngOnInit(): void {
this.analytics.trackPageViews();
}
ngOnInit(): void {
this.analytics.trackPageViews();
}
}
@@ -13,77 +13,79 @@ import { ThemeModule } from './@theme/theme.module';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import {
NbChatModule,
NbDatepickerModule,
NbDialogModule,
NbMenuModule,
NbSidebarModule,
NbToastrModule,
NbWindowModule,
NbCalendarModule,
NbCalendarKitModule
NbChatModule,
NbDatepickerModule,
NbDialogModule,
NbMenuModule,
NbSidebarModule,
NbToastrModule,
NbWindowModule,
NbCalendarModule,
NbCalendarKitModule
} from '@nebular/theme';
import { TokenInterceptor } from './@core/auth/token.interceptor';

import { HttpClient } from '@angular/common/http';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';

import * as cloudinary from 'cloudinary-core';
import { Cloudinary as CloudinaryCore } from 'cloudinary-core';
import { CloudinaryModule } from '@cloudinary/angular-5.x';
import { cloudinaryConfiguration } from '../environments/environment';
import { FileUploadModule } from 'ng2-file-upload';
import { APIInterceptor } from './@core/api.interceptor';

export const cloudinary = {
Cloudinary: CloudinaryCore
};

export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
return new TranslateHttpLoader(http);
}


@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
AppRoutingModule,
NbCalendarModule,
NbCalendarKitModule,
ThemeModule.forRoot(),
NbSidebarModule.forRoot(),
NbMenuModule.forRoot(),
NbDatepickerModule.forRoot(),
NbDialogModule.forRoot(),
NbWindowModule.forRoot(),
NbToastrModule.forRoot(),
NbChatModule.forRoot({
messageGoogleMapKey: 'AIzaSyA_wNuCzia92MAmdLRzmqitRGvCF7wCZPY',
}),
CoreModule.forRoot(),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
CloudinaryModule.forRoot(cloudinary, cloudinaryConfiguration),
FileUploadModule
],
bootstrap: [AppComponent],
providers: [
{ provide: APP_BASE_HREF, useValue: '/' },
{
provide: HTTP_INTERCEPTORS,
useClass: APIInterceptor,
multi: true
},
{
provide: HTTP_INTERCEPTORS,
useClass: TokenInterceptor,
multi: true
}
],
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
AppRoutingModule,
NbCalendarModule,
NbCalendarKitModule,
ThemeModule.forRoot(),
NbSidebarModule.forRoot(),
NbMenuModule.forRoot(),
NbDatepickerModule.forRoot(),
NbDialogModule.forRoot(),
NbWindowModule.forRoot(),
NbToastrModule.forRoot(),
NbChatModule.forRoot({
messageGoogleMapKey: 'AIzaSyA_wNuCzia92MAmdLRzmqitRGvCF7wCZPY'
}),
CoreModule.forRoot(),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
CloudinaryModule.forRoot(cloudinary, cloudinaryConfiguration),
FileUploadModule
],
bootstrap: [AppComponent],
providers: [
{ provide: APP_BASE_HREF, useValue: '/' },
{
provide: HTTP_INTERCEPTORS,
useClass: APIInterceptor,
multi: true
},
{
provide: HTTP_INTERCEPTORS,
useClass: TokenInterceptor,
multi: true
}
]
})
export class AppModule {
}
export class AppModule {}
@@ -0,0 +1,41 @@
// NOTE: Auto-generated file
// The file contents for the current environment will overwrite these during build.
// The build system defaults to the dev environment which uses 'environment.ts', but if you do
// 'ng build --env=prod' then 'environment.prod.ts' will be used instead.
// The list of which env maps to which file can be found in '.angular-cli.json'.

import { Environment } from './model';
import { CloudinaryConfiguration } from '@cloudinary/angular-5.x';

export const environment: Environment = {
production: true,

API_BASE_URL: 'http://localhost:3000',
COMPANY_NAME: 'Ever Co. LTD',
COMPANY_SITE: 'Gauzy',
COMPANY_LINK: 'https://ever.co/',
COMPANY_SITE_LINK: 'https://gauzy.co',
COMPANY_GITHUB_LINK: 'https://github.com/ever-co',
COMPANY_FACEBOOK_LINK: 'https://www.facebook.com/gauzyplatform',
COMPANY_TWITTER_LINK: 'https://twitter.com/gauzyplatform',
COMPANY_LINKEDIN_LINK: 'https://www.linkedin.com/company/ever-co.',
CLOUDINARY_CLOUD_NAME: 'dv6ezkfxg',
CLOUDINARY_API_KEY: '256868982483961',
GOOGLE_AUTH_LINK: 'http://localhost:3000/api/auth/google',
FACEBOOK_AUTH_LINK: 'http://localhost:3000/api/auth/facebook',
LINKEDIN_AUTH_LINK: '#'
};

export const cloudinaryConfiguration: CloudinaryConfiguration = {
cloud_name: environment.CLOUDINARY_CLOUD_NAME,
api_key: environment.CLOUDINARY_API_KEY
};

/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as 'zone.run', 'zoneDelegate.invokeTask'.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
@@ -138,7 +138,7 @@
"chart.piecelabel.js": "^0.15.0",
"ckeditor": "^4.12.0",
"classlist.js": "^1.1.20150312",
"cloudinary-core": "^2.7.3",
"cloudinary-core": "^2.7.4",
"core-js": "^3.2.1",
"d3": "4.13.0",
"d3-selection-multi": "1.0.1",
@@ -6155,7 +6155,7 @@ clone@^2.1.1, clone@^2.1.2:
resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f"
integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=

cloudinary-core@^2.7.3:
cloudinary-core@^2.7.4:
version "2.7.4"
resolved "https://registry.yarnpkg.com/cloudinary-core/-/cloudinary-core-2.7.4.tgz#35db9b8a851ca7ef9feace6e98496a8455de6663"
integrity sha512-toaZSJVvpY1bQhqhin6atI1DPfloE/wOS9T6lriHsZVvdNyQu+c9AyNznM5/4NquI2oLr4G2gGgeX0tImnFUaQ==

1 comment on commit db51a90

@evereq

This comment has been minimized.

Copy link
Member Author

evereq commented on db51a90 Sep 22, 2019

Fixes #193

Please sign in to comment.
You can’t perform that action at this time.