Skip to content

Commit 3ecb9f5

Browse files
committed
fixed #384
updated quick start to angular4
1 parent be39994 commit 3ecb9f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+194
-693
lines changed

marklogic-data-hub/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ processResources {
8888

8989
if (!(
9090
gradle.startParameter.taskNames*.toLowerCase().contains("bootrun") ||
91-
gradle.startParameter.taskNames*.toLowerCase().contains("test") ||
9291
gradle.startParameter.taskNames*.toLowerCase().contains("publishplugins") ||
9392
gradle.startParameter.taskNames*.toLowerCase().contains("bintrayUpload")
9493
)

marklogic-data-hub/src/main/java/com/marklogic/hub/DataHub.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,28 @@ public String getHubVersion() {
565565
return "1.0.0";
566566
}
567567

568+
public static int versionCompare(String v1, String v2) {
569+
if(v1 == null || v2 == null) {
570+
return 1;
571+
}
572+
String[] v1Parts = v1.split("\\.");
573+
String[] v2Parts = v2.split("\\.");
574+
int length = Math.max(v1Parts.length, v2Parts.length);
575+
for(int i = 0; i < length; i++) {
576+
int v1Part = i < v1Parts.length ? Integer.parseInt(v1Parts[i]) : 0;
577+
int v2Part = i < v2Parts.length ? Integer.parseInt(v2Parts[i]) : 0;
578+
579+
if(v1Part < v2Part) {
580+
return -1;
581+
}
582+
583+
if(v1Part > v2Part) {
584+
return 1;
585+
}
586+
}
587+
return 0;
588+
}
589+
568590
class EntitiesValidator extends ResourceManager {
569591
private static final String NAME = "validate";
570592

quick-start/.angular-cli.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
22
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"project": {
4-
"version": "1.0.0-beta.32.3",
54
"name": "data-hub-quickstart"
65
},
76
"apps": [
87
{
98
"root": "src/main/ui",
109
"outDir": "dist",
1110
"assets": [
12-
"assets"
11+
"assets",
12+
"favicon.ico"
1313
],
1414
"index": "index.html",
1515
"main": "main.ts",
1616
"polyfills": "polyfills.ts",
1717
"test": "test.ts",
18-
"tsconfig": "tsconfig.json",
18+
"tsconfig": "tsconfig.app.json",
19+
"testTsconfig": "tsconfig.spec.json",
1920
"prefix": "app",
2021
"styles": [
2122
"../../../node_modules/mdi/css/materialdesignicons.css",
@@ -39,12 +40,13 @@
3940
},
4041
"lint": [
4142
{
42-
"files": "src/main/ui/**/*.ts",
43-
"project": "src/main/ui/tsconfig.json"
43+
"project": "src/main/ui/tsconfig.app.json"
4444
},
4545
{
46-
"files": "e2e/**/*.ts",
47-
"project": "e2e/tsconfig.json"
46+
"project": "src/main/ui/tsconfig.spec.json"
47+
},
48+
{
49+
"project": "e2e/tsconfig.e2e.json"
4850
}
4951
],
5052
"test": {
@@ -55,5 +57,5 @@
5557
"defaults": {
5658
"styleExt": "scss",
5759
"component": {}
58-
}
5960
}
61+
}

quick-start/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ processResources {
114114

115115
if (!(
116116
gradle.startParameter.taskNames*.toLowerCase().contains("bootrun") ||
117-
gradle.startParameter.taskNames*.toLowerCase().contains("test") ||
118117
gradle.startParameter.taskNames*.toLowerCase().contains("publishplugins") ||
119118
gradle.startParameter.taskNames*.toLowerCase().contains("bintrayUpload")
120119
)

quick-start/e2e/tsconfig.e2e.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/e2e",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types":[
8+
"jasmine",
9+
"node"
10+
]
11+
}
12+
}

quick-start/karma.conf.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ module.exports = function (config) {
2929
fixWebpackSourcePaths: true
3030
},
3131
angularCli: {
32-
config: './.angular-cli.json',
3332
environment: 'dev'
3433
},
3534
reporters: config.angularCli && config.angularCli.codeCoverage

quick-start/package.json

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"version": "1.1.1",
44
"license": "APACHE",
55
"homepage": "https://github.com/marklogic/marklogic-data-hub",
6-
"angular-cli": {},
76
"scripts": {
87
"rimraf": "rimraf",
98
"ng": "ng",
@@ -16,47 +15,41 @@
1615
},
1716
"private": true,
1817
"dependencies": {
19-
"@angular/common": "^2.4.0",
20-
"@angular/compiler": "^2.4.0",
21-
"@angular/core": "^2.4.0",
22-
"@angular/forms": "^2.4.0",
23-
"@angular/http": "^2.4.0",
24-
"@angular/platform-browser": "^2.4.0",
25-
"@angular/platform-browser-dynamic": "^2.4.0",
26-
"@angular/router": "^3.4.0",
27-
"@angular2-material/core": "^2.0.0-alpha.8-2",
28-
"@angular2-mdl-ext/popover": "^0.5.0",
29-
"@angular2-mdl-ext/select": "^0.9.2",
30-
"angular2-mdl": "^2.13.1",
31-
"angular2-moment": "^1.0.0-beta.1",
32-
"clipboard": "^1.5.12",
33-
"codemirror": "^5.17.0",
18+
"@angular/common": "^4.0.0",
19+
"@angular/compiler": "^4.0.0",
20+
"@angular/core": "^4.0.0",
21+
"@angular/forms": "^4.0.0",
22+
"@angular/http": "^4.0.0",
23+
"@angular/platform-browser": "^4.0.0",
24+
"@angular/platform-browser-dynamic": "^4.0.0",
25+
"@angular/router": "^4.0.0",
26+
"@angular-mdl/core": "^4.0.1",
27+
"@angular-mdl/popover": "^0.6.3",
28+
"@angular-mdl/select": "^0.10.4",
29+
"angular2-moment": "^1.3.3",
30+
"clipboard": "^1.6.1",
31+
"codemirror": "^5.25.0",
3432
"core-js": "^2.4.1",
35-
"d3-ng2-service": "^1.1.3",
36-
"font-awesome": "^4.6.3",
37-
"hammerjs": "^2.0.8",
38-
"lodash": "^4.14.2",
39-
"material-design-icons-iconfont": "^3.0.2",
40-
"material-design-lite": "^1.2.0",
41-
"mdi": "1.7.22",
42-
"ng2-truncate": "^1.2.0",
33+
"font-awesome": "^4.7.0",
34+
"lodash": "^4.17.4",
35+
"material-design-icons-iconfont": "^3.0.3",
36+
"material-design-lite": "^1.3.0",
37+
"mdi": "1.8.36",
4338
"rxjs": "^5.1.0",
4439
"semver": "^5.3.0",
45-
"sockjs-client": "^1.1.1",
40+
"sockjs-client": "^1.1.2",
4641
"stompjs": "^2.3.3",
47-
"ts-helpers": "^1.1.1",
48-
"zone.js": "^0.7.6"
42+
"zone.js": "^0.8.4"
4943
},
5044
"devDependencies": {
51-
"@types/codemirror": "0.0.32",
52-
"@types/hammerjs": "^2.0.32",
53-
"@angular/cli": "1.0.0-beta.32.3",
54-
"@angular/compiler-cli": "^2.4.0",
45+
"@types/codemirror": "0.0.38",
46+
"@angular/cli": "1.0.0",
47+
"@angular/compiler-cli": "^4.0.0",
5548
"@types/jasmine": "2.5.38",
56-
"@types/lodash": "^4.14.34",
49+
"@types/lodash": "^4.14.58",
5750
"@types/node": "~6.0.60",
58-
"@types/semver": "^5.3.30",
59-
"codelyzer": "~2.0.0-beta.4",
51+
"@types/semver": "^5.3.31",
52+
"codelyzer": "~2.0.0",
6053
"jasmine-core": "~2.5.2",
6154
"jasmine-spec-reporter": "~3.2.0",
6255
"karma": "~1.4.1",
@@ -69,7 +62,7 @@
6962
"protractor": "~5.1.0",
7063
"rimraf": "^2.5.4",
7164
"ts-node": "~2.0.0",
72-
"tslint": "~4.4.2",
73-
"typescript": "~2.0.0"
65+
"tslint": "~4.5.0",
66+
"typescript": "~2.2.0"
7467
}
7568
}

quick-start/protractor.conf.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Protractor configuration file, see link for more information
22
// https://github.com/angular/protractor/blob/master/lib/config.ts
33

4-
/*global jasmine */
54
const { SpecReporter } = require('jasmine-spec-reporter');
65

76
exports.config = {
@@ -22,7 +21,7 @@ exports.config = {
2221
},
2322
beforeLaunch: function() {
2423
require('ts-node').register({
25-
project: 'e2e'
24+
project: 'e2e/tsconfig.e2e.json'
2625
});
2726
},
2827
onPrepare() {

quick-start/src/main/java/com/marklogic/quickstart/service/DataHubService.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -160,31 +160,10 @@ private String getQuickStartVersion() throws IOException {
160160
return version;
161161
}
162162

163-
private int versionCompare(String v1, String v2) {
164-
if(v1 == null || v2 == null) {
165-
return 1;
166-
}
167-
String[] v1Parts = v1.split("\\.");
168-
String[] v2Parts = v2.split("\\.");
169-
int length = Math.max(v1Parts.length, v2Parts.length);
170-
for(int i = 0; i < length; i++) {
171-
int v1Part = i < v1Parts.length ? Integer.parseInt(v1Parts[i]) : 0;
172-
int v2Part = i < v2Parts.length ? Integer.parseInt(v2Parts[i]) : 0;
173-
174-
if(v1Part < v2Part) {
175-
return -1;
176-
}
177-
178-
if(v1Part > v2Part) {
179-
return 1;
180-
}
181-
}
182-
return 0;
183-
}
184163
public boolean updateHub(HubConfig config) throws IOException {
185164
DataHub dataHub = new DataHub(config);
186165
boolean result = false;
187-
int compare = versionCompare(dataHub.getHubVersion(), "1.1.0");
166+
int compare = DataHub.versionCompare(dataHub.getHubVersion(), "1.1.0");
188167
if (compare == -1) {
189168
result = dataHub.updateHubFromPre110();
190169
} else if (compare == 0) {

quick-start/src/main/ui/app/app.component.spec.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
/* tslint:disable:no-unused-variable */
2-
31
import { TestBed, async } from '@angular/core/testing';
2+
43
import { AppComponent } from './app.component';
54

65
describe('AppComponent', () => {
7-
beforeEach(() => {
6+
beforeEach(async(() => {
87
TestBed.configureTestingModule({
98
declarations: [
109
AppComponent
1110
],
12-
});
13-
TestBed.compileComponents();
14-
});
11+
}).compileComponents();
12+
}));
1513

1614
it('should create the app', async(() => {
1715
const fixture = TestBed.createComponent(AppComponent);

0 commit comments

Comments
 (0)