Move remainder of Angular app under frontend

Templates, project infrastructure, configuration.

See 6ec5ca58.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/2263/head
Alex Coles 10 years ago
parent b07c26d54b
commit 25a6b61f2d
  1. 3
      .bowerrc
  2. 3
      .gitignore
  3. 8
      .travis.yml
  4. 2
      frontend/.bowerrc
  5. 6
      frontend/.gitignore
  6. 0
      frontend/bower.json
  7. 18
      frontend/gulpfile.js
  8. 50
      frontend/karma.conf.js
  9. 0
      frontend/package.json
  10. 0
      frontend/public/templates/components/accessible_checkbox.html
  11. 0
      frontend/public/templates/components/accessible_element.html
  12. 0
      frontend/public/templates/components/activity_comment.html
  13. 0
      frontend/public/templates/components/authoring.html
  14. 0
      frontend/public/templates/components/back_url.html
  15. 0
      frontend/public/templates/components/empty_element.html
  16. 0
      frontend/public/templates/components/flash_message.html
  17. 0
      frontend/public/templates/components/icon_wrapper.html
  18. 0
      frontend/public/templates/components/inplace_editor.html
  19. 0
      frontend/public/templates/components/modal_loading.html
  20. 0
      frontend/public/templates/components/progress_bar.html
  21. 0
      frontend/public/templates/components/selectable_title.html
  22. 0
      frontend/public/templates/components/sort_link.html
  23. 0
      frontend/public/templates/components/table_pagination.html
  24. 0
      frontend/public/templates/components/toggled_multiselect.html
  25. 0
      frontend/public/templates/layout/menu_item.html
  26. 0
      frontend/public/templates/timelines/timeline_column_data.html
  27. 0
      frontend/public/templates/timelines/timeline_table.html
  28. 0
      frontend/public/templates/timelines/timeline_table_container.html
  29. 0
      frontend/public/templates/timelines/toolbar.html
  30. 0
      frontend/public/templates/work_packages.html
  31. 0
      frontend/public/templates/work_packages.list.details.html
  32. 0
      frontend/public/templates/work_packages.list.html
  33. 0
      frontend/public/templates/work_packages/column_context_menu.html
  34. 0
      frontend/public/templates/work_packages/modals/columns.html
  35. 0
      frontend/public/templates/work_packages/modals/export.html
  36. 0
      frontend/public/templates/work_packages/modals/group_by.html
  37. 0
      frontend/public/templates/work_packages/modals/save.html
  38. 0
      frontend/public/templates/work_packages/modals/settings.html
  39. 0
      frontend/public/templates/work_packages/modals/share.html
  40. 0
      frontend/public/templates/work_packages/modals/sorting.html
  41. 0
      frontend/public/templates/work_packages/query_columns.html
  42. 0
      frontend/public/templates/work_packages/query_filters.html
  43. 0
      frontend/public/templates/work_packages/sort_header.html
  44. 0
      frontend/public/templates/work_packages/tabs/_add_work_package_child.html
  45. 0
      frontend/public/templates/work_packages/tabs/_add_work_package_relation.html
  46. 0
      frontend/public/templates/work_packages/tabs/_attachment_file_size.html
  47. 0
      frontend/public/templates/work_packages/tabs/_attachment_title_cell.html
  48. 0
      frontend/public/templates/work_packages/tabs/_attachment_user_cell.html
  49. 0
      frontend/public/templates/work_packages/tabs/_attachments_table.html
  50. 0
      frontend/public/templates/work_packages/tabs/_attachments_title.html
  51. 0
      frontend/public/templates/work_packages/tabs/_editable_comment.html
  52. 0
      frontend/public/templates/work_packages/tabs/_panel_expander.html
  53. 0
      frontend/public/templates/work_packages/tabs/_user_activity.html
  54. 0
      frontend/public/templates/work_packages/tabs/_user_field.html
  55. 0
      frontend/public/templates/work_packages/tabs/_work_package_relations.html
  56. 0
      frontend/public/templates/work_packages/tabs/activity.html
  57. 0
      frontend/public/templates/work_packages/tabs/attachments.html
  58. 0
      frontend/public/templates/work_packages/tabs/overview.html
  59. 0
      frontend/public/templates/work_packages/tabs/relations.html
  60. 0
      frontend/public/templates/work_packages/tabs/watchers.html
  61. 0
      frontend/public/templates/work_packages/work_package_column.html
  62. 0
      frontend/public/templates/work_packages/work_package_context_menu.html
  63. 0
      frontend/public/templates/work_packages/work_package_details_toolbar.html
  64. 0
      frontend/public/templates/work_packages/work_packages_table.html
  65. 0
      frontend/rails-plugins.conf.js
  66. 11
      frontend/tests/integration/server.js
  67. 10
      frontend/webpack.config.js

@ -1,3 +0,0 @@
{
"directory": "vendor/assets/components"
}

3
.gitignore vendored

