From 39ab5a7ba9f943c7c769dee58b9f77f395a4143e Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 2 Jan 2019 13:48:47 +0100 Subject: [PATCH 1/4] [bug] unable to fetch projects from OpenProjects (#126) --- CHANGELOG.md | 2 ++ README.md | 2 +- app/assets/javascripts/controllers/projects.js.erb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb7af2cb5..a48ae5c2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog Fab Manager +- Fix a bug: unable to fetch projects from OpenProjects (#126) + ## v2.8.0 2018 December 27 - Refactored subscriptions to keep track of the previous ones diff --git a/README.md b/README.md index 9df25a5c7..645c5c945 100644 --- a/README.md +++ b/README.md @@ -468,7 +468,7 @@ If you want to try it, you can visit [this fab-manager](https://fablab.lacasemat To start using this awesome feature, there are a few steps: - send a mail to **contact@fab-manager.com** asking for your Open Projects client's credentials and giving them the name of your fab-manager, they will give you an `OPENLAB_APP_ID` and an `OPENLAB_APP_SECRET` -- fill in the value of the keys in your `application.yml` +- fill in the value of the keys in your environment file - start your fab-manager app - export your projects to open-projects (if you already have projects created on your fab-manager, unless you can skip that part) executing this command: `bundle exec rake fablab:openlab:bulk_export` diff --git a/app/assets/javascripts/controllers/projects.js.erb b/app/assets/javascripts/controllers/projects.js.erb index 538f298bd..2bea115e2 100644 --- a/app/assets/javascripts/controllers/projects.js.erb +++ b/app/assets/javascripts/controllers/projects.js.erb @@ -401,7 +401,7 @@ Application.Controllers.controller('ProjectsController', ['$scope', '$state', 'P }; var normalizeProjectsAttrs = function (projects) { - projects.map(function (project) { + return projects.map(function (project) { project.project_image = project.image_url; return project; }); From 1bc8cb911288f8b2ea16bd263da67c398c07c5ce Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 2 Jan 2019 14:49:13 +0100 Subject: [PATCH 2/4] [bug] elastic upgrade with PWD in docker-compose --- CHANGELOG.md | 1 + scripts/elastic-upgrade.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a48ae5c2b..74aeea0b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog Fab Manager +- Fix ES upgrade: when docker-compose file is using ${PWD}, the ES config volume is attached to the wrong container - Fix a bug: unable to fetch projects from OpenProjects (#126) ## v2.8.0 2018 December 27 diff --git a/scripts/elastic-upgrade.sh b/scripts/elastic-upgrade.sh index 87c189f67..c4320da02 100755 --- a/scripts/elastic-upgrade.sh +++ b/scripts/elastic-upgrade.sh @@ -319,14 +319,14 @@ upgrade_compose() # get current data directory dir=$(awk 'BEGIN { FS="\n"; RS="";} { match($0, /image: elasticsearch:2\.4(\n|.)+volumes:(\n|.)+(-.*elasticsearch\/data)/, lines); FS="[ :]+"; RS="\r\n"; split(lines[3], line); print line[2] }' "$FM_PATH/docker-compose.yml") # set the configuration directory - dir=$(echo "$dir" | sed "s^\${PWD}^$FM_PATH^") dir=$(echo "${dir//[$'\t\r\n ']}/config") # insert configuration directory into docker-compose bindings - awk "BEGIN { FS=\"\n\"; RS=\"\";} { print gensub(/(image: elasticsearch:2\.4(\n|.)+)volumes:\n/, \"\\\\1volumes:\n - ${dir}:/usr/share/elasticsearch/config\n\", \"g\") }" "$FM_PATH/docker-compose.yml" > "$FM_PATH/.awktmpfile" && mv "$FM_PATH/.awktmpfile" "$FM_PATH/docker-compose.yml" - echo -e "\nCopying ElasticSearch 2.4 configuration files from GitHub to $dir..." - mkdir -p "$dir" - curl -sSL https://raw.githubusercontent.com/LaCasemate/fab-manager/master/docker/elasticsearch.yml > "$dir/elasticsearch.yml" - curl -sSL https://raw.githubusercontent.com/LaCasemate/fab-manager/master/docker/log4j2.properties > "$dir/log4j2.properties" + awk "BEGIN { FS=\"\n\"; RS=\"\";} { print gensub(/(image: elasticsearch:2\.4(\n|.)+volumes:(\n|.)+(-.*elasticsearch\/data))/, \"\\\\1\n - ${dir}:/usr/share/elasticsearch/config\", \"g\") }" "$FM_PATH/docker-compose.yml" > "$FM_PATH/.awktmpfile" && mv "$FM_PATH/.awktmpfile" "$FM_PATH/docker-compose.yml" + abs_dir=$(echo "$dir" | sed "s^\${PWD}^$FM_PATH^") + echo -e "\nCopying ElasticSearch 2.4 configuration files from GitHub to $abs_dir..." + mkdir -p "$abs_dir" + curl -sSL https://raw.githubusercontent.com/LaCasemate/fab-manager/master/docker/elasticsearch.yml > "$abs_dir/elasticsearch.yml" + curl -sSL https://raw.githubusercontent.com/LaCasemate/fab-manager/master/docker/log4j2.properties > "$abs_dir/log4j2.properties" fi docker-compose pull docker-compose up -d From 9b4eac57b644119ceb7353a65dcadc9d5568c5e1 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 2 Jan 2019 15:47:12 +0100 Subject: [PATCH 3/4] fix doc: references for external locales --- CHANGELOG.md | 1 + config/initializers/assets.rb | 17 ++++++++++++++--- doc/environment.md | 20 ++++++++++---------- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74aeea0b5..1c9aa652e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog Fab Manager - Fix ES upgrade: when docker-compose file is using ${PWD}, the ES config volume is attached to the wrong container +- Fixed environment documentation references for external locales - Fix a bug: unable to fetch projects from OpenProjects (#126) ## v2.8.0 2018 December 27 diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index d8be92465..90c5cb936 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -10,7 +10,18 @@ Rails.application.config.assets.version = '1.0' # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # Rails.application.config.assets.precompile += %w( search.js ) -Rails.application.config.assets.precompile += %w( fontawesome-webfont.eot fontawesome-webfont.woff fontawesome-webfont.svg fontawesome-webfont.ttf ) -Rails.application.config.assets.precompile += %w( app.printer.css ) +Rails.application.config.assets.precompile += %w[ + fontawesome-webfont.eot + fontawesome-webfont.woff + fontawesome-webfont.svg + fontawesome-webfont.ttf +] +Rails.application.config.assets.precompile += %w[app.printer.css] -Rails.application.config.assets.precompile += %w( angular-i18n/angular-locale_*.js moment/locale/*.js summernote/lang/*.js messageformat/locale/*.js fullcalendar/dist/lang/*.js ) +Rails.application.config.assets.precompile += %w[ + angular-i18n/angular-locale_*.js + moment/locale/*.js + summernote/lang/*.js + messageformat/locale/*.js + fullcalendar/dist/lang/*.js +] diff --git a/doc/environment.md b/doc/environment.md index 93d293922..14a99800c 100644 --- a/doc/environment.md +++ b/doc/environment.md @@ -165,7 +165,7 @@ Please, be aware that **the configured locale will imply the CURRENCY symbol use _Eg.: configuring **es-ES** will set the currency symbol to **€** but **es-MX** will set **$** as currency symbol, so setting the `RAILS_LOCALE` to simple **es** (without country indication) will probably not do what you expect._ -See `config/locales/rails.*.yml` for a list of available locales. Default is **en**. +See [config/locales/rails.*.yml](../config/locales) for a list of available locales. Default is **en**. If your locale is not present in that list or any locale doesn't have your exact expectations, please open a pull request to share your modifications with the community and obtain a rebuilt docker image. You can find templates of these files at https://github.com/svenfuchs/rails-i18n/tree/rails-4-x/rails/locale. @@ -174,14 +174,14 @@ You can find templates of these files at https://github.com/svenfuchs/rails-i18n Configure the moment.js library for l10n. -See `vendor/assets/components/moment/locale/*.js` for a list of available locales. +See [github.com/moment/momentlocale/*.js](https://github.com/moment/moment/tree/2.22.2/locale) for a list of available locales. Default is **en** (even if it's not listed). SUMMERNOTE_LOCALE Configure the javascript summernote editor for l10n. -See `vendor/assets/components/summernote/lang/summernote-*.js` for a list of available locales. +See [github.com/summernote/summernote/lang/summernote-*.js](https://github.com/summernote/summernote/tree/v0.7.3/lang) for a list of available locales. Default is **en-US** (even if it's not listed). ANGULAR_LOCALE @@ -192,24 +192,24 @@ Please, be aware that **the configured locale will imply the CURRENCY displayed _Eg.: configuring **fr-fr** will set the currency symbol to **€** but **fr-ca** will set **$** as currency symbol, so setting the `ANGULAR_LOCALE` to simple **fr** (without country indication) will probably not do what you expect._ -See `vendor/assets/components/angular-i18n/angular-locale_*.js` for a list of available locales. Default is **en**. +See [code.angularjs.org/i18n/angular-locale_*.js](https://code.angularjs.org/1.6.10/i18n/) for a list of available locales. Default is **en**. MESSAGEFORMAT_LOCALE Configure the messageformat.js library, used by angular-translate. -See vendor/assets/components/messageformat/locale/*.js for a list of available locales. +See [github.com/messageformat/messageformat/locale/*.js](https://github.com/messageformat/messageformat/tree/v0.1.8/locale) for a list of available locales. FULLCALENDAR_LOCALE Configure the fullCalendar JS agenda library. -See `vendor/assets/components/fullcalendar/dist/lang/*.js` for a list of available locales. Default is **en** (even if it's not listed). +See [github.com/fullcalendar/fullcalendar/lang/*.js](https://github.com/fullcalendar/fullcalendar/tree/v2.3.1/lang) for a list of available locales. Default is **en-us**. ELASTICSEARCH_LANGUAGE_ANALYZER This configure the language analyzer for indexing and searching in projects with ElasticSearch. -See https://www.elastic.co/guide/en/elasticsearch/reference/5.6/analysis-lang-analyzer.html for a list of available analyzers. +See [ElasticSearch guide](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/analysis-lang-analyzer.html) for a list of available analyzers. TIME_ZONE @@ -223,19 +223,19 @@ Configure the first day of the week in your locale zone (generally monday or sun D3_DATE_FORMAT Date format for dates displayed in statistics charts. -See https://github.com/mbostock/d3/wiki/Time-Formatting#format for available formats. +See [D3 Wiki](https://github.com/mbostock/d3/wiki/Time-Formatting#format) for available formats. UIB_DATE_FORMAT Date format for dates displayed and parsed in date pickers. -See https://angular-ui.github.io/bootstrap/#uibdateparser-s-format-codes for a list available formats. +See [AngularUI documentation](https://angular-ui.github.io/bootstrap/#uibdateparser-s-format-codes) for a list available formats. **BEWARE**: years format with less than 4 digits will result in problems because the system won't be able to distinct dates with the same less significant digits, eg. 50 could mean 1950 or 2050. EXCEL_DATE_FORMAT Date format for dates shown in exported Excel files (eg. statistics) -See https://support.microsoft.com/en-us/kb/264372 for a list a available formats. +See [Microsoft support](https://support.microsoft.com/en-us/kb/264372) for a list a available formats. ## Open projects settings From 3ec8923c5817bd3fd4eb1f007ff9c048581c5cdb Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 2 Jan 2019 15:53:51 +0100 Subject: [PATCH 4/4] Version 2.8.1 --- CHANGELOG.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c9aa652e..81c62aa52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog Fab Manager +## v2.8.1 2019 January 02 + - Fix ES upgrade: when docker-compose file is using ${PWD}, the ES config volume is attached to the wrong container - Fixed environment documentation references for external locales - Fix a bug: unable to fetch projects from OpenProjects (#126) diff --git a/package.json b/package.json index d5c5f1f6e..6656c2943 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fab-manager", - "version": "2.8.0", + "version": "2.8.1", "description": "FabManager is the FabLab management solution. It is web-based, open-source and totally free.", "keywords": [ "fablab",