1afc3cede172109d701fc7c58e1adc85.json 13.8 KB
Newer Older
1
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\reportForm\\\\assign\\\\Assign.js\",\n    _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport \"./assign.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst Assign = () => {\n  _s();\n\n  const [appState, changeState] = useState({\n    activeObject: null,\n    personalSharedDirectoryObjects: [{\n      id: \"Personal projects\"\n    }, {\n      id: \"Shared projects\"\n    }],\n    personalProjectObjects: [{\n      id: \"MyApp\",\n      type: \"personal\"\n    }],\n    sharedProjectObjects: [{\n      id: \"ReactApp\",\n      type: \"shared\",\n      teams: {\n        name: \"Henriks Meme Machine\"\n      }\n    }, {\n      id: \"Very big ReactApp\",\n      type: \"shared\",\n      teams: {\n        name: \"Dream team\"\n      }\n    }]\n  });\n\n  const toggleActive = (directory, index) => {\n    if (directory[index] === appState.activeObject) {\n      changeState({ ...appState,\n        activeObject: null\n      });\n    } else {\n      changeState({ ...appState,\n        activeObject: directory[index]\n      });\n    }\n  };\n\n  const toggleActiveStyles = (directory, index) => {\n    if (directory[index] === appState.activeObject) {\n      return \"active\";\n    } else return \"inactive\";\n  };\n\n  const DirectoryItems = directory => {\n    return /*#__PURE__*/_jsxDEV(\"ul\", {\n      className: \"projectListDirectory\",\n      children: directory.map((elements, index) => /*#__PURE__*/_jsxDEV(\"li\", {\n        children: /*#__PURE__*/_jsxDEV(\"div\", {\n          className: toggleActiveStyles(directory, index),\n          onClick: () => {\n            toggleActive(directory, index);\n          },\n          children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n            icon: \"folder\",\n            className: \"folder-icon\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 34,\n            columnNumber: 15\n          }, this), /*#__PURE__*/_jsxDEV(\"a\", {\n            children: [\"\\xA0 \", directory[index].id, \" \\xA0\"]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 35,\n            columnNumber: 15\n          }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n            icon: \"chevron-right\",\n            className: \"arrow-right-icon\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 36,\n            columnNumber: 15\n          }, this)]\n        }, index, true, {\n          fileName: _jsxFileName,\n          lineNumber: 33,\n          columnNumber: 13\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 32,\n        columnNumber: 11\n      }, this))\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 30,\n      columnNumber: 7\n    }, this);\n  };\n\n  return /*#__PURE__*/_jsxDEV(\"div\", {\n    className: \"assignSelectContainer\",\n    children: /*#__PURE__*/_jsxDEV(\"ul\", {\n      className: \"rootDirectory\",\n      children: [/*#__PURE__*/_jsxDEV(\"li\", {\n        children: [/*#__PURE__*/_jsxDEV(\"div\", {\n          className: toggleActiveStyles(appState.personalSharedDirectoryObjects, 0),\n          onClick: () => {\n            toggleActive(appState.personalSharedDirectoryObjects, 0);\n          },\n          children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n            icon: \"folder\",\n            className: \"folder-icon\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 51,\n            columnNumber: 13\n          }, this), /*#__PURE__*/_jsxDEV(\"a\", {\n            children: [\"\\xA0 \", appState.personalSharedDirectoryObjects[0].id, \" \\xA0\"]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 52,\n            columnNumber: 13\n          }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n            icon: \"chevron-right\",\n            className: \"arrow-right-icon\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 53,\n            columnNumber: 13\n          }, this)]\n        }, 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 50,\n          columnNumber: 11\n        }, this), appState.personalSharedDirectoryObjects[0] === appState.activeObject ? DirectoryItems(appState.personalProjectObjects) : null]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 49,\n        columnNumber: 9\n      }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n        children: [/*#__PURE__*/_jsxDEV(\"div\", {\n          className: `directoryItemPersonalSharedSelect ${toggleActiveStyles(appState.personalSharedDirectoryObjects, 1)}`,\n          onClick: () => {\n            toggleActive(appState.personalSharedDirectoryObjects, 1);\n          },\n          children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n            icon: \"folder\",\n            className: \"folder-icon\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 64,\n            columnNumber: 13\n          }, this), /*#__PURE__*/_jsxDEV(\"a\", {\n            children: [\"\\xA0 \", appState.personalSharedDirectoryObjects[1].id, \" \\xA0\"]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 65,\n            columnNumber: 13\n          }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n            icon: \"chevron-right\",\n            className: \"arrow-right-icon\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 66,\n            columnNumber: 13\n          }, this)]\n        }, 1, true, {\n          fileName: _jsxFileName,\n          lineNumber: 63,\n          columnNumber: 11\n        }, this), appState.personalSharedDirectoryObjects[1] === appState.activeObject || appState.sharedProjectObjects.forEach(object => object === appState.activeObject) ? DirectoryItems(appState.sharedProjectObjects) : null]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 62,\n        columnNumber: 9\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 46,\n      columnNumber: 7\n    }, this)\n  }, void 0, false, {\n    fileName: _jsxFileName,\n    lineNumber: 45,\n    columnNumber: 5\n  }, this);\n};\n\n_s(Assign, \"z4Q8rkqxebzZe7unu0SZgSsWN8k=\");\n\n_c = Assign;\nexport default Assign;\n\nvar _c;\n\n$RefreshReg$(_c, \"Assign\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/reportForm/assign/Assign.js"],"names":["React","useState","FontAwesomeIcon","Assign","appState","changeState","activeObject","personalSharedDirectoryObjects","id","personalProjectObjects","type","sharedProjectObjects","teams","name","toggleActive","directory","index","toggleActiveStyles","DirectoryItems","map","elements","forEach","object"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM,CAACC,QAAD,EAAWC,WAAX,IAA0BJ,QAAQ,CAAC;AACvCK,IAAAA,YAAY,EAAE,IADyB;AAEvCC,IAAAA,8BAA8B,EAAE,CAAC;AAAEC,MAAAA,EAAE,EAAE;AAAN,KAAD,EAA8B;AAAEA,MAAAA,EAAE,EAAE;AAAN,KAA9B,CAFO;AAGvCC,IAAAA,sBAAsB,EAAE,CAAC;AAAED,MAAAA,EAAE,EAAE,OAAN;AAAeE,MAAAA,IAAI,EAAE;AAArB,KAAD,CAHe;AAIvCC,IAAAA,oBAAoB,EAAE,CAAC;AAAEH,MAAAA,EAAE,EAAE,UAAN;AAAkBE,MAAAA,IAAI,EAAE,QAAxB;AAAkCE,MAAAA,KAAK,EAAE;AAAEC,QAAAA,IAAI,EAAE;AAAR;AAAzC,KAAD,EAA8E;AAAEL,MAAAA,EAAE,EAAE,mBAAN;AAA2BE,MAAAA,IAAI,EAAE,QAAjC;AAA2CE,MAAAA,KAAK,EAAE;AAAEC,QAAAA,IAAI,EAAE;AAAR;AAAlD,KAA9E;AAJiB,GAAD,CAAxC;;AAOA,QAAMC,YAAY,GAAG,CAACC,SAAD,EAAYC,KAAZ,KAAsB;AACzC,QAAID,SAAS,CAACC,KAAD,CAAT,KAAqBZ,QAAQ,CAACE,YAAlC,EAAgD;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8BAAT,CAAwC,CAAxC,EAA2CC,EAAtD;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF,eAGE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC,eAAtB;AAAsC,YAAA,SAAS,EAAC;AAAhD;AAAA;AAAA;AAAA;AAAA,kBAHF;AAAA,WAAU,CAAV;AAAA;AAAA;AAAA;AAAA,gBADF,EAMGJ,QAAQ,CAACG,8BAAT,CAAwC,CAAxC,MAA+CH,QAAQ,CAACE,YAAxD,IAAwEF,QAAQ,CAACO,oBAAT,CAA8BU,OAA9B,CAAsCC,MAAM,IAAIA,MAAM,KAAKlB,QAAQ,CAACE,YAApE,CAAxE,GACCY,cAAc,CAACd,QAAQ,CAACO,oBAAV,CADf,GAEC,IARJ;AAAA;AAAA;AAAA;AAAA;AAAA,cAhBF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAiCD,CAxED;;GAAMR,M;;KAAAA,M;AA0EN,eAAeA,MAAf","sourcesContent":["import React, { useState } from 'react'\r\nimport \"./assign.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst Assign = () => {\r\n  const [appState, changeState] = useState({\r\n    activeObject: null,\r\n    personalSharedDirectoryObjects: [{ id: \"Personal projects\" }, { id: \"Shared projects\" }],\r\n    personalProjectObjects: [{ id: \"MyApp\", type: \"personal\" }],\r\n    sharedProjectObjects: [{ id: \"ReactApp\", type: \"shared\", teams: { name: \"Henriks Meme Machine\" } }, { id: \"Very big ReactApp\", type: \"shared\", teams: { name: \"Dream team\" } }]\r\n  })\r\n\r\n  const toggleActive = (directory, index) => {\r\n    if (directory[index] === appState.activeObject) {\r\n      changeState({ ...appState, activeObject: null })\r\n    }\r\n    else {\r\n      changeState({ ...appState, activeObject: directory[index] })\r\n    }\r\n  }\r\n\r\n  const toggleActiveStyles = (directory, index) => {\r\n    if (directory[index] === appState.activeObject) {\r\n      return \"active\"\r\n    } else return \"inactive\"\r\n  }\r\n\r\n  const DirectoryItems = (directory) => {\r\n    return (\r\n      <ul className=\"projectListDirectory\">\r\n        {directory.map((elements, index) => (\r\n          <li>\r\n            <div key={index} className={toggleActiveStyles(directory, index)} onClick={() => { toggleActive(directory, index) }} >\r\n              <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n              <a>&nbsp; {directory[index].id} &nbsp;</a>\r\n              <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n            </div>\r\n          </li>\r\n        ))}\r\n      </ul >\r\n    )\r\n  }\r\n\r\n  return (\r\n    <div className=\"assignSelectContainer\">\r\n      <ul className=\"rootDirectory\">\r\n\r\n        {/* Personal projects*/}\r\n        <li>\r\n          <div key={0} className={toggleActiveStyles(appState.personalSharedDirectoryObjects, 0)} onClick={() => { toggleActive(appState.personalSharedDirectoryObjects, 0) }} >\r\n            <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n            <a>&nbsp; {appState.personalSharedDirectoryObjects[0].id} &nbsp;</a>\r\n            <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n          </div>\r\n          {appState.personalSharedDirectoryObjects[0] === appState.activeObject ?\r\n            DirectoryItems(appState.personalProjectObjects) :\r\n            null\r\n          }\r\n        </li>\r\n\r\n        {/* Shared projects */}\r\n        <li>\r\n          <div key={1} className={`directoryItemPersonalSharedSelect ${toggleActiveStyles(appState.personalSharedDirectoryObjects, 1)}`} onClick={() => { toggleActive(appState.personalSharedDirectoryObjects, 1) }} >\r\n            <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n            <a>&nbsp; {appState.personalSharedDirectoryObjects[1].id} &nbsp;</a>\r\n            <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n          </div>\r\n          {appState.personalSharedDirectoryObjects[1] === appState.activeObject || appState.sharedProjectObjects.forEach(object => object === appState.activeObject) ?\r\n            DirectoryItems(appState.sharedProjectObjects) :\r\n            null\r\n          }\r\n        </li>\r\n\r\n      </ul>\r\n    </div >\r\n  )\r\n}\r\n\r\nexport default Assign"]},"metadata":{},"sourceType":"module"}