@ -53,7 +53,6 @@
/db/*.sqlite3
/db/schema.rb
/files/*
/frontend/tests/unit/reports
/log/*.log*
/log/mongrel_debug
/public/dispatch.*
@ -66,7 +65,6 @@
/tmp/sockets/*
/tmp/test/*
/vendor/rails
/vendor/assets/components
/*.rbc
/doc/app
#/Gemfile.lock
@ -82,4 +80,3 @@
# asset cache
/.sass-cache/
/node_modules/

@ -36,8 +36,8 @@ sudo: false
cache:
- bundler: true
- directories:
- node_modules
- vendor/assets/components
- frontend/node_modules
- frontend/bower_components
branches:
only:
@ -70,7 +70,7 @@ before_install:
- "/sbin/start-stop-daemon --start -v --pidfile ./tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1920x1080x16"
- "echo `xdpyinfo -display :99 | grep 'dimensions' | awk '{ print $2 }'`"
- "nvm use 0.10"
- "travis_retry npm install"
- "cd frontend && travis_retry npm install && cd .."
before_script:
- if [[ ! $TEST_SUITE =~ ^(karma|protractor)$ ]]; then
@ -79,7 +79,7 @@ before_script:
script:
- if [[ $TEST_SUITE =~ ^(karma|protractor)$ ]]; then
npm run $TEST_SUITE;
cd frontend && npm run $TEST_SUITE;
else
bundle exec rake $TEST_SUITE;
fi

@ -0,0 +1,6 @@
/.sass-cache
/bower_components
/coverage
/node_modules
/tests/unit/reports
/tmp

@ -42,8 +42,8 @@ var server;
var paths = {
scripts: [
'frontend/app/**/*.js',
'!frontend/app/vendor/**/*.js'
'app/**/*.js',
'!app/vendor/**/*.js'
]
};
@ -54,13 +54,13 @@ gulp.task('lint', function() {
});
gulp.task('webpack', function() {
return gulp.src('frontend/app/openproject-app.js')
return gulp.src('app/openproject-app.js')
.pipe(gulpWebpack(config))
.pipe(gulp.dest('app/assets/javascripts/bundles'));
.pipe(gulp.dest('../app/assets/javascripts/bundles'));
});
gulp.task('sass', function() {
return gulp.src('app/assets/stylesheets/default.css.sass')
return gulp.src('../app/assets/stylesheets/default.css.sass')
.pipe(sass({
bundleExec: true,
require: 'bourbon'
@ -72,7 +72,7 @@ gulp.task('sass', function() {
});
gulp.task('express', function() {
var expressApp = require('./frontend/tests/integration/server');
var expressApp = require('./tests/integration/server');
var port = process.env.PORT || 8080;
(function startServer(port) {
@ -93,9 +93,9 @@ gulp.task('webdriver:update', webdriverUpdate);
gulp.task('webdriver:standalone', ['webdriver:update'], webdriverStandalone);
gulp.task('tests:protractor', ['webdriver:update', 'webpack', 'sass', 'express'], function(done) {
gulp.src('frontend/tests/integration/**/*_spec.js')
gulp.src('tests/integration/**/*_spec.js')
.pipe(protractor({
configFile: 'frontend/tests/integration/protractor.conf.js',
configFile: 'tests/integration/protractor.conf.js',
args: ['--baseUrl', 'http://' + server.address().address + ':' + server.address().port]
}))
.on('error', function(e) {
@ -109,7 +109,7 @@ gulp.task('tests:protractor', ['webdriver:update', 'webpack', 'sass', 'express']
gulp.task('default', ['webpack', 'sass', 'express']);
gulp.task('watch', function() {
gulp.watch('frontend/app/**/*.js', ['webpack']);
gulp.watch('app/**/*.js', ['webpack']);
gulp.watch('config/locales/js-*.yml', ['webpack']);
gulp.watch('app/assets/stylesheets/**/*.sass', ['sass']);
});

@ -48,35 +48,35 @@ module.exports = function(config) {
// list of files / patterns to load in the browser
files: [
"vendor/assets/components/jquery/dist/jquery.js",
"vendor/assets/components/momentjs/moment.js",
"vendor/assets/components/moment-timezone/moment-timezone.js",
'vendor/assets/components/select2/select2.js',
"vendor/assets/javascripts/moment-timezone/moment-timezone-data.js",
"bower_components/jquery/dist/jquery.js",
"bower_components/momentjs/moment.js",
"bower_components/moment-timezone/moment-timezone.js",
'bower_components/select2/select2.js',
"../vendor/assets/javascripts/moment-timezone/moment-timezone-data.js",
'frontend/app/openproject-app.js',
"vendor/assets/components/angular-mocks/angular-mocks.js",
'app/openproject-app.js',
"bower_components/angular-mocks/angular-mocks.js",
"app/assets/javascripts/lib/jquery.trap.js",
"../app/assets/javascripts/lib/jquery.trap.js",
'app/assets/javascripts/autocompleter.js',
'app/assets/javascripts/members_select_boxes.js',
'app/assets/javascripts/openproject.js',
'app/assets/javascripts/timelines_select_boxes.js',
'app/assets/javascripts/jstoolbar/jstoolbar.js',
'../app/assets/javascripts/autocompleter.js',
'../app/assets/javascripts/members_select_boxes.js',
'../app/assets/javascripts/openproject.js',
'../app/assets/javascripts/timelines_select_boxes.js',
'../app/assets/javascripts/jstoolbar/jstoolbar.js',
'app/assets/javascripts/date-en-US.js',
'../app/assets/javascripts/date-en-US.js',
'frontend/tests/unit/tests/timeline_stubs.js',
'frontend/tests/unit/lib/rosie.js',
'frontend/tests/unit/tests/test-helper.js',
'frontend/tests/unit/factories/*factory.js',
'tests/unit/tests/timeline_stubs.js',
'tests/unit/lib/rosie.js',
'tests/unit/tests/test-helper.js',
'tests/unit/factories/*factory.js',
'vendor/assets/components/jquery-mockjax/jquery.mockjax.js',
'bower_components/jquery-mockjax/jquery.mockjax.js',
'frontend/tests/unit/tests/asset_functions.js',
'frontend/tests/unit/tests/**/*test.js',
'frontend/tests/unit/tests/legacy-tests.js',
'tests/unit/tests/asset_functions.js',
'tests/unit/tests/**/*test.js',
'tests/unit/tests/legacy-tests.js',
'public/templates/**/*.html'
],
@ -91,8 +91,8 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'app/assets/javascripts/*.js': ['coverage'],
'frontend/app/**/*.js': ['webpack'], // coverage disabled
'../app/assets/javascripts/*.js': ['coverage'],
'app/**/*.js': ['webpack'], // coverage disabled
'public/templates/**/*.html': ['ng-html2js']
},
@ -132,7 +132,7 @@ module.exports = function(config) {
junitReporter: {
outputFile: 'frontend/tests/unit/reports/test-results.xml'
outputFile: 'tests/unit/reports/test-results.xml'
},
coverageReporter: {

@ -35,6 +35,7 @@ var mocks = globSync('./mocks/**/*.js', {
var express = require('express');
var railsRoot = __dirname + '/../../..';
var appRoot = __dirname + '/../..';
var app = express();
app.use(bodyParser.json());
@ -50,13 +51,13 @@ app.use(express.static(__dirname));
app.use('/assets', express.static(railsRoot + '/app/assets/javascripts'));
app.use('/assets', express.static(railsRoot + '/app/assets/images'));
app.use('/assets', express.static(railsRoot + '/app/assets/stylesheets'));
app.use('/templates', express.static(railsRoot + '/public/templates'));
app.use('/javascripts', express.static(railsRoot + '/public/javascripts'));
app.use('/stylesheets', express.static(railsRoot + '/tmp/stylesheets'));
app.use('/bower_components', express.static(railsRoot +
'/vendor/assets/components'));
app.use('/assets/angular-busy', express.static(railsRoot +
'/vendor/assets/components/angular-busy'));
app.use('/templates', express.static(appRoot + '/public/templates'));
app.use('/bower_components', express.static(appRoot + '/bower_components'));
app.use('/assets/angular-busy', express.static(appRoot +
'/bower_components/angular-busy'));
app.get('/work_packages*', function(req, res) {
fs.readFile(__dirname + '/index.html', 'utf8', function(err,
text) {

@ -1,7 +1,7 @@
var webpack = require('webpack'),
path = require('path'),
_ = require('lodash'),
pathConfig = require('./config/rails-plugins.conf');
pathConfig = require('./rails-plugins.conf');
var pluginEntries = _.reduce(pathConfig.pluginNamesPaths, function(entries, path, name) {
entries[name.replace(/^openproject\-/, '')] = name;
@ -14,7 +14,7 @@ var pluginAliases = _.reduce(pathConfig.pluginNamesPaths, function(entries, plug
}, {});
module.exports = {
context: __dirname + '/frontend/app',
context: __dirname + '/app',
entry: _.merge({
app: './openproject-app.js'
@ -22,7 +22,7 @@ module.exports = {
output: {
filename: 'openproject-[name].js',
path: path.join(__dirname, 'app', 'assets', 'javascripts', 'bundles')
path: path.join(__dirname, '..', 'app', 'assets', 'javascripts', 'bundles')
},
module: {
@ -38,11 +38,11 @@ module.exports = {
modulesDirectories: [
'node_modules',
'vendor/assets/components'
'bower_components'
].concat(pathConfig.pluginDirectories),
alias: _.merge({
'locales': 'config/locales',
'locales': './../../config/locales',
'angular-ui-date': 'angular-ui-date/src/date',
'angular-truncate': 'angular-truncate/src/truncate',
Loading…
Cancel
Save