Skip to content

Commit

Permalink
Merge pull request #79 from Enngage/master
Browse files Browse the repository at this point in the history
Upgrade to kentico-cloud-delivery v4
  • Loading branch information
Simply007 committed May 18, 2018
2 parents f1064d0 + a1bfc10 commit 1e3305b
Show file tree
Hide file tree
Showing 25 changed files with 121 additions and 103 deletions.
3 changes: 2 additions & 1 deletion examples/hoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"kentico-cloud-delivery-typescript-sdk": "2.0.0",
"kentico-cloud-delivery": "4.0.1",
"rxjs": "6.1.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts": "1.1.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/hoc/src/Components/ArticleModel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';

export class Article extends ContentItem {
constructor(){
Expand Down
11 changes: 7 additions & 4 deletions examples/hoc/src/Components/deliveryClientConfig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { DeliveryClientConfig, TypeResolver } from "kentico-cloud-delivery-typescript-sdk";
import { TypeResolver } from "kentico-cloud-delivery";
import { Article } from './ArticleModel';

export default new DeliveryClientConfig("975bf280-fd91-488c-994c-2f04416e5ee3",[
new TypeResolver('article', () => new Article())
]);
export default config = {
projectId: '975bf280-fd91-488c-994c-2f04416e5ee3',
typeResolvers: [
new TypeResolver('article', () => new Article())
]
}
2 changes: 1 addition & 1 deletion examples/hoc/src/Components/withDeliveryClient.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from "react";
import { DeliveryClient } from "kentico-cloud-delivery-typescript-sdk";
import { DeliveryClient } from "kentico-cloud-delivery";


export default function withDeliveryClient(config) {
Expand Down
102 changes: 62 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"dependencies": {
"google-maps-react": "^1.1.2",
"immutable": "^3.8.2",
"kentico-cloud-delivery-typescript-sdk": "3.0.1",
"kentico-cloud-delivery": "^4.0.1",
"lodash": "^4.17.4",
"react": "^15.3.1",
"react-dom": "^15.3.1",
"react-router-dom": "^4.2.2",
"react-scroll": "^1.6.4",
"react-translate": "^6.0.0",
"rxjs": "^5.5.7",
"rxjs": "^6.1.0",
"twitter-widgets": "^1.0.0"
},
"scripts": {
Expand Down
48 changes: 20 additions & 28 deletions src/Client.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// kentico cloud
import { DeliveryClient, DeliveryClientConfig, TypeResolver } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { DeliveryClient, TypeResolver } from 'kentico-cloud-delivery';

const projectId = '975bf280-fd91-488c-994c-2f04416e5ee3';
const previewApiKey = "";
const previewApiKey = '';

// models
import { AboutUs } from './Models/AboutUs'
import { Accessory } from './Models/Accessory'
import { Article } from './Models/Article'
import { Brewer } from './Models/Brewer'
import { Cafe } from './Models/Cafe'
import { Coffee } from './Models/Coffee'
import { FactAboutUs } from './Models/FactAboutUs'
import { Grinder } from './Models/Grinder'
import { HeroUnit } from './Models/HeroUnit'
import { Home } from './Models/Home'
import { HostedVideo } from './Models/HostedVideo'
import { Office } from './Models/Office'
import { Tweet } from './Models/Tweet'
import { AboutUs } from './Models/AboutUs';
import { Accessory } from './Models/Accessory';
import { Article } from './Models/Article';
import { Brewer } from './Models/Brewer';
import { Cafe } from './Models/Cafe';
import { Coffee } from './Models/Coffee';
import { FactAboutUs } from './Models/FactAboutUs';
import { Grinder } from './Models/Grinder';
import { HeroUnit } from './Models/HeroUnit';
import { Home } from './Models/Home';
import { HostedVideo } from './Models/HostedVideo';
import { Office } from './Models/Office';
import { Tweet } from './Models/Tweet';

// configure type resolvers
let typeResolvers = [
Expand All @@ -36,16 +36,8 @@ let typeResolvers = [
new TypeResolver('tweet', () => new Tweet())
];


function isPreview() {
return previewApiKey !== "";
}

export default new DeliveryClient(
new DeliveryClientConfig(projectId, typeResolvers,
{
enablePreviewMode: isPreview(),
previewApiKey: previewApiKey
}
)
)
export default new DeliveryClient({
projectId: projectId,
typeResolvers: typeResolvers,
previewApiKey: previewApiKey
});
2 changes: 1 addition & 1 deletion src/Models/AboutUs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';
import { resolveContentLink } from '../Utilities/ContentLinks';

export class AboutUs extends ContentItem {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Accessory.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';
import { resolveContentLink } from '../Utilities/ContentLinks';

export class Accessory extends ContentItem {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Article.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';
import { resolveContentLink } from '../Utilities/ContentLinks';

export class Article extends ContentItem {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Brewer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';
import { resolveContentLink } from '../Utilities/ContentLinks';

export class Brewer extends ContentItem {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Cafe.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';
import { resolveContentLink } from '../Utilities/ContentLinks';

export class Cafe extends ContentItem {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Coffee.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';
import { resolveContentLink } from '../Utilities/ContentLinks';

export class Coffee extends ContentItem {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/FactAboutUs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';

export class FactAboutUs extends ContentItem {
}
2 changes: 1 addition & 1 deletion src/Models/Grinder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';
import { resolveContentLink } from '../Utilities/ContentLinks';

export class Grinder extends ContentItem {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/HeroUnit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';
import { resolveContentLink } from '../Utilities/ContentLinks';

export class HeroUnit extends ContentItem {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Home.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';
import { resolveContentLink } from '../Utilities/ContentLinks';

export class Home extends ContentItem {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/HostedVideo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';
import { resolveContentLink } from '../Utilities/ContentLinks';

export class HostedVideo extends ContentItem {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Office.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';
import { resolveContentLink } from '../Utilities/ContentLinks';

export class Office extends ContentItem {
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Tweet.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentItem } from 'kentico-cloud-delivery-typescript-sdk/_bundles';
import { ContentItem } from 'kentico-cloud-delivery';
import { resolveContentLink } from '../Utilities/ContentLinks';
import TwitterWidgetsLoader from 'twitter-widgets';

Expand Down
Loading

0 comments on commit 1e3305b

Please sign in to comment.