From 83673fdbf70b624b119cdf909dbbb1849c027f76 Mon Sep 17 00:00:00 2001 From: Leonardo Luiz Date: Sat, 1 Apr 2017 14:21:46 -0300 Subject: [PATCH] feat(New Issue): Generate branch name when an issue is created --- package.json | 6 +- public/index.html | 6 +- public/js/bundle.js | 5019 ++++++++++++++++++--------------- src/store/sagas.js | 24 +- src/utils/createBranchName.js | 22 + src/utils/index.js | 1 + 6 files changed, 2797 insertions(+), 2281 deletions(-) create mode 100644 src/utils/createBranchName.js diff --git a/package.json b/package.json index 2fced5c..751059e 100644 --- a/package.json +++ b/package.json @@ -37,18 +37,16 @@ "conventional-changelog-cli": "^1.2.0", "coveralls": "^2.11.14", "css-loader": "^0.25.0", + "diacritics": "^1.3.0", "enzyme": "^2.4.1", "eslint": "^3.5.0", "eslint-plugin-react": "^6.2.2", "exports-loader": "^0.6.3", "faker": "^4.1.0", "imports-loader": "^0.6.5", - "install": "^0.8.7", "jest": "^16.0.1", "lodash": "^4.17.4", "normalizr": "^3.2.2", - "npm": "^4.4.1", - "perfect-scrollbar": "^0.6.12", "react": "^15.4.2", "react-addons-css-transition-group": "^15.4.2", "react-addons-test-utils": "^15.3.2", @@ -62,13 +60,11 @@ "redux-logger": "^2.10.1", "redux-mock-store": "^1.2.1", "redux-saga": "^0.14.3", - "redux-thunk": "^2.1.0", "reselect": "^2.5.4", "semantic-ui-react": "^0.67.1", "style-loader": "^0.13.1", "stylus": "^0.54.5", "stylus-loader": "^2.3.1", - "underscore": "^1.8.3", "webpack": "^1.13.2", "whatwg-fetch": "^1.0.0" } diff --git a/public/index.html b/public/index.html index b0fd903..72ee698 100644 --- a/public/index.html +++ b/public/index.html @@ -1,7 +1,9 @@ - + - Gitlab + Gitlab Manager + + 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + evt.preventDefault(); + callback.apply(undefined, [evt].concat(args)); + }); + + exports.default = preventDefault; + +/***/ }, +/* 822 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _constants = __webpack_require__(775); @@ -47169,7 +47218,7 @@ }; /***/ }, -/* 822 */ +/* 823 */ /***/ function(module, exports) { 'use strict'; @@ -47198,7 +47247,183 @@ }; /***/ }, -/* 823 */ +/* 824 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _pipe = __webpack_require__(825); + + var _pipe2 = _interopRequireDefault(_pipe); + + var _toLower = __webpack_require__(828); + + var _toLower2 = _interopRequireDefault(_toLower); + + var _replace = __webpack_require__(829); + + var _replace2 = _interopRequireDefault(_replace); + + var _diacritics = __webpack_require__(1410); + + var _diacritics2 = _interopRequireDefault(_diacritics); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var convertSpecialCharactersToSpace = (0, _replace2.default)(/([^\w\s])/ig, ' '); + var convertSpacesToDash = (0, _replace2.default)(/\s+/g, '-'); + var addId = function addId(id) { + return function (s) { + return id + '-' + s; + }; + }; + var normalizeDashes = (0, _replace2.default)(/-+/g, '-'); + var removeLastDash = (0, _replace2.default)(/-$/, ''); + + var createBranchName = function createBranchName(id, text) { + return (0, _pipe2.default)(_diacritics2.default.remove, convertSpecialCharactersToSpace, convertSpacesToDash, addId(id), normalizeDashes, removeLastDash, _toLower2.default)(text); + }; + + exports.default = createBranchName; + +/***/ }, +/* 825 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(826); + + +/***/ }, +/* 826 */ +/***/ function(module, exports, __webpack_require__) { + + var convert = __webpack_require__(605), + func = convert('flow', __webpack_require__(827)); + + func.placeholder = __webpack_require__(608); + module.exports = func; + + +/***/ }, +/* 827 */ +/***/ function(module, exports, __webpack_require__) { + + var createFlow = __webpack_require__(781); + + /** + * Creates a function that returns the result of invoking the given functions + * with the `this` binding of the created function, where each successive + * invocation is supplied the return value of the previous. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {...(Function|Function[])} [funcs] The functions to invoke. + * @returns {Function} Returns the new composite function. + * @see _.flowRight + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flow([_.add, square]); + * addSquare(1, 2); + * // => 9 + */ + var flow = createFlow(); + + module.exports = flow; + + +/***/ }, +/* 828 */ +/***/ function(module, exports, __webpack_require__) { + + var toString = __webpack_require__(573); + + /** + * Converts `string`, as a whole, to lower case just like + * [String#toLowerCase](https://mdn.io/toLowerCase). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.toLower('--Foo-Bar--'); + * // => '--foo-bar--' + * + * _.toLower('fooBar'); + * // => 'foobar' + * + * _.toLower('__FOO_BAR__'); + * // => '__foo_bar__' + */ + function toLower(value) { + return toString(value).toLowerCase(); + } + + module.exports = toLower; + + +/***/ }, +/* 829 */ +/***/ function(module, exports, __webpack_require__) { + + var convert = __webpack_require__(605), + func = convert('replace', __webpack_require__(830)); + + func.placeholder = __webpack_require__(608); + module.exports = func; + + +/***/ }, +/* 830 */ +/***/ function(module, exports, __webpack_require__) { + + var toString = __webpack_require__(573); + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + module.exports = replace; + + +/***/ }, +/* 831 */, +/* 832 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -47208,7 +47433,7 @@ }); exports.getTodosCount = exports.getSearchProjects = exports.getLoadingSearch = exports.getSearchNextPage = exports.getSearchIds = exports.getQuery = exports.getIsCreatingIssue = exports.getNewIssueProjectNameSpace = exports.getNewIssueProject = exports.getIsProjectPinned = exports.getProjects = exports.getLoadingProjects = exports.getProjectsNextPage = exports.getProjectsIds = exports.getProjectById = exports.getAccessToken = exports.getUser = exports.getLoadingUser = exports.getHasTokenError = exports.getIsValidatingToken = exports.getIssueMessage = exports.getSelectedPage = exports.getEntityById = undefined; - var _2 = __webpack_require__(824); + var _2 = __webpack_require__(833); var _3 = _interopRequireDefault(_2); @@ -47216,7 +47441,7 @@ var _get2 = _interopRequireDefault(_get); - var _getOr = __webpack_require__(825); + var _getOr = __webpack_require__(834); var _getOr2 = _interopRequireDefault(_getOr); @@ -47294,14 +47519,14 @@ }; /***/ }, -/* 824 */ +/* 833 */ /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(608); /***/ }, -/* 825 */ +/* 834 */ /***/ function(module, exports, __webpack_require__) { var convert = __webpack_require__(605), @@ -47312,7 +47537,7 @@ /***/ }, -/* 826 */ +/* 835 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -47331,7 +47556,7 @@ var todosSchema = exports.todosSchema = [todoSchema]; /***/ }, -/* 827 */ +/* 836 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -47343,11 +47568,11 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - var _core = __webpack_require__(828); + var _core = __webpack_require__(837); - var _helpers = __webpack_require__(829); + var _helpers = __webpack_require__(838); - var _defaults = __webpack_require__(832); + var _defaults = __webpack_require__(841); var _defaults2 = _interopRequireDefault(_defaults); @@ -47467,7 +47692,7 @@ exports.default = createLogger; /***/ }, -/* 828 */ +/* 837 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -47480,9 +47705,9 @@ exports.printBuffer = printBuffer; - var _helpers = __webpack_require__(829); + var _helpers = __webpack_require__(838); - var _diff = __webpack_require__(830); + var _diff = __webpack_require__(839); var _diff2 = _interopRequireDefault(_diff); @@ -47613,7 +47838,7 @@ } /***/ }, -/* 829 */ +/* 838 */ /***/ function(module, exports) { "use strict"; @@ -47637,7 +47862,7 @@ var timer = exports.timer = typeof performance !== "undefined" && performance !== null && typeof performance.now === "function" ? performance : Date; /***/ }, -/* 830 */ +/* 839 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -47647,7 +47872,7 @@ }); exports.default = diffLogger; - var _deepDiff = __webpack_require__(831); + var _deepDiff = __webpack_require__(840); var _deepDiff2 = _interopRequireDefault(_deepDiff); @@ -47736,7 +47961,7 @@ module.exports = exports['default']; /***/ }, -/* 831 */ +/* 840 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global) {/*! @@ -48165,7 +48390,7 @@ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, -/* 832 */ +/* 841 */ /***/ function(module, exports) { "use strict"; @@ -48216,7 +48441,7 @@ module.exports = exports["default"]; /***/ }, -/* 833 */ +/* 842 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -48237,17 +48462,17 @@ var actions = _interopRequireWildcard(_actions); - var _components = __webpack_require__(834); + var _components = __webpack_require__(843); - var _selectors = __webpack_require__(823); + var _selectors = __webpack_require__(832); var _constants = __webpack_require__(775); - var _AccessToken = __webpack_require__(1388); + var _AccessToken = __webpack_require__(1395); var _AccessToken2 = _interopRequireDefault(_AccessToken); - var _Main = __webpack_require__(1389); + var _Main = __webpack_require__(1396); var _Main2 = _interopRequireDefault(_Main); @@ -48327,7 +48552,7 @@ exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(AppContainer); /***/ }, -/* 834 */ +/* 843 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -48337,47 +48562,47 @@ }); exports.NewIssue = exports.FadeTransition = exports.IssueMessage = exports.FlexItem = exports.FlexContainer = exports.Projects = exports.TopBar = exports.AccessToken = exports.Error = exports.Landing = exports.AppWrapper = undefined; - var _AppWrapper2 = __webpack_require__(835); + var _AppWrapper2 = __webpack_require__(844); var _AppWrapper3 = _interopRequireDefault(_AppWrapper2); - var _Landing2 = __webpack_require__(840); + var _Landing2 = __webpack_require__(849); var _Landing3 = _interopRequireDefault(_Landing2); - var _Error2 = __webpack_require__(1247); + var _Error2 = __webpack_require__(1254); var _Error3 = _interopRequireDefault(_Error2); - var _AccessToken2 = __webpack_require__(1248); + var _AccessToken2 = __webpack_require__(1255); var _AccessToken3 = _interopRequireDefault(_AccessToken2); - var _TopBar2 = __webpack_require__(1287); + var _TopBar2 = __webpack_require__(1294); var _TopBar3 = _interopRequireDefault(_TopBar2); - var _Projects2 = __webpack_require__(1297); + var _Projects2 = __webpack_require__(1304); var _Projects3 = _interopRequireDefault(_Projects2); - var _FlexContainer2 = __webpack_require__(1249); + var _FlexContainer2 = __webpack_require__(1256); var _FlexContainer3 = _interopRequireDefault(_FlexContainer2); - var _FlexItem2 = __webpack_require__(1372); + var _FlexItem2 = __webpack_require__(1379); var _FlexItem3 = _interopRequireDefault(_FlexItem2); - var _IssueMessage2 = __webpack_require__(1375); + var _IssueMessage2 = __webpack_require__(1382); var _IssueMessage3 = _interopRequireDefault(_IssueMessage2); - var _FadeTransition2 = __webpack_require__(1269); + var _FadeTransition2 = __webpack_require__(1276); var _FadeTransition3 = _interopRequireDefault(_FadeTransition2); - var _NewIssue2 = __webpack_require__(1385); + var _NewIssue2 = __webpack_require__(1392); var _NewIssue3 = _interopRequireDefault(_NewIssue2); @@ -48396,7 +48621,7 @@ exports.NewIssue = _NewIssue3.default; /***/ }, -/* 835 */ +/* 844 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -48409,7 +48634,7 @@ var _react2 = _interopRequireDefault(_react); - __webpack_require__(836); + __webpack_require__(845); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -48429,16 +48654,16 @@ exports.default = AppWrapper; /***/ }, -/* 836 */ +/* 845 */ /***/ function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a