Commit 17eca059 authored by Aymane KHOUAJI's avatar Aymane KHOUAJI

Init Commit

parents
{
"directory": "frontend/components"
}
\ No newline at end of file
frontend/app/**
{
"extends": "linagora-esn",
"rules": {
"consistent-this": ["warn", "self"],
"no-unused-vars": ["error", { "vars": "all", "args": "after-used" }],
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-process-env": "off",
"arrow-parens": ["error", "as-needed"]
}
}
node_modules
frontend/components
.vscode
\ No newline at end of file
{
"preset": "airbnb",
"requirePaddingNewLinesAfterBlocks": null,
"requireTrailingComma": null,
"disallowTrailingComma": true,
"disallowMultipleVarDecl": null,
"requirePaddingNewLinesBeforeLineComments": null,
"safeContextKeyword": ["self"],
"requireCamelCaseOrUpperCaseIdentifiers": null,
"requireSpacesInAnonymousFunctionExpression": null,
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
requireSpacesInsideObjectBrackets: null
}
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": "vars",
"strict": true,
"trailing": true,
"smarttabs": true,
"white": false,
"expr": true,
"globals": {
"angular": false,
"jQuery": false,
"$": false,
"after": false,
"afterEach": false,
"angular": false,
"before": false,
"beforeEach": false,
"browser": false,
"describe": false,
"inject": false,
"element": false,
"it": false
}
}
'use strict';
module.exports = function(grunt) {
var CI = grunt.option('ci');
var KARMA_REPORTERS = (grunt.option('reporter') || '').split(',').filter(Boolean);
if (!KARMA_REPORTERS.length) {
KARMA_REPORTERS = CI ? ['spec', 'coverage'] : ['dots'];
}
grunt.initConfig({
eslint: {
options: {
config: '.eslintrc'
},
all: {
src: [
'Gruntfile.js',
'tasks/**/*.js',
'test/**/**/*.js',
'backend/**/*.js',
'frontend/app/**/*.js'
]
}
},
lint_pattern: {
options: {
rules: [
{ pattern: /(describe|it)\.only/, message: 'Must not use .only in tests' }
]
},
all: {
src: ['<%= eslint.all.src %>']
},
css: {
options: {
rules: [
{ pattern: /important;(\s*$|(?=\s+[^\/]))/, message: 'CSS important rules only allowed with explanatory comment' }
]
},
src: [
'frontend/css/**/*.less'
]
}
},
mochacli: {
options: {
require: ['chai', 'mockery'],
reporter: 'spec',
timeout: process.env.TEST_TIMEOUT || 20000
},
backend: {
options: {
files: ['test/unit-backend/all.js', grunt.option('test') || 'test/unit-backend/**/*.js']
}
}
},
karma: {
unit: {
configFile: './test/config/karma.conf.js',
browsers: ['PhantomJS'],
reporters: KARMA_REPORTERS
}
},
i18n_checker: {
all: {
options: {
baseDir: __dirname,
dirs: [{
localeDir: 'backend/lib/i18n/locales',
templateSrc: [
'frontend/app/**/*.jade'
],
core: true
}],
verifyOptions: {
defaultLocale: 'en',
locales: ['en', 'fr', 'vi']
}
}
}
}
});
grunt.loadNpmTasks('grunt-lint-pattern');
grunt.loadNpmTasks('grunt-mocha-cli');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-i18n-checker');
grunt.registerTask('i18n', 'Check the translation files', ['i18n_checker']);
grunt.registerTask('linters', 'Check code for lint', ['eslint:all', 'lint_pattern:all']);
grunt.registerTask('test-unit-backend', 'Test backend code', ['mochacli:backend']);
grunt.registerTask('test-unit-frontend', 'Test frontend code', ['karma:unit']);
grunt.registerTask('test', ['linters', 'test-unit-frontend', 'test-unit-backend']);
grunt.registerTask('default', ['test']);
};
{
"PATH" : {
"MIMETYPE": "/detect/stream",
"LANGUAGE": "/language/stream",
"RAWTEXT": "/tika"
}
}
'use strict';
var i18n = require('i18n');
i18n.configure(
{
defaultLocale: 'en',
locales: ['en', 'fr', 'vi'],
directory: __dirname + '/locales',
updateFiles: false,
indent: ' ',
extension: '.json',
cookie: 'locale'
}
);
module.exports = function() {
return i18n;
};
{
}
\ No newline at end of file
{
}
\ No newline at end of file
'use strict';
module.exports = function() {
return {
};
};
'use strict';
module.exports = function(dependencies, application) {
var i18n = require('../../lib/i18n')(dependencies);
application.use(i18n.init);
};
'use strict';
const express = require('express');
const FRONTEND_PATH = require('../constants').FRONTEND_PATH;
const CORE_FRONTEND_PATH = require('../constants').CORE_FRONTEND_PATH;
module.exports = function(dependencies, application) {
application.use(express.static(FRONTEND_PATH));
application.set('views', FRONTEND_PATH + '/app');
application.get('/app/*', function(req, res) {
res.render(req.params[0].replace(/\.html$/, ''), { basedir: CORE_FRONTEND_PATH + '/views' });
});
};
'use strict';
// add your constants here.
var path = require('path');
module.exports.FRONTEND_PATH = path.normalize(__dirname + '/../../frontend');
module.exports.CORE_FRONTEND_PATH = path.normalize(path.dirname(require.main.filename) + '/frontend');
'use strict';
const express = require('express');
// This is you own express application
module.exports = function(dependencies) {
const application = express();
// Every express new configuration are appended here.
// This needs to be initialized before the body parser
require('./config/i18n')(dependencies, application);
require('./config/views')(dependencies, application);
return application;
};
{
"name": "linagora.esn.hublin",
"main": "index.js",
"version": "0.0.1",
"authors": [
"Linagora Folks <openpaas@linagora.com>"
],
"description": "just a link to hubl.in",
"keywords": [
"safe",
"openpaas",
"collaboration",
"linagora"
],
"license": "AGPLv3",
"homepage": "https://open-paas.org/",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"frontend/components",
"test",
"tests"
],
"dependencies": {
"components-font-awesome": "^4.7.0"
},
"devDependencies": {
"angular": "1.3.16",
"chai": "3.4.0",
"jquery": "2.1.4",
"angular-mocks": "1.3.16",
"angular-ui-router": "0.2.15",
"dynamic-directive": "2.0.0",
"angular-scroll-glue": "^2.0.7",
"angular-messages": "1.3.16",
"angular-file-saver": "1.1.2",
"restangular": "1.3.1",
"lodash": "2.4.1",
"sinon-chai": "~2.8.0"
}
}
(function() {
'use strict';
angular.module('linagora.esn.hublin')
.directive('hublinApplicationMenu', hublinApplicationMenu);
function hublinApplicationMenu(applicationMenuTemplateBuilder) {
var directive = {
retrict: 'E',
replace: false,
template: applicationMenuTemplateBuilder('https://hubl.in/', { url: 'https://hubl.in/images/logo_hublin-bubbles.png' }, 'Hubl.In')
};
return directive;
}
})();
\ No newline at end of file
(function() {
'use strict';
angular.module('linagora.esn.hublin', [])
.run(function(dynamicDirectiveService, session) {
session.ready.then(function() {
var hublin = new dynamicDirectiveService.DynamicDirective(true, 'hublin-application-menu', { priority: -20 });
dynamicDirectiveService.addInjection('esn-application-menu', hublin);
});
})
})();
'use strict';
const AwesomeModule = require('awesome-module');
const Dependency = AwesomeModule.AwesomeModuleDependency;
const glob = require('glob-all');
const _ = require('lodash');
const NAME = 'hublin';
const APP_ENTRY_POINT = NAME + '.app.js';
const MODULE_NAME = 'linagora.esn.' + NAME;
const FRONTEND_JS_PATH = __dirname + '/frontend/app/';
const tikaModule = new AwesomeModule('linagora.esn.hublin', {
dependencies: [
new Dependency(Dependency.TYPE_NAME, 'linagora.esn.core.logger', 'logger'),
new Dependency(Dependency.TYPE_NAME, 'linagora.esn.core.webserver.wrapper', 'webserver-wrapper')
],
states: {
deploy: function(dependencies, callback) {
const webserverWrapper = dependencies('webserver-wrapper');
const app = require('./backend/webserver')(this, dependencies);
let frontendModules = glob.sync([
FRONTEND_JS_PATH + '**/!(*spec).js'
]).map(filepath => filepath.replace(FRONTEND_JS_PATH, ''));
_.pull(frontendModules, APP_ENTRY_POINT);
frontendModules = [APP_ENTRY_POINT].concat(frontendModules);
webserverWrapper.injectAngularAppModules(NAME, frontendModules, MODULE_NAME, ['esn']);
webserverWrapper.addApp(NAME, app);
callback();
}
}
});
/**
* The main AwesomeModule describing the application.
* @type {AwesomeModule}
*/
module.exports = tikaModule;
This diff is collapsed.
{
"name": "linagora.esn.hublin",
"version": "0.0.1",
"description": "just a link to hubl.in",
"main": "index.js",
"devDependencies": {
"chai": "3.4.0",
"chai-shallow-deep-equal": "1.3.0",
"eslint": "3.6.0",
"eslint-config-airbnb-base": "8.0.0",
"eslint-config-linagora-esn": "1.0.0",
"eslint-plugin-import": "1.16.0",
"eslint-plugin-jsx-a11y": "2.2.1",
"eslint-plugin-react": "6.2.0",
"grunt": "0.4.5",
"grunt-continue": "0.1.0",
"grunt-contrib-clean": "1.0.0",
"grunt-contrib-concat": "1.0.1",
"grunt-contrib-jshint": "1.0.0",
"grunt-contrib-watch": "1.0.0",
"grunt-eslint": "19.0.0",
"grunt-i18n-checker": "git+https://github.com/linagora/grunt-i18n-checker.git#v2.0.0",
"grunt-karma": "2.0.0",
"grunt-lint-pattern": "0.1.4",
"grunt-mocha-cli": "2.1.0",
"grunt-run": "0.6.0",
"grunt-run-grunt": "git+https://github.com/linagora/grunt-run-grunt.git",
"grunt-shell": "1.3.1",
"grunt-shell-spawn": "0.3.10",
"grunt-wait-server": "0.3.0",
"i18n": "0.8.3",
"i18n-checker": "git+https://github.com/linagora/i18n-checker.git#v2.0.0",
"karma": "1.3.0",
"karma-chrome-launcher": "2.0.0",
"karma-coverage": "1.1.1",
"karma-firefox-launcher": "1.0.0",
"karma-mocha": "1.1.1",
"karma-ng-jade2module-preprocessor": "git+https://github.com/linagora/karma-ng-jade2module-preprocessor.git",
"karma-phantomjs-launcher": "1.0.2",
"karma-spec-reporter": "0.0.26",
"mocha": "3.0.2",
"mockery": "1.7.0",
"phantomjs": "2.1.7",
"socket.io": "1.3.7"
},
"scripts": {
"test": "grunt test",
"postinstall": "./node_modules/bower/bin/bower install --allow-root"
},
"author": "Linagora R&D",
"license": "AGPLv3",
"dependencies": {
"awesome-module": "1.0.0",
"bower": "1.8.0",
"express": "4.13.3",
"i18n": "0.6.0",
"lodash": "4.15.0"
}
}
'use strict';
module.exports = function(config) {
config.set({
basePath: '../../',
files: [
'frontend/components/chai/chai.js',
'node_modules/chai-shallow-deep-equal/chai-shallow-deep-equal.js',
'frontend/components/lodash/dist/lodash.min.js',
'frontend/components/jquery/dist/jquery.min.js',
'frontend/components/angular/angular.min.js',
'frontend/components/angular-ui-router/release/angular-ui-router.min.js',
'frontend/components/angular-mocks/angular-mocks.js',
'frontend/components/dynamic-directive/dist/dynamic-directive.min.js',
'frontend/components/restangular/dist/restangular.min.js',
'frontend/components/sinon-chai/lib/sinon-chai.js',
'node_modules/sinon/pkg/sinon.js',
'frontend/app/**/*.js',
//'test/unit-frontend/**/*.js',
'frontend/views/**/*.jade'
],
frameworks: ['mocha'],
colors: true,
singleRun: true,
autoWatch: true,
browsers: ['PhantomJS', 'Chrome', 'Firefox'],
reporters: ['coverage', 'spec'],
preprocessors: {
'frontend/js/**/*.js': ['coverage'],
'**/*.jade': ['ng-jade2module']
},
plugins: [
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-mocha',
'karma-coverage',
'karma-spec-reporter',
'karma-ng-jade2module-preprocessor'
],
coverageReporter: {type: 'text', dir: '/tmp'},
ngJade2ModulePreprocessor: {
stripPrefix: 'frontend',
prependPrefix: '/linagora.esn.tika',
// setting this option will create only a single module that contains templates
// from all the files, so you can load them all with module('templates')
jadeRenderConfig: {
__: function(str) {
return str;
}
},
moduleName: 'jadeTemplates'
}
});
};
'use strict';
const chai = require('chai');
const mockery = require('mockery');
before(function() {
chai.use(require('chai-shallow-deep-equal'));
chai.use(require('sinon-chai'));
chai.use(require('chai-as-promised'));
mockery.enable({
warnOnReplace: false,
warnOnUnregistered: false,
useCleanCache: true
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment