Skip to content

Commit

Permalink
Merge pull request #85 from OrdnanceSurvey/dev
Browse files Browse the repository at this point in the history
latest release from dev
  • Loading branch information
craiggoldstone committed May 3, 2016
2 parents e95a1d5 + b6c0617 commit 1e598f6
Show file tree
Hide file tree
Showing 16 changed files with 575 additions and 369 deletions.
6 changes: 5 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
machine:
node:
version: "5.1.0"
dependencies:
override:
- if [[ $(npm --version) =~ ^2 ]] ; then echo "NPM version too low, will upgrade"; npm install -g npm; fi
- npm install
test:
pre:
- npm run build
override:
- npm test
- npm run test-ci
deployment:
release:
branch: master
Expand Down
60 changes: 18 additions & 42 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ <h1>OS Elements</h1>
.controller('zoombarController', function() {
this.zoomLevel = 5
})
.controller('searchController', function() {
.controller('searchController', function($q) {
this.searchProviders = [
//{
// id: 'WIKI',
Expand All @@ -174,21 +174,26 @@ <h1>OS Elements</h1>
{
id: 'ECHO_UPPERCASE',
title: 'Grid Reference',
minLength: 1,
columnWidth: 10,
fn: function(term) {
var deffered = $q.defer();

var upper = term;
try {
upper = term.toUpperCase();
} catch (e) {}

// return an array to illustrate how transformResponse can be used
return [{
deffered.resolve([{
text: upper
},{
text: upper
},{
text: upper
}];
}]);

return deffered.promise;
},
transformResponse: function(response) {
// return an object with a results property containing the array
Expand All @@ -203,56 +208,27 @@ <h1>OS Elements</h1>
},
{
id: 'ECHO_LOWERCASE',
title: 'Addresses',
columnWidth: '*',
fn: function(term) {
var lower = term;
try {
lower = term.toLowerCase();
} catch (e) {}

// return an array to illustrate how transformResponse can be used
return [{
text: lower
},{
text: lower
},{
text: lower
},{
text: lower
},{
text: lower
}];
},
transformResponse: function(response) {
// return an object with a results property containing the array
return {
results: response
};
},
onSelect: function(result, hideSearch) {
console.log('selected a LOWERCASE result', result);
hideSearch();
}
},
{
id: 'ECHO_POSTCODE',
title: 'Postcode',
title: 'Grid Reference',
minLength: 1,
columnWidth: 10,
fn: function(term) {
var deffered = $q.defer();

var upper = term;
try {
upper = term.toUpperCase();
upper = term.toLowerCase();
} catch (e) {}

// return an array to illustrate how transformResponse can be used
return [{
deffered.resolve([{
text: upper
},{
text: upper
},{
text: upper
}];
}]);

return deffered.promise;
},
transformResponse: function(response) {
// return an object with a results property containing the array
Expand All @@ -264,7 +240,7 @@ <h1>OS Elements</h1>
console.log('selected an UPPERCASE result', result);
hideSearch();
}
},
}
]
})
.controller('modalController', function($log, $OsModal) {
Expand Down
8 changes: 8 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var gulp = require('gulp');

gulp.task('ngdocs', [], function () {
var gulpDocs = require('gulp-ngdocs');
return gulp.src(['./src/components/button/button.component.ts'])
.pipe(gulpDocs.process())
.pipe(gulp.dest('./b'));
});
119 changes: 119 additions & 0 deletions karma-ci.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
var fs = require('fs');
var _ = require("lodash");
var webpack = require('webpack');
var webpackConfig = require("./webpack.config.js");

// prepare webpack config for unit tests
var webpackTestConfig = _.merge({}, webpackConfig, {
devtool: 'inline-source-map',
module: {
postLoaders: [
{
test: /\.ts$/,
loader: 'istanbul-instrumenter'
}
]
}
});

//
// Use ENV vars on Travis and sauce.json locally to get credentials
if (!process.env.SAUCE_USERNAME) {
if (!fs.existsSync('sauce.json')) {
console.log('Create a sauce.json with your credentials based on the sauce-sample.json file.');
process.exit(1);
} else {
process.env.SAUCE_USERNAME = require('./sauce').username;
process.env.SAUCE_ACCESS_KEY = require('./sauce').accessKey;
}
}



// Browsers to run on Sauce Labs
var customLaunchers = {
'SL_Chrome': {
base: 'SauceLabs',
browserName: 'chrome'
},
'SL_InternetExplorer': {
base: 'SauceLabs',
browserName: 'internet explorer',
version: '10'
},
'SL_FireFox': {
base: 'SauceLabs',
browserName: 'firefox',
version: '45'
}
};


module.exports = function(config) {
config.set({
basePath: '.',

frameworks: ['jasmine', 'jasmine-matchers'],

files: [
'./node_modules/angular/angular.js',
'./node_modules/angular-mocks/angular-mocks.js',
'./node_modules/angular-animate/angular-animate.js',
'./node_modules/angular-aria/angular-aria.js',
'./node_modules/angular-messages/angular-messages.js',
'./node_modules/angular-material/angular-material.js',
'./node_modules/angular-sanitize/angular-sanitize.js',
'./node_modules/rx/dist/rx.js',
'./node_modules/rx-angular/dist/rx.angular.js',

// unit test main entry
'test/unit/test_index.js'
],

preprocessors: {
'test/unit/test_index.js': ['webpack']
},

logLevel: config.LOG_INFO,

webpack: webpackTestConfig,

webpackMiddleware: {
noInfo: true
},

reporters: ['dots', 'saucelabs', 'nested', 'coverage', 'threshold', 'coveralls'],

coverageReporter: {
dir: 'build/reports/coverage',
reporters: [
// reporters not supporting the `file` property
{ type: 'html', subdir: 'report-html' },
{ type: 'lcov', subdir: 'report-lcov' },
{ type: 'cobertura', subdir: '.', file: 'cobertura.txt' },
{ type: 'lcovonly', subdir: '.', file: 'report-lcovonly.txt' },
{ type: 'text', subdir: '.', file: 'text.txt' },
{ type: 'text-summary', subdir: '.', file: 'text-summary.txt' },
]
},

thresholdReporter: {
statements: 48, // 90
branches: 26, // 60
functions: 27, // 85
lines: 47 // 90
},

sauceLabs: {
testName: process.env.CIRCLE_PROJECT_USERNAME + '/' + process.env.CIRCLE_PROJECT_REPONAME + (process.env.CIRCLE_BRANCH ? '/' + process.env.CIRCLE_BRANCH : '') + (process.env.CIRCLE_TAG ? '/' + process.env.CIRCLE_TAG : '') + (process.env.CIRCLE_BUILD_NUM ? '/build_' + process.env.CIRCLE_BUILD_NUM : '')
},
captureTimeout: 120000,
customLaunchers: customLaunchers,

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: Object.keys(customLaunchers),
singleRun: true

});
};
3 changes: 1 addition & 2 deletions karma.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module.exports = function(config) {
'./node_modules/angular-mocks/angular-mocks.js',
'./node_modules/angular-animate/angular-animate.js',
'./node_modules/angular-aria/angular-aria.js',
'./node_modules/angular-component/dist/angular-component.js', // polyfill component API for angular < 1.5
'./node_modules/angular-messages/angular-messages.js',
'./node_modules/angular-material/angular-material.js',
'./node_modules/angular-sanitize/angular-sanitize.js',
Expand All @@ -53,7 +52,7 @@ module.exports = function(config) {

browsers: ['PhantomJS'],

reporters: ['progress', 'nested', 'coverage', 'threshold'],
reporters: ['progress', 'nested', 'coverage', 'threshold', 'coveralls'],

coverageReporter: {
dir: 'build/reports/coverage',
Expand Down
8 changes: 4 additions & 4 deletions openlayers_custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ declare module ol {
* @constructor
* @param values Array.
*/
constructor(values?: Array<T>)
constructor(values?: Array<T>);

/**
* Remove all elements from the collection.
Expand Down Expand Up @@ -3437,7 +3437,7 @@ declare module ol {
}

class Draw extends Pointer {
constructor(options: olx.interaction.IDrawInteractionOptions)
constructor(options: olx.interaction.IDrawInteractionOptions);

createRegularPolygon(sides?: number, angle?: number): DrawGeometryFunctionType;
}
Expand Down Expand Up @@ -3932,7 +3932,7 @@ declare module ol {
function transformExtent(extent: Extent, source: ProjectionLike, destination: ProjectionLike): Extent;

class Projection {
constructor(options: olx.Projection)
constructor(options: olx.Projection);
}
}

Expand Down Expand Up @@ -4022,7 +4022,7 @@ declare module ol {
}

class Vector {
constructor(opts: olx.source.VectorOptions)
constructor(opts: olx.source.VectorOptions);

/**
* Get the extent of the features currently in the source.
Expand Down
Loading

0 comments on commit 1e598f6

Please sign in to comment.