-
Notifications
You must be signed in to change notification settings - Fork 3
/
11-fd5ef347026a0fd2f506.js.map
1 lines (1 loc) · 70.5 KB
/
11-fd5ef347026a0fd2f506.js.map
1
{"version":3,"sources":["webpack:///11-fd5ef347026a0fd2f506.js","webpack:///./src/GroupEditor/GroupEditor.component.js","webpack:///./src/GroupEditor/ItemSelector.component.js","webpack:///./src/GroupEditor/ModelTypeSelector.component.js","webpack:///./src/GroupEditor/GroupsForItemManager.component.js","webpack:///./src/GroupEditor/ItemsInGroupManager.component.js"],"names":["webpackJsonp","3309","module","__webpack_exports__","__webpack_require__","Object","defineProperty","value","__WEBPACK_IMPORTED_MODULE_0_react__","__WEBPACK_IMPORTED_MODULE_0_react___default","n","__WEBPACK_IMPORTED_MODULE_1_material_ui_Tabs_Tabs__","__WEBPACK_IMPORTED_MODULE_1_material_ui_Tabs_Tabs___default","__WEBPACK_IMPORTED_MODULE_2_material_ui_Tabs_Tab__","__WEBPACK_IMPORTED_MODULE_2_material_ui_Tabs_Tab___default","__WEBPACK_IMPORTED_MODULE_3_material_ui_Paper_Paper__","__WEBPACK_IMPORTED_MODULE_3_material_ui_Paper_Paper___default","__WEBPACK_IMPORTED_MODULE_4__ItemsInGroupManager_component__","__WEBPACK_IMPORTED_MODULE_5__GroupsForItemManager_component__","a","createClass","displayName","render","createElement","onChange","this","_tabChanged","label","ref","refs","itemsForGroup","reset","groupsForItem","3782","__WEBPACK_IMPORTED_MODULE_1_material_ui_SelectField_SelectField__","__WEBPACK_IMPORTED_MODULE_1_material_ui_SelectField_SelectField___default","__WEBPACK_IMPORTED_MODULE_2_material_ui_MenuItem_MenuItem__","__WEBPACK_IMPORTED_MODULE_2_material_ui_MenuItem_MenuItem___default","propTypes","itemListStore","PropTypes","object","isRequired","onItemSelected","func","getInitialState","items","componentWillMount","_this","subscription","props","map","modelList","model","text","payload","id","subscribe","length","setState","componentWillUnmount","unsubscribe","renderOptions","state","option","index","key","primaryText","_onChange","fullWidth","event","3783","hasNameInArray","listToCheck","indexOf","name","__WEBPACK_IMPORTED_MODULE_3_d2_lib_d2__","__WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default","__WEBPACK_IMPORTED_MODULE_4_d2_utilizr_lib_camelCaseToUnderscores__","__WEBPACK_IMPORTED_MODULE_4_d2_utilizr_lib_camelCaseToUnderscores___default","__WEBPACK_IMPORTED_MODULE_5_d2_ui_lib_i18n_Translate_mixin__","_extends","assign","target","i","arguments","source","prototype","hasOwnProperty","call","nameListFilter","arrayOf","string","mixins","getDefaultProps","selectedModel","getInstance","then","d2","models","modelType","_this2","mapThroughDefinitions","v","filter","getTranslation","plural","hintText","3909","__WEBPACK_IMPORTED_MODULE_1_material_ui_TextField_TextField__","__WEBPACK_IMPORTED_MODULE_1_material_ui_TextField_TextField___default","__WEBPACK_IMPORTED_MODULE_2_loglevel__","__WEBPACK_IMPORTED_MODULE_2_loglevel___default","__WEBPACK_IMPORTED_MODULE_4__ModelTypeSelector_component__","__WEBPACK_IMPORTED_MODULE_5_d2_ui_lib_store_Store__","__WEBPACK_IMPORTED_MODULE_6__ItemSelector_component__","__WEBPACK_IMPORTED_MODULE_7_d2_ui_lib_i18n_Translate_mixin__","__WEBPACK_IMPORTED_MODULE_8_d2_ui_lib_group_editor_GroupEditor_component__","_slicedToArray","sliceIterator","arr","_arr","_n","_d","_e","undefined","_s","_i","Symbol","iterator","next","done","push","err","Array","isArray","TypeError","itemStore","create","assignedItemStore","filterText","showGroupEditor","renderGroupEditor","modelToEdit","_workItemChanged","defaultValue","_setFilterText","onAssignItems","_assignItems","onRemoveItems","_removeItems","contentStyle","padding","context","accessibleModels","schemaName","currentUser","canCreate","style","_typeChanged","createUrls","_state","itemDefinition","modelDefinition","requests","url","Api","getApi","api","post","Promise","all","get","_ref","_ref2","fullModel","catch","message","error","delete","_ref3","_ref4","modelDef","_this3","list","paging","fields","modelCollection","toArray","_this4","reject","availablePromise","modelPromise","_ref5","_ref6","availableItems","_this5","_ref7","_ref8","3910","contextTypes","accessibleG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GAA/BE,EAA+BD,EAAA,GAAfnB,EAAemB,EAAA,EACnCL,GAAK9H,MAAM0E,UAAU9E,SAASwI,GAC9BN,EAAK9H,MAAM4E,kBAAkBhF,SAASoH,EAAU7E,EAAGC,OAAO+D,GAAgBxD,SAC1EmF,EAAKlI,UACDoF,YAAagC,EACbb,eAAgBhE,EAAGC,OAAO+D,GAAgBxD,aAIzDsE,MAAM,SAAAC,GAAA,MAAWjE,GAAA7F,EAAI+J,MAAMD,MAGpClJ,MA1K6B,WA0KrB,GAAAqK,GAAA3K,IACJ,IAAKA,KAAKsC,MAAMgF,YAAhB,CAEA,GAAMmB,GAAiBzI,KAAKsC,MAAMgF,YAAYoB,gBAAgBxF,KAAKgI,QAAQ,QAAS,GAEpF9H,GAAA1D,EAAM6E,cACDC,KAAK,SAAAC,GAAA,MAAMwE,SACHC,KAAKzE,EAAIA,EAAGC,OAAOiG,EAAKrI,MAAMgF,YAAYoB,gBAAgBxF,MAAMiG,IAAIwB,EAAKrI,MAAMgF,YAAYvF,QACnGyC,KAAK,SAAAoG,GAAqB,GAAAC,GAAAhF,EAAA+E,EAAA,GAAnBnG,EAAmBoG,EAAA,GAAfvB,EAAeuB,EAAA,EACvBF,GAAKrI,MAAM4E,kBAAkBhF,SAASoH,EAAU7E,EAAGC,OAAO+D,GAAgBxD,SAC1E0F,EAAKzI,UACDoF,YAAagC,MAGpBC,MAAM,SAAAC,GAAA,MAAWjE,GAAA7F,EAAI+J,MAAMD","file":"11-fd5ef347026a0fd2f506.js","sourcesContent":["webpackJsonp([11],{\n\n/***/ 3309:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_material_ui_Tabs_Tabs__ = __webpack_require__(324);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_material_ui_Tabs_Tabs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_material_ui_Tabs_Tabs__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_material_ui_Tabs_Tab__ = __webpack_require__(255);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_material_ui_Tabs_Tab___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_material_ui_Tabs_Tab__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_material_ui_Paper_Paper__ = __webpack_require__(317);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_material_ui_Paper_Paper___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_material_ui_Paper_Paper__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ItemsInGroupManager_component__ = __webpack_require__(3910);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__GroupsForItemManager_component__ = __webpack_require__(3909);\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (__WEBPACK_IMPORTED_MODULE_0_react___default.a.createClass({\n displayName: 'GroupEditor.component',\n render: function render() {\n return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_3_material_ui_Paper_Paper___default.a,\n null,\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_1_material_ui_Tabs_Tabs___default.a,\n { onChange: this._tabChanged },\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_2_material_ui_Tabs_Tab___default.a,\n { label: 'Manage items in group' },\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__ItemsInGroupManager_component__[\"a\" /* default */], { ref: 'itemsForGroup' })\n ),\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_2_material_ui_Tabs_Tab___default.a,\n { label: 'Manage groups for item' },\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5__GroupsForItemManager_component__[\"a\" /* default */], { ref: 'groupsForItem' })\n )\n )\n );\n },\n _tabChanged: function _tabChanged() {\n this.refs.itemsForGroup.reset();\n this.refs.groupsForItem.reset();\n }\n}));\n\n/***/ }),\n\n/***/ 3782:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_material_ui_SelectField_SelectField__ = __webpack_require__(319);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_material_ui_SelectField_SelectField___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_material_ui_SelectField_SelectField__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_material_ui_MenuItem_MenuItem__ = __webpack_require__(204);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_material_ui_MenuItem_MenuItem___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_material_ui_MenuItem_MenuItem__);\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (__WEBPACK_IMPORTED_MODULE_0_react___default.a.createClass({\n displayName: 'ItemSelector.component',\n\n propTypes: {\n itemListStore: __WEBPACK_IMPORTED_MODULE_0_react___default.a.PropTypes.object.isRequired,\n onItemSelected: __WEBPACK_IMPORTED_MODULE_0_react___default.a.PropTypes.func.isRequired\n },\n\n getInitialState: function getInitialState() {\n return {\n items: []\n };\n },\n componentWillMount: function componentWillMount() {\n var _this = this;\n\n this.subscription = this.props.itemListStore.map(function (modelList) {\n return modelList.map(function (model) {\n return {\n text: model.displayName,\n payload: model.id,\n model: model\n };\n });\n }).subscribe(function (items) {\n if (items.length) {\n _this.props.onItemSelected(items[0].model);\n }\n\n _this.setState({ items: items });\n });\n },\n componentWillUnmount: function componentWillUnmount() {\n if (this.subscription && this.subscription.unsubscribe) {\n this.subscription.unsubscribe();\n }\n },\n renderOptions: function renderOptions() {\n return this.state.items.map(function (option, index) {\n return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_material_ui_MenuItem_MenuItem___default.a, { key: index, primaryText: option.text, value: option.payload });\n });\n },\n render: function render() {\n return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n 'div',\n null,\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_1_material_ui_SelectField_SelectField___default.a,\n { onChange: this._onChange, value: this.props.value && this.props.value.id, fullWidth: true },\n this.renderOptions()\n )\n );\n },\n _onChange: function _onChange(event, index, value) {\n if (this.state.items && this.state.items[index]) {\n this.props.onItemSelected(this.state.items[index].model);\n }\n }\n}));\n\n/***/ }),\n\n/***/ 3783:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_material_ui_SelectField_SelectField__ = __webpack_require__(319);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_material_ui_SelectField_SelectField___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_material_ui_SelectField_SelectField__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_material_ui_MenuItem_MenuItem__ = __webpack_require__(204);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_material_ui_MenuItem_MenuItem___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_material_ui_MenuItem_MenuItem__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_d2_lib_d2__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_d2_utilizr_lib_camelCaseToUnderscores__ = __webpack_require__(95);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_d2_utilizr_lib_camelCaseToUnderscores___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_d2_utilizr_lib_camelCaseToUnderscores__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_d2_ui_lib_i18n_Translate_mixin__ = __webpack_require__(1308);\nvar _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; };\n\n\n\n\n\n\n\n\nfunction hasNameInArray(listToCheck) {\n return function hasNameInArrayInner(value) {\n // If no list has been given the result is always true\n if (listToCheck.length === 0) {\n return true;\n }\n return listToCheck.indexOf(value.name) !== -1;\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (__WEBPACK_IMPORTED_MODULE_0_react___default.a.createClass({\n displayName: 'ModelTypeSelector.component',\n\n propTypes: {\n nameListFilter: __WEBPACK_IMPORTED_MODULE_0_react___default.a.PropTypes.arrayOf(__WEBPACK_IMPORTED_MODULE_0_react___default.a.PropTypes.string),\n onChange: __WEBPACK_IMPORTED_MODULE_0_react___default.a.PropTypes.func.isRequired\n },\n\n mixins: [__WEBPACK_IMPORTED_MODULE_5_d2_ui_lib_i18n_Translate_mixin__[\"a\" /* default */]],\n\n getDefaultProps: function getDefaultProps() {\n return {\n nameListFilter: []\n };\n },\n getInitialState: function getInitialState() {\n return {\n selectedModel: null\n };\n },\n componentWillMount: function componentWillMount() {\n var _this = this;\n\n __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default.a.getInstance().then(function (d2) {\n return _this.setState({ models: d2.models });\n });\n },\n _onChange: function _onChange(event, index, modelType) {\n this.setState({\n selectedModel: modelType\n });\n\n this.props.onChange(modelType);\n },\n renderOptions: function renderOptions() {\n var _this2 = this;\n\n if (this.state && this.state.models) {\n return this.state.models.mapThroughDefinitions(function (v) {\n return v;\n }).filter(hasNameInArray(this.props.nameListFilter)).map(function (value) {\n return {\n text: _this2.getTranslation(__WEBPACK_IMPORTED_MODULE_4_d2_utilizr_lib_camelCaseToUnderscores___default()(value.plural)),\n payload: value\n };\n }).map(function (option, index) {\n return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_material_ui_MenuItem_MenuItem___default.a, { key: index, primaryText: option.text, value: option.payload });\n });\n }\n return [];\n },\n render: function render() {\n return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n 'div',\n null,\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_1_material_ui_SelectField_SelectField___default.a,\n _extends({\n value: this.state.selectedModel,\n hintText: this.getTranslation('select_an_object_type'),\n fullWidth: true\n }, this.props, {\n onChange: this._onChange\n }),\n this.renderOptions()\n )\n );\n }\n}));\n\n/***/ }),\n\n/***/ 3909:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_material_ui_TextField_TextField__ = __webpack_require__(58);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_material_ui_TextField_TextField___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_material_ui_TextField_TextField__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_loglevel__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_loglevel___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_loglevel__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_d2_lib_d2__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ModelTypeSelector_component__ = __webpack_require__(3783);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_d2_ui_lib_store_Store__ = __webpack_require__(44);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ItemSelector_component__ = __webpack_require__(3782);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_d2_ui_lib_i18n_Translate_mixin__ = __webpack_require__(1308);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_d2_ui_lib_group_editor_GroupEditor_component__ = __webpack_require__(440);\nvar _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\"); } }; }();\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (__WEBPACK_IMPORTED_MODULE_0_react___default.a.createClass({\n displayName: 'GroupsForItemManager.component',\n\n mixins: [__WEBPACK_IMPORTED_MODULE_7_d2_ui_lib_i18n_Translate_mixin__[\"a\" /* default */]],\n\n getInitialState: function getInitialState() {\n var itemStore = __WEBPACK_IMPORTED_MODULE_5_d2_ui_lib_store_Store__[\"a\" /* default */].create();\n var assignedItemStore = __WEBPACK_IMPORTED_MODULE_5_d2_ui_lib_store_Store__[\"a\" /* default */].create();\n var itemListStore = __WEBPACK_IMPORTED_MODULE_5_d2_ui_lib_store_Store__[\"a\" /* default */].create();\n\n itemStore.state = [];\n assignedItemStore.state = [];\n\n return {\n itemListStore: itemListStore,\n itemStore: itemStore,\n assignedItemStore: assignedItemStore,\n filterText: '',\n showGroupEditor: false\n };\n },\n renderGroupEditor: function renderGroupEditor() {\n if (!this.state.showGroupEditor) {\n return [];\n }\n\n return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n 'div',\n null,\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6__ItemSelector_component__[\"a\" /* default */], {\n value: this.state.modelToEdit || this.state.itemListStore.state[0],\n itemListStore: this.state.itemListStore,\n onItemSelected: this._workItemChanged\n }),\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_material_ui_TextField_TextField___default.a, {\n fullWidth: true,\n hintText: this.getTranslation('search_available_selected_items'),\n defaultValue: this.state.filterText,\n onChange: this._setFilterText\n }),\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8_d2_ui_lib_group_editor_GroupEditor_component__[\"a\" /* default */], {\n itemStore: this.state.itemStore,\n assignedItemStore: this.state.assignedItemStore,\n onAssignItems: this._assignItems,\n onRemoveItems: this._removeItems,\n filterText: this.state.filterText\n })\n );\n },\n render: function render() {\n var contentStyle = {\n padding: '2rem'\n };\n\n var d2 = this.context.d2;\n var accessibleModels = ['indicator', 'dataElement', 'categoryOption'].filter(function (schemaName) {\n return d2.currentUser.canCreate(d2.models[schemaName + 'Group']);\n });\n\n return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n 'div',\n { style: contentStyle },\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__ModelTypeSelector_component__[\"a\" /* default */], {\n nameListFilter: accessibleModels,\n onChange: this._typeChanged\n }),\n this.renderGroupEditor()\n );\n },\n createUrls: function createUrls(items) {\n var _state = this.state,\n modelToEdit = _state.modelToEdit,\n itemDefinition = _state.itemDefinition;\n\n\n return items.map(function (id) {\n return modelToEdit.modelDefinition.plural + '/' + modelToEdit.id + '/' + itemDefinition + '/' + id;\n });\n },\n _assignItems: function _assignItems(items) {\n var _this = this;\n\n var requests = this.createUrls(items).map(function (url) {\n return __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default.a.getInstance().then(function (d2) {\n return d2.Api.getApi();\n }).then(function (api) {\n return api.post(url);\n });\n });\n\n return Promise.all(requests).then(function () {\n var itemDefinition = _this.state.modelToEdit.modelDefinition.name + 'Group';\n\n return __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default.a.getInstance().then(function (d2) {\n return Promise.all([d2, d2.models[_this.state.modelToEdit.modelDefinition.name].get(_this.state.modelToEdit.id)]);\n }).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n d2 = _ref2[0],\n fullModel = _ref2[1];\n\n _this.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n _this.setState({\n modelToEdit: fullModel\n });\n });\n }).catch(function (message) {\n return __WEBPACK_IMPORTED_MODULE_2_loglevel___default.a.error(message);\n });\n },\n _removeItems: function _removeItems(items) {\n var _this2 = this;\n\n var requests = this.createUrls(items).map(function (url) {\n return __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default.a.getInstance().then(function (d2) {\n return d2.Api.getApi();\n }).then(function (api) {\n return api.delete(url);\n });\n });\n\n return Promise.all(requests).then(function () {\n var itemDefinition = _this2.state.modelToEdit.modelDefinition.name + 'Group';\n\n return __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default.a.getInstance().then(function (d2) {\n return Promise.all([d2, d2.models[_this2.state.modelToEdit.modelDefinition.name].get(_this2.state.modelToEdit.id)]);\n }).then(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n d2 = _ref4[0],\n fullModel = _ref4[1];\n\n _this2.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n _this2.setState({\n modelToEdit: fullModel\n });\n });\n }).catch(function (message) {\n return __WEBPACK_IMPORTED_MODULE_2_loglevel___default.a.error(message);\n });\n },\n _typeChanged: function _typeChanged(modelDef) {\n var _this3 = this;\n\n modelDef.list({ paging: false, fields: 'id,displayName,name' }).then(function (modelCollection) {\n return modelCollection.toArray();\n }).then(function (models) {\n return _this3.state.itemListStore.setState(models);\n }).then(function () {\n return _this3.setState({ showGroupEditor: true });\n }).catch(function (message) {\n return __WEBPACK_IMPORTED_MODULE_2_loglevel___default.a.error(message);\n });\n },\n _setFilterText: function _setFilterText(event) {\n this.setState({\n filterText: event.target.value\n });\n },\n _workItemChanged: function _workItemChanged(model) {\n var _this4 = this;\n\n var itemDefinition = model.modelDefinition.name + 'Group';\n\n __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default.a.getInstance().then(function (d2) {\n if (!d2.models[itemDefinition]) {\n return Promise.reject('This groupType does not have a model named: ' + itemDefinition);\n }\n\n var availablePromise = d2.models[itemDefinition].list({ paging: false });\n var modelPromise = d2.models[model.modelDefinition.name].get(model.id);\n\n Promise.all([availablePromise, modelPromise]).then(function (_ref5) {\n var _ref6 = _slicedToArray(_ref5, 2),\n availableItems = _ref6[0],\n fullModel = _ref6[1];\n\n _this4.state.itemStore.setState(availableItems);\n _this4.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n _this4.setState({\n modelToEdit: fullModel,\n itemDefinition: d2.models[itemDefinition].plural\n });\n });\n }).catch(function (message) {\n return __WEBPACK_IMPORTED_MODULE_2_loglevel___default.a.error(message);\n });\n },\n reset: function reset() {\n var _this5 = this;\n\n if (!this.state.modelToEdit) {\n return;\n }\n\n var itemDefinition = this.state.modelToEdit.modelDefinition.name + 'Group';\n\n __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default.a.getInstance().then(function (d2) {\n return Promise.all([d2, d2.models[_this5.state.modelToEdit.modelDefinition.name].get(_this5.state.modelToEdit.id)]);\n }).then(function (_ref7) {\n var _ref8 = _slicedToArray(_ref7, 2),\n d2 = _ref8[0],\n fullModel = _ref8[1];\n\n _this5.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n _this5.setState({\n modelToEdit: fullModel\n });\n }).catch(function (message) {\n return __WEBPACK_IMPORTED_MODULE_2_loglevel___default.a.error(message);\n });\n }\n}));\n\n/***/ }),\n\n/***/ 3910:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_material_ui_TextField_TextField__ = __webpack_require__(58);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_material_ui_TextField_TextField___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_material_ui_TextField_TextField__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_loglevel__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_loglevel___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_loglevel__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2__ = __webpack_require__(18);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_d2_lib_d2__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ModelTypeSelector_component__ = __webpack_require__(3783);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_d2_ui_lib_store_Store__ = __webpack_require__(44);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ItemSelector_component__ = __webpack_require__(3782);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_d2_ui_lib_i18n_Translate_mixin__ = __webpack_require__(1308);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_d2_ui_lib_group_editor_GroupEditor_component__ = __webpack_require__(440);\nvar _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\"); } }; }();\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (__WEBPACK_IMPORTED_MODULE_0_react___default.a.createClass({\n displayName: 'ItemsInGroupManager.component',\n\n mixins: [__WEBPACK_IMPORTED_MODULE_7_d2_ui_lib_i18n_Translate_mixin__[\"a\" /* default */]],\n\n contextTypes: {\n d2: __WEBPACK_IMPORTED_MODULE_0_react___default.a.PropTypes.object\n },\n\n getInitialState: function getInitialState() {\n var itemStore = __WEBPACK_IMPORTED_MODULE_5_d2_ui_lib_store_Store__[\"a\" /* default */].create();\n var assignedItemStore = __WEBPACK_IMPORTED_MODULE_5_d2_ui_lib_store_Store__[\"a\" /* default */].create();\n var itemListStore = __WEBPACK_IMPORTED_MODULE_5_d2_ui_lib_store_Store__[\"a\" /* default */].create();\n\n itemStore.state = [];\n assignedItemStore.state = [];\n\n return {\n itemListStore: itemListStore,\n itemStore: itemStore,\n assignedItemStore: assignedItemStore,\n filterText: '',\n showGroupEditor: false\n };\n },\n renderGroupEditor: function renderGroupEditor() {\n if (!this.state.showGroupEditor) {\n return null;\n }\n\n return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n 'div',\n null,\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6__ItemSelector_component__[\"a\" /* default */], {\n value: this.state.modelToEdit || this.state.itemListStore.state[0],\n itemListStore: this.state.itemListStore,\n onItemSelected: this._workItemChanged\n }),\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_material_ui_TextField_TextField___default.a, {\n fullWidth: true,\n hintText: this.getTranslation('search_available_selected_items'),\n defaultValue: this.state.filterText,\n onChange: this._setFilterText\n }),\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_8_d2_ui_lib_group_editor_GroupEditor_component__[\"a\" /* default */], {\n itemStore: this.state.itemStore,\n assignedItemStore: this.state.assignedItemStore,\n onAssignItems: this._assignItems,\n onRemoveItems: this._removeItems,\n filterText: this.state.filterText\n })\n );\n },\n createUrls: function createUrls(items) {\n var _state = this.state,\n modelToEdit = _state.modelToEdit,\n itemDefinition = _state.itemDefinition;\n\n\n return items.map(function (id) {\n return modelToEdit.modelDefinition.plural + '/' + modelToEdit.id + '/' + itemDefinition + '/' + id;\n });\n },\n render: function render() {\n var d2 = this.context.d2;\n\n var accessibleGroups = ['indicatorGroup', 'dataElementGroup', 'categoryOptionGroup'].filter(function (groupName) {\n return d2.currentUser.canCreate(d2.models[groupName]);\n });\n\n var contentStyle = {\n padding: '2rem'\n };\n\n return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n 'div',\n { style: contentStyle },\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__ModelTypeSelector_component__[\"a\" /* default */], {\n nameListFilter: accessibleGroups,\n onChange: this._typeChanged\n }),\n this.renderGroupEditor()\n );\n },\n _assignItems: function _assignItems(items) {\n var _this = this;\n\n var requests = this.createUrls(items).map(function (url) {\n return __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default.a.getInstance().then(function (d2) {\n return d2.Api.getApi();\n }).then(function (api) {\n return api.post(url);\n });\n });\n\n return Promise.all(requests).then(function () {\n var itemDefinition = _this.state.modelToEdit.modelDefinition.name.replace('Group', '');\n\n return __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default.a.getInstance().then(function (d2) {\n return Promise.all([d2, d2.models[_this.state.modelToEdit.modelDefinition.name].get(_this.state.modelToEdit.id)]);\n }).then(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n d2 = _ref2[0],\n fullModel = _ref2[1];\n\n _this.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n _this.setState({\n modelToEdit: fullModel\n });\n }).catch(function (message) {\n return __WEBPACK_IMPORTED_MODULE_2_loglevel___default.a.error(message);\n });\n });\n },\n _removeItems: function _removeItems(items) {\n var _this2 = this;\n\n var requests = this.createUrls(items).map(function (url) {\n return __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default.a.getInstance().then(function (d2) {\n return d2.Api.getApi();\n }).then(function (api) {\n return api.delete(url);\n });\n });\n\n return Promise.all(requests).then(function () {\n var itemDefinition = _this2.state.modelToEdit.modelDefinition.name.replace('Group', '');\n\n return __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default.a.getInstance().then(function (d2) {\n return Promise.all([d2, d2.models[_this2.state.modelToEdit.modelDefinition.name].get(_this2.state.modelToEdit.id)]);\n }).then(function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n d2 = _ref4[0],\n fullModel = _ref4[1];\n\n _this2.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n _this2.setState({\n modelToEdit: fullModel\n });\n }).catch(function (message) {\n return __WEBPACK_IMPORTED_MODULE_2_loglevel___default.a.error(message);\n });\n });\n },\n _typeChanged: function _typeChanged(modelDef) {\n var _this3 = this;\n\n if (!modelDef) {\n return;\n }\n\n modelDef.list({ paging: false, fields: 'id,displayName,name' }).then(function (modelCollection) {\n return modelCollection.toArray();\n }).then(function (models) {\n return _this3.state.itemListStore.setState(models);\n }).then(function () {\n return _this3.setState({ showGroupEditor: true });\n }).catch(function (message) {\n return __WEBPACK_IMPORTED_MODULE_2_loglevel___default.a.error(message);\n });\n },\n _setFilterText: function _setFilterText(event) {\n this.setState({\n filterText: event.target.value\n });\n },\n _workItemChanged: function _workItemChanged(model) {\n var _this4 = this;\n\n var itemDefinition = model.modelDefinition.name.replace('Group', '');\n\n __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default.a.getInstance().then(function (d2) {\n if (!d2.models[itemDefinition]) {\n return Promise.reject('This groupType does not have a model named: ' + itemDefinition);\n }\n\n var availablePromise = d2.models[itemDefinition].list({ paging: false });\n var modelPromise = d2.models[model.modelDefinition.name].get(model.id);\n\n Promise.all([availablePromise, modelPromise]).then(function (_ref5) {\n var _ref6 = _slicedToArray(_ref5, 2),\n availableItems = _ref6[0],\n fullModel = _ref6[1];\n\n _this4.state.itemStore.setState(availableItems);\n _this4.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n _this4.setState({\n modelToEdit: fullModel,\n itemDefinition: d2.models[itemDefinition].plural\n });\n });\n }).catch(function (message) {\n return __WEBPACK_IMPORTED_MODULE_2_loglevel___default.a.error(message);\n });\n },\n reset: function reset() {\n var _this5 = this;\n\n if (!this.state.modelToEdit) {\n return;\n }\n\n var itemDefinition = this.state.modelToEdit.modelDefinition.name.replace('Group', '');\n\n __WEBPACK_IMPORTED_MODULE_3_d2_lib_d2___default.a.getInstance().then(function (d2) {\n return Promise.all([d2, d2.models[_this5.state.modelToEdit.modelDefinition.name].get(_this5.state.modelToEdit.id)]);\n }).then(function (_ref7) {\n var _ref8 = _slicedToArray(_ref7, 2),\n d2 = _ref8[0],\n fullModel = _ref8[1];\n\n _this5.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n _this5.setState({\n modelToEdit: fullModel\n });\n }).catch(function (message) {\n return __WEBPACK_IMPORTED_MODULE_2_loglevel___default.a.error(message);\n });\n }\n}));\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// 11-fd5ef347026a0fd2f506.js","import React from 'react';\n\nimport Tabs from 'material-ui/Tabs/Tabs';\nimport Tab from 'material-ui/Tabs/Tab';\nimport Paper from 'material-ui/Paper/Paper';\n\nimport ItemsInGroupManager from './ItemsInGroupManager.component';\nimport GroupsForItemManager from './GroupsForItemManager.component';\n\nexport default React.createClass({\n render() {\n return (\n <Paper>\n <Tabs onChange={this._tabChanged}>\n <Tab label=\"Manage items in group\">\n <ItemsInGroupManager ref=\"itemsForGroup\" />\n </Tab>\n <Tab label=\"Manage groups for item\">\n <GroupsForItemManager ref=\"groupsForItem\" />\n </Tab>\n </Tabs>\n </Paper>\n );\n },\n\n _tabChanged() {\n this.refs.itemsForGroup.reset();\n this.refs.groupsForItem.reset();\n },\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/GroupEditor/GroupEditor.component.js","import React from 'react';\n\nimport SelectField from 'material-ui/SelectField/SelectField';\nimport MenuItem from 'material-ui/MenuItem/MenuItem';\n\nexport default React.createClass({\n propTypes: {\n itemListStore: React.PropTypes.object.isRequired,\n onItemSelected: React.PropTypes.func.isRequired,\n },\n\n getInitialState() {\n return {\n items: [],\n };\n },\n\n componentWillMount() {\n this.subscription = this.props.itemListStore\n .map(modelList => modelList\n .map(model => ({\n text: model.displayName,\n payload: model.id,\n model,\n })))\n .subscribe((items) => {\n if (items.length) {\n this.props.onItemSelected(items[0].model);\n }\n\n this.setState({ items });\n });\n },\n\n componentWillUnmount() {\n if (this.subscription && this.subscription.unsubscribe) {\n this.subscription.unsubscribe();\n }\n },\n\n renderOptions() {\n return this.state.items\n .map((option, index) => <MenuItem key={index} primaryText={option.text} value={option.payload} />);\n },\n\n render() {\n return (\n <div>\n <SelectField onChange={this._onChange} value={this.props.value && this.props.value.id} fullWidth>{this.renderOptions()}</SelectField>\n </div>\n );\n },\n\n _onChange(event, index, value) {\n if (this.state.items && this.state.items[index]) {\n this.props.onItemSelected(this.state.items[index].model);\n }\n },\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/GroupEditor/ItemSelector.component.js","import React from 'react';\nimport SelectField from 'material-ui/SelectField/SelectField';\nimport MenuItem from 'material-ui/MenuItem/MenuItem';\nimport d2lib from 'd2/lib/d2';\nimport camelCaseToUnderscores from 'd2-utilizr/lib/camelCaseToUnderscores';\nimport Translate from 'd2-ui/lib/i18n/Translate.mixin';\n\nfunction hasNameInArray(listToCheck) {\n return function hasNameInArrayInner(value) {\n // If no list has been given the result is always true\n if (listToCheck.length === 0) {\n return true;\n }\n return listToCheck.indexOf(value.name) !== -1;\n };\n}\n\nexport default React.createClass({\n propTypes: {\n nameListFilter: React.PropTypes.arrayOf(React.PropTypes.string),\n onChange: React.PropTypes.func.isRequired,\n },\n\n mixins: [Translate],\n\n getDefaultProps() {\n return {\n nameListFilter: [],\n };\n },\n\n getInitialState() {\n return {\n selectedModel: null,\n };\n },\n\n componentWillMount() {\n d2lib.getInstance()\n .then(d2 => this.setState({ models: d2.models }));\n },\n\n _onChange(event, index, modelType) {\n this.setState({\n selectedModel: modelType,\n });\n\n this.props.onChange(modelType);\n },\n\n renderOptions() {\n if (this.state && this.state.models) {\n return this.state.models\n .mapThroughDefinitions(v => v)\n .filter(hasNameInArray(this.props.nameListFilter))\n .map(value => ({\n text: this.getTranslation(camelCaseToUnderscores(value.plural)),\n payload: value,\n }))\n .map((option, index) => (\n <MenuItem key={index} primaryText={option.text} value={option.payload} />\n ));\n }\n return [];\n },\n\n render() {\n return (\n <div>\n <SelectField\n value={this.state.selectedModel}\n hintText={this.getTranslation('select_an_object_type')}\n fullWidth\n {...this.props}\n onChange={this._onChange}\n >\n {this.renderOptions()}\n </SelectField>\n </div>\n );\n },\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/GroupEditor/ModelTypeSelector.component.js","import React from 'react';\n\nimport TextField from 'material-ui/TextField/TextField';\nimport log from 'loglevel';\n\nimport d2lib from 'd2/lib/d2';\nimport ModelTypeSelector from './ModelTypeSelector.component';\nimport Store from 'd2-ui/lib/store/Store';\nimport ItemSelector from './ItemSelector.component';\nimport Translate from 'd2-ui/lib/i18n/Translate.mixin';\nimport GroupEditor from 'd2-ui/lib/group-editor/GroupEditor.component';\n\nexport default React.createClass({\n mixins: [Translate],\n\n getInitialState() {\n const itemStore = Store.create();\n const assignedItemStore = Store.create();\n const itemListStore = Store.create();\n\n itemStore.state = [];\n assignedItemStore.state = [];\n\n return {\n itemListStore,\n itemStore,\n assignedItemStore,\n filterText: '',\n showGroupEditor: false,\n };\n },\n\n renderGroupEditor() {\n if (!this.state.showGroupEditor) {\n return [];\n }\n\n return (\n <div>\n <ItemSelector\n value={this.state.modelToEdit || this.state.itemListStore.state[0]}\n itemListStore={this.state.itemListStore}\n onItemSelected={this._workItemChanged}\n />\n <TextField\n fullWidth\n hintText={this.getTranslation('search_available_selected_items')}\n defaultValue={this.state.filterText}\n onChange={this._setFilterText}\n />\n <GroupEditor\n itemStore={this.state.itemStore}\n assignedItemStore={this.state.assignedItemStore}\n onAssignItems={this._assignItems}\n onRemoveItems={this._removeItems}\n filterText={this.state.filterText}\n />\n </div>\n );\n },\n\n render() {\n const contentStyle = {\n padding: '2rem',\n };\n\n const d2 = this.context.d2;\n const accessibleModels = ['indicator', 'dataElement', 'categoryOption']\n .filter(schemaName => d2.currentUser.canCreate(d2.models[`${schemaName}Group`]));\n\n return (\n <div style={contentStyle}>\n <ModelTypeSelector\n nameListFilter={accessibleModels}\n onChange={this._typeChanged}\n />\n {this.renderGroupEditor()}\n </div>\n );\n },\n\n createUrls(items) {\n const { modelToEdit, itemDefinition } = this.state;\n\n return items\n .map(id => `${modelToEdit.modelDefinition.plural}/${modelToEdit.id}/${itemDefinition}/${id}`);\n },\n\n _assignItems(items) {\n const requests = this.createUrls(items)\n .map(url => d2lib.getInstance()\n .then(d2 => d2.Api.getApi())\n .then(api => api.post(url)));\n\n return Promise.all(requests)\n .then(() => {\n const itemDefinition = `${this.state.modelToEdit.modelDefinition.name}Group`;\n\n return d2lib.getInstance()\n .then(d2 => Promise.all([d2, d2.models[this.state.modelToEdit.modelDefinition.name].get(this.state.modelToEdit.id)]))\n .then(([d2, fullModel]) => {\n this.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n this.setState({\n modelToEdit: fullModel,\n });\n });\n })\n .catch(message => log.error(message));\n },\n\n _removeItems(items) {\n const requests = this.createUrls(items)\n .map(url => d2lib.getInstance()\n .then(d2 => d2.Api.getApi())\n .then(api => api.delete(url)));\n\n return Promise.all(requests)\n .then(() => {\n const itemDefinition = `${this.state.modelToEdit.modelDefinition.name}Group`;\n\n return d2lib.getInstance()\n .then(d2 => Promise.all([d2, d2.models[this.state.modelToEdit.modelDefinition.name].get(this.state.modelToEdit.id)]))\n .then(([d2, fullModel]) => {\n this.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n this.setState({\n modelToEdit: fullModel,\n });\n });\n })\n .catch(message => log.error(message));\n },\n\n _typeChanged(modelDef) {\n modelDef.list({ paging: false, fields: 'id,displayName,name' })\n .then(modelCollection => modelCollection.toArray())\n .then(models => this.state.itemListStore.setState(models))\n .then(() => this.setState({ showGroupEditor: true }))\n .catch(message => log.error(message));\n },\n\n _setFilterText(event) {\n this.setState({\n filterText: event.target.value,\n });\n },\n\n _workItemChanged(model) {\n const itemDefinition = `${model.modelDefinition.name}Group`;\n\n d2lib.getInstance()\n .then((d2) => {\n if (!d2.models[itemDefinition]) {\n return Promise.reject(`This groupType does not have a model named: ${itemDefinition}`);\n }\n\n const availablePromise = d2.models[itemDefinition].list({ paging: false });\n const modelPromise = d2.models[model.modelDefinition.name].get(model.id);\n\n Promise.all([availablePromise, modelPromise])\n .then(([availableItems, fullModel]) => {\n this.state.itemStore.setState(availableItems);\n this.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n this.setState({\n modelToEdit: fullModel,\n itemDefinition: d2.models[itemDefinition].plural,\n });\n });\n })\n .catch(message => log.error(message));\n },\n\n reset() {\n if (!this.state.modelToEdit) { return; }\n\n const itemDefinition = `${this.state.modelToEdit.modelDefinition.name}Group`;\n\n d2lib.getInstance()\n .then(d2 => Promise.all([d2, d2.models[this.state.modelToEdit.modelDefinition.name].get(this.state.modelToEdit.id)]))\n .then(([d2, fullModel]) => {\n this.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n this.setState({\n modelToEdit: fullModel,\n });\n })\n .catch(message => log.error(message));\n },\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/GroupEditor/GroupsForItemManager.component.js","import React from 'react';\n\nimport TextField from 'material-ui/TextField/TextField';\nimport log from 'loglevel';\n\nimport d2lib from 'd2/lib/d2';\nimport ModelTypeSelector from './ModelTypeSelector.component';\nimport Store from 'd2-ui/lib/store/Store';\nimport ItemSelector from './ItemSelector.component';\nimport Translate from 'd2-ui/lib/i18n/Translate.mixin';\nimport GroupEditor from 'd2-ui/lib/group-editor/GroupEditor.component';\n\nexport default React.createClass({\n mixins: [Translate],\n\n contextTypes: {\n d2: React.PropTypes.object,\n },\n\n getInitialState() {\n const itemStore = Store.create();\n const assignedItemStore = Store.create();\n const itemListStore = Store.create();\n\n itemStore.state = [];\n assignedItemStore.state = [];\n\n return {\n itemListStore,\n itemStore,\n assignedItemStore,\n filterText: '',\n showGroupEditor: false,\n };\n },\n\n renderGroupEditor() {\n if (!this.state.showGroupEditor) {\n return null;\n }\n\n return (\n <div>\n <ItemSelector\n value={this.state.modelToEdit || this.state.itemListStore.state[0]}\n itemListStore={this.state.itemListStore}\n onItemSelected={this._workItemChanged}\n />\n <TextField\n fullWidth\n hintText={this.getTranslation('search_available_selected_items')}\n defaultValue={this.state.filterText}\n onChange={this._setFilterText}\n />\n <GroupEditor\n itemStore={this.state.itemStore}\n assignedItemStore={this.state.assignedItemStore}\n onAssignItems={this._assignItems}\n onRemoveItems={this._removeItems}\n filterText={this.state.filterText}\n />\n </div>\n );\n },\n\n createUrls(items) {\n const { modelToEdit, itemDefinition } = this.state;\n\n return items\n .map(id => `${modelToEdit.modelDefinition.plural}/${modelToEdit.id}/${itemDefinition}/${id}`);\n },\n\n render() {\n const d2 = this.context.d2;\n\n const accessibleGroups = ['indicatorGroup', 'dataElementGroup', 'categoryOptionGroup']\n .filter(groupName => d2.currentUser.canCreate(d2.models[groupName]));\n\n const contentStyle = {\n padding: '2rem',\n };\n\n return (\n <div style={contentStyle}>\n <ModelTypeSelector\n nameListFilter={accessibleGroups}\n onChange={this._typeChanged}\n />\n {this.renderGroupEditor()}\n </div>\n );\n },\n\n _assignItems(items) {\n const requests = this.createUrls(items)\n .map(url => d2lib\n .getInstance()\n .then(d2 => d2.Api.getApi())\n .then(api => api.post(url))\n );\n\n return Promise.all(requests)\n .then(() => {\n const itemDefinition = this.state.modelToEdit.modelDefinition.name.replace('Group', '');\n\n return d2lib.getInstance()\n .then(d2 => Promise.all([d2, d2.models[this.state.modelToEdit.modelDefinition.name].get(this.state.modelToEdit.id)]))\n .then(([d2, fullModel]) => {\n this.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n this.setState({\n modelToEdit: fullModel,\n });\n })\n .catch(message => log.error(message));\n });\n },\n\n _removeItems(items) {\n const requests = this.createUrls(items)\n .map(url => d2lib.getInstance()\n .then(d2 => d2.Api.getApi())\n .then(api => api.delete(url)));\n\n return Promise.all(requests)\n .then(() => {\n const itemDefinition = this.state.modelToEdit.modelDefinition.name.replace('Group', '');\n\n return d2lib.getInstance()\n .then(d2 => Promise.all([d2, d2.models[this.state.modelToEdit.modelDefinition.name].get(this.state.modelToEdit.id)]))\n .then(([d2, fullModel]) => {\n this.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n this.setState({\n modelToEdit: fullModel,\n });\n })\n .catch(message => log.error(message));\n });\n },\n\n _typeChanged(modelDef) {\n if (!modelDef) {\n return;\n }\n\n modelDef.list({ paging: false, fields: 'id,displayName,name' })\n .then(modelCollection => modelCollection.toArray())\n .then(models => this.state.itemListStore.setState(models))\n .then(() => this.setState({ showGroupEditor: true }))\n .catch(message => log.error(message));\n },\n\n _setFilterText(event) {\n this.setState({\n filterText: event.target.value,\n });\n },\n\n _workItemChanged(model) {\n const itemDefinition = model.modelDefinition.name.replace('Group', '');\n\n d2lib.getInstance()\n .then((d2) => {\n if (!d2.models[itemDefinition]) {\n return Promise.reject(`This groupType does not have a model named: ${itemDefinition}`);\n }\n\n const availablePromise = d2.models[itemDefinition].list({ paging: false });\n const modelPromise = d2.models[model.modelDefinition.name].get(model.id);\n\n Promise.all([availablePromise, modelPromise])\n .then(([availableItems, fullModel]) => {\n this.state.itemStore.setState(availableItems);\n this.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n this.setState({\n modelToEdit: fullModel,\n itemDefinition: d2.models[itemDefinition].plural,\n });\n });\n })\n .catch(message => log.error(message));\n },\n\n reset() {\n if (!this.state.modelToEdit) { return; }\n\n const itemDefinition = this.state.modelToEdit.modelDefinition.name.replace('Group', '');\n\n d2lib.getInstance()\n .then(d2 => Promise\n .all([d2, d2.models[this.state.modelToEdit.modelDefinition.name].get(this.state.modelToEdit.id)]))\n .then(([d2, fullModel]) => {\n this.state.assignedItemStore.setState(fullModel[d2.models[itemDefinition].plural]);\n this.setState({\n modelToEdit: fullModel,\n });\n })\n .catch(message => log.error(message));\n },\n});\n\n\n\n// WEBPACK FOOTER //\n// ./src/GroupEditor/ItemsInGroupManager.component.js"],"sourceRoot":""}