1a66cc69805e931bb48bc36a61682476.json 11.3 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    activeObjects: [],\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.activeObjects) {\n      changeState({ ...appState,\n        activeObjects: null\n      });\n    } else {\n      changeState({ ...appState,\n        activeObjects: directory[index]\n      });\n    }\n  };\n\n  const toggleActiveStyles = (directory, index) => {\n    if (directory[index] === appState.activeObjects) {\n      return \"active\";\n    } else return \"inactive\";\n  };\n\n  const RootDirectoryItems = directory => {\n    return /*#__PURE__*/_jsxDEV(\"ul\", {\n      className: \"rootDirectory\",\n      children: directory.map((elements, index) => /*#__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: 34,\n            columnNumber: 15\n          }, this), /*#__PURE__*/_jsxDEV(\"a\", {\n            children: [\"\\xA0 \", appState.personalSharedDirectoryObjects[0].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        }, 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 33,\n          columnNumber: 13\n        }, this), directory[0] === appState.activeObjects ? SubDirectoryItems(directory) : null]\n      }, void 0, true, {\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  const SubDirectoryItems = 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: 55,\n            columnNumber: 15\n          }, this), /*#__PURE__*/_jsxDEV(\"a\", {\n            children: [\"\\xA0 \", directory[index].id, \" \\xA0\"]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 56,\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: 57,\n            columnNumber: 15\n          }, this)]\n        }, index, true, {\n          fileName: _jsxFileName,\n          lineNumber: 54,\n          columnNumber: 13\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 53,\n        columnNumber: 11\n      }, this))\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 51,\n      columnNumber: 7\n    }, this);\n  };\n\n  return /*#__PURE__*/_jsxDEV(\"div\", {\n    className: \"assignSelectContainer\",\n    children: [RootDirectoryItems(appState.personalProjectObjects), RootDirectoryItems(appState.sharedProjectObjects)]\n  }, void 0, true, {\n    fileName: _jsxFileName,\n    lineNumber: 66,\n    columnNumber: 5\n  }, this);\n};\n\n_s(Assign, \"jWdx8XXHroi6UjgxtPTs5wUOW6U=\");\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","activeObjects","personalSharedDirectoryObjects","id","personalProjectObjects","type","sharedProjectObjects","teams","name","toggleActive","directory","index","toggleActiveStyles","RootDirectoryItems","map","elements","SubDirectoryItems"],"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,aAAa,EAAE,EADwB;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,oB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hD;AAAA;AAAA;AAAA;AAAA,kBAHF;AAAA,WAAUQ,KAAV;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cADD;AADH;AAAA;AAAA;AAAA;AAAA,YADF;AAaD,GAdD;;AAgBA,sBACE;AAAK,IAAA,SAAS,EAAC,uBAAf;AAAA,eACGE,kBAAkB,CAACd,QAAQ,CAACK,sBAAV,CADrB,EAEGS,kBAAkB,CAACd,QAAQ,CAACO,oBAAV,CAFrB;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAMD,CAlED;;GAAMR,M;;KAAAA,M;AAoEN,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    activeObjects: [],\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.activeObjects) {\r\n      changeState({ ...appState, activeObjects: null })\r\n    }\r\n    else {\r\n      changeState({ ...appState, activeObjects: (directory[index]) })\r\n    }\r\n  }\r\n\r\n  const toggleActiveStyles = (directory, index) => {\r\n    if (directory[index] === appState.activeObjects) {\r\n      return \"active\"\r\n    } else return \"inactive\"\r\n  }\r\n\r\n  const RootDirectoryItems = (directory) => {\r\n    return (\r\n      <ul className=\"rootDirectory\">\r\n        {directory.map((elements, index) => (\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            {\r\n              directory[0] === appState.activeObjects ?\r\n                SubDirectoryItems(directory) :\r\n                null\r\n            }\r\n          </li>\r\n        ))}\r\n      </ul>\r\n    )\r\n  }\r\n\r\n  const SubDirectoryItems = (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      {RootDirectoryItems(appState.personalProjectObjects)}\r\n      {RootDirectoryItems(appState.sharedProjectObjects)}\r\n    </div >\r\n  )\r\n}\r\n\r\nexport default Assign"]},"metadata":{},"sourceType":"module"}