diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-11-23 20:57:12 +0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-11-24 18:44:59 +0300 |
commit | 9060ca5ad3eba74cee4407176db4cae5e359a239 (patch) | |
tree | 34eaa87db87ab612fb56e43f7c6bc2d827f06269 | |
parent | 3184b7d30faf5215074e950d1cac6988dc66d96f (diff) |
Merge branch 'move-timeago-to-vendor-dir' into 'master'
move timeago.js to vendor directory
## What does this MR do?
moves timeago.js into `/vendor/assets/javascripts` for consistency with other external javascript libraries.
## Are there points in the code the reviewer needs to double check?
make sure timeago still works as it should...? I don't see how this could have broken anything.
## Why was this MR needed?
consistency with our guidelines
## Does this MR meet the acceptance criteria?
- Tests
- [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
See discussion in [!6274](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6274#note_18625583)
See merge request !7590
-rw-r--r-- | app/assets/javascripts/environments/components/environment_item.js.es6 | 8 | ||||
-rw-r--r-- | app/assets/javascripts/lib/utils/datetime_utility.js | 8 | ||||
-rw-r--r-- | spec/javascripts/build_spec.js.es6 | 1 | ||||
-rw-r--r-- | spec/javascripts/merge_request_widget_spec.js | 2 | ||||
-rw-r--r-- | vendor/assets/javascripts/timeago.js (renamed from app/assets/javascripts/lib/utils/timeago.js) | 8 |
5 files changed, 15 insertions, 12 deletions
diff --git a/app/assets/javascripts/environments/components/environment_item.js.es6 b/app/assets/javascripts/environments/components/environment_item.js.es6 index 36a0fec3cab..07f49cce3dc 100644 --- a/app/assets/javascripts/environments/components/environment_item.js.es6 +++ b/app/assets/javascripts/environments/components/environment_item.js.es6 @@ -1,4 +1,7 @@ -/*= require lib/utils/timeago */ +/* global Vue */ +/* global timeago */ + +/*= require timeago */ /*= require lib/utils/text_utility */ /*= require vue_common_component/commit */ /*= require ./environment_actions */ @@ -6,9 +9,6 @@ /*= require ./environment_stop */ /*= require ./environment_rollback */ -/* global Vue */ -/* global timeago */ - (() => { /** * Envrionment Item Component diff --git a/app/assets/javascripts/lib/utils/datetime_utility.js b/app/assets/javascripts/lib/utils/datetime_utility.js index d480fdc882b..963d2851e5f 100644 --- a/app/assets/javascripts/lib/utils/datetime_utility.js +++ b/app/assets/javascripts/lib/utils/datetime_utility.js @@ -1,4 +1,10 @@ -/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, no-undef, comma-dangle, no-unused-expressions, prefer-template, padded-blocks, max-len */ +/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, comma-dangle, no-unused-expressions, prefer-template, padded-blocks, max-len */ +/* global timeago */ +/* global dateFormat */ + +/*= require timeago */ +/*= require date.format */ + (function() { (function(w) { var base; diff --git a/spec/javascripts/build_spec.js.es6 b/spec/javascripts/build_spec.js.es6 index ee192c4f18a..4208e076e96 100644 --- a/spec/javascripts/build_spec.js.es6 +++ b/spec/javascripts/build_spec.js.es6 @@ -2,7 +2,6 @@ /* global Build */ /* global Turbolinks */ -//= require lib/utils/timeago //= require lib/utils/datetime_utility //= require build //= require breakpoints diff --git a/spec/javascripts/merge_request_widget_spec.js b/spec/javascripts/merge_request_widget_spec.js index f38e9cb8ef5..62890f1ca96 100644 --- a/spec/javascripts/merge_request_widget_spec.js +++ b/spec/javascripts/merge_request_widget_spec.js @@ -1,6 +1,6 @@ /* eslint-disable space-before-function-paren, quotes, comma-dangle, dot-notation, indent, quote-props, no-var, padded-blocks, max-len */ + /*= require merge_request_widget */ -/*= require lib/utils/timeago */ /*= require lib/utils/datetime_utility */ (function() { diff --git a/app/assets/javascripts/lib/utils/timeago.js b/vendor/assets/javascripts/timeago.js index edf0a612374..0eb6f7967a5 100644 --- a/app/assets/javascripts/lib/utils/timeago.js +++ b/vendor/assets/javascripts/timeago.js @@ -1,5 +1,3 @@ -/* eslint-disable no-unused-expressions, wrap-iife, func-names, curly, no-param-reassign, no-trailing-spaces, prefer-arrow-callback, no-var, one-var, quote-props, space-before-function-paren, vars-on-top, radix, prefer-template, space-infix-ops, no-use-before-define, newline-per-chained-call, no-useless-escape, no-nested-ternary, indent, no-undef, no-plusplus, one-var-declaration-per-line, operator-assignment, consistent-return, keyword-spacing, max-len, space-unary-ops, no-shadow, no-restricted-syntax, guard-for-in, eol-last, max-len */ - /** * Copyright (c) 2016 hustcc * License: MIT @@ -14,7 +12,7 @@ module.exports = factory(root); else root.timeago = factory(root); -}(typeof window !== 'undefined' ? window : this, +}(typeof window !== 'undefined' ? window : this, function () { var cnt = 0, // the timer counter, for timer key indexMapEn = 'second_minute_hour_day_week_month_year'.split('_'), @@ -32,7 +30,7 @@ function () { SEC_ARRAY = [60, 60, 24, 7, 365/7/12, 12], SEC_ARRAY_LEN = 6, ATTR_DATETIME = 'datetime'; - + // format Date / string / timestamp to Date instance. function toDate(input) { if (input instanceof Date) return input; @@ -236,4 +234,4 @@ function () { }; return timeagoFactory; -});
\ No newline at end of file +}); |