From e74445e81ebe7cb01f3f9c84f7f334377c368331 Mon Sep 17 00:00:00 2001 From: PabloWolf96 Date: Fri, 3 Sep 2021 17:50:54 +0100 Subject: [PATCH 1/4] get github user --- server/package.json | 1 + server/src/controllers/github.js | 15 +++++++++++++++ server/src/routes/github.js | 9 +++++++++ server/src/routes/index.js | 2 ++ server/yarn.lock | 2 +- 5 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 server/src/controllers/github.js create mode 100644 server/src/routes/github.js diff --git a/server/package.json b/server/package.json index 0b9c10cc..076a28a4 100644 --- a/server/package.json +++ b/server/package.json @@ -13,6 +13,7 @@ "author": "", "license": "ISC", "dependencies": { + "axios": "^0.21.1", "compression": "^1.7.3", "cors": "^2.8.5", "dotenv": "^10.0.0", diff --git a/server/src/controllers/github.js b/server/src/controllers/github.js new file mode 100644 index 00000000..974c19e9 --- /dev/null +++ b/server/src/controllers/github.js @@ -0,0 +1,15 @@ +const axios = require("axios"); + +class GithubController { + async getUser(req, res) { + try { + const { user } = req.params; + const resp = await axios.get(`https://api.github.com/users/${user}`); + res.status(200).json(resp.data); + } catch (error) { + res.status(400).json(error); + } + } +} + +module.exports = new PluginInfoController(); diff --git a/server/src/routes/github.js b/server/src/routes/github.js new file mode 100644 index 00000000..76e84ee6 --- /dev/null +++ b/server/src/routes/github.js @@ -0,0 +1,9 @@ +const githubRouter = require("express").Router(); + +const githubController = require("../controllers/github"); + +module.exports = function () { + githubRouter.get("/github/:user", githubController.getUser); + + return githubRouter; +}; diff --git a/server/src/routes/index.js b/server/src/routes/index.js index 22b31bb2..7805f926 100644 --- a/server/src/routes/index.js +++ b/server/src/routes/index.js @@ -1,12 +1,14 @@ const router = require("express").Router(); const pluginInfoRouter = require("./plugin-info"); const sideBarRouter = require("./sidebar"); +const githubRouter = require("./github"); const giphy = require("./giphy"); module.exports = () => { router.use(pluginInfoRouter()); router.use(sideBarRouter()); router.use(giphy()); + router.use(githubRouter()); // Handle Invalid API routes router.use((req, res, next) => { diff --git a/server/yarn.lock b/server/yarn.lock index 0604fe7b..71e7c7eb 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -355,7 +355,7 @@ async@^3.1.0, async@~3.2.0: resolved "https://registry.yarnpkg.com/async/-/async-3.2.1.tgz#d3274ec66d107a47476a4c49136aacdb00665fc8" integrity sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg== -axios@^0.21.0: +axios@^0.21.0, axios@^0.21.1: version "0.21.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== From f099cdce3cc00e2a1ed869b50f8a8f7b6723a2aa Mon Sep 17 00:00:00 2001 From: PabloWolf96 Date: Fri, 3 Sep 2021 17:53:55 +0100 Subject: [PATCH 2/4] github controller bug fix --- server/src/controllers/github.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/controllers/github.js b/server/src/controllers/github.js index 974c19e9..3711bdd9 100644 --- a/server/src/controllers/github.js +++ b/server/src/controllers/github.js @@ -12,4 +12,4 @@ class GithubController { } } -module.exports = new PluginInfoController(); +module.exports = new GithubController(); From 2023da951eaacd1bcf019166f3b5b7b8ae169c9a Mon Sep 17 00:00:00 2001 From: PabloWolf96 Date: Fri, 3 Sep 2021 19:09:23 +0100 Subject: [PATCH 3/4] resolve conflicts --- client/src/components/Apps/Figma/Figma.js | 136 +++++----- .../src/components/Apps/Figma/css/Figma.css | 136 +++++----- .../Apps/Github/containers/GithubHome.js | 246 +++++++++--------- .../src/components/MainPage/installedcard.js | 208 +++++++-------- 4 files changed, 363 insertions(+), 363 deletions(-) diff --git a/client/src/components/Apps/Figma/Figma.js b/client/src/components/Apps/Figma/Figma.js index c81c7a15..1a616e2b 100644 --- a/client/src/components/Apps/Figma/Figma.js +++ b/client/src/components/Apps/Figma/Figma.js @@ -1,68 +1,68 @@ -import React, { Component } from "react"; -import "./../../searchbar.component"; -import SearchBar from "./../../searchbar.component"; -import FigmaAbout from "./about-secttion/FigmaAbout"; -import FigmaMessages from "./messages-section/FigmaMessages"; -import logo from "./images/fignaLogo.png"; -import "./css/Figma.css"; -// import ToolsHeader from "../../toolsheader/toolsheader"; - -const initialState = { - page: "about", -}; -class Figma extends Component { - constructor() { - super(); - this.state = initialState; - } - - render() { - const localHostUrl = - "https://www.figma.com/oauth?client_id=V2IvPlEApDfBT9uNS5Rbrf&redirect_uri=http://localhost:3000/figma/authenticate/&scope=file_read&state=state&response_type=code"; - const deployedUrl = - "https://www.figma.com/oauth?client_id=V2IvPlEApDfBT9uNS5Rbrf&redirect_uri=http://externaltools.zuri.chat/figma/authenticate/&scope=file_read&state=state&response_type=code"; - - return ( - <> - {/* */} - -
-
- -
-

Figma

-
^
-
- -
-

{ - this.setState({ page: "messages" }); - }} - className={this.state.page === "about" ? "" : "selected"} - > - Messages -

-

{ - this.setState({ page: "about" }); - }} - className={this.state.page === "about" ? "selected" : ""} - > - About -

-
- {this.state.page === "about" ? : } - - ); - } -} - -export default Figma; +import React, { Component } from "react"; +import "./../../searchbar.component"; +import SearchBar from "./../../searchbar.component"; +import FigmaAbout from "./about-secttion/FigmaAbout"; +import FigmaMessages from "./messages-section/FigmaMessages"; +import logo from "./images/fignaLogo.png"; +import "./css/Figma.css"; +// import ToolsHeader from "../../toolsheader/toolsheader"; + +const initialState = { + page: "about", +}; +class Figma extends Component { + constructor() { + super(); + this.state = initialState; + } + + render() { + const localHostUrl = + "https://www.figma.com/oauth?client_id=V2IvPlEApDfBT9uNS5Rbrf&redirect_uri=http://localhost:3000/figma/authenticate/&scope=file_read&state=state&response_type=code"; + const deployedUrl = + "https://www.figma.com/oauth?client_id=V2IvPlEApDfBT9uNS5Rbrf&redirect_uri=http://externaltools.zuri.chat/figma/authenticate/&scope=file_read&state=state&response_type=code"; + + return ( + <> + {/* */} + +
+
+ +
+

Figma

+
^
+
+ +
+

{ + this.setState({ page: "messages" }); + }} + className={this.state.page === "about" ? "" : "selected"} + > + Messages +

+

{ + this.setState({ page: "about" }); + }} + className={this.state.page === "about" ? "selected" : ""} + > + About +

+
+ {this.state.page === "about" ? : } + + ); + } +} + +export default Figma; diff --git a/client/src/components/Apps/Figma/css/Figma.css b/client/src/components/Apps/Figma/css/Figma.css index 34021eec..a04d5960 100644 --- a/client/src/components/Apps/Figma/css/Figma.css +++ b/client/src/components/Apps/Figma/css/Figma.css @@ -1,69 +1,69 @@ -@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400&display=swap'); - -*{ - font-family: 'Lato', sans-serif; - -} -.Start-title { - display: flex; - padding: 20px 0 20px 20px; - justify-content: flex-start; - align-items: center; - position :relative; -} - -.Start-title h4 { - font-size: 25px; - margin-left: 5px; - font-weight: 700; -} - -.Start-title .arrow-down { - transform: rotate(180deg) translateX(-5px); - font-size: 15px; -} - -.figmalogo-container { - width: 44px; - -} - -.figmalogo-container img { - border-radius: 8px; -} - -.welcome-nav { - display: flex; - justify-content: flex-start; - align-items: center; - height: auto; - width: 100%; - border-top: .7px solid #cfcfcf; - border-bottom: .7px solid #cfcfcf; - padding-left: 20px; -} -.welcome-nav h4 { - padding: 10px; - font-size: 14px; - font-weight: 700; - cursor: pointer; -} - -.selected { - border-bottom: 1px solid #0ACF83; -} - -.welcome-nav h4:hover { - border-bottom: 1px solid #0ACF83; -} - -.fig-connect-btn { - position: absolute; - top: 95px; - left: 180px; - -} - -.fig-connect-btn a { - background-color: #0ACF83 ; +@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400&display=swap'); + +*{ + font-family: 'Lato', sans-serif; + +} +.Start-title { + display: flex; + padding: 20px 0 20px 20px; + justify-content: flex-start; + align-items: center; + position :relative; +} + +.Start-title h4 { + font-size: 25px; + margin-left: 5px; + font-weight: 700; +} + +.Start-title .arrow-down { + transform: rotate(180deg) translateX(-5px); + font-size: 15px; +} + +.figmalogo-container { + width: 44px; + +} + +.figmalogo-container img { + border-radius: 8px; +} + +.welcome-nav { + display: flex; + justify-content: flex-start; + align-items: center; + height: auto; + width: 100%; + border-top: .7px solid #cfcfcf; + border-bottom: .7px solid #cfcfcf; + padding-left: 20px; +} +.welcome-nav h4 { + padding: 10px; + font-size: 14px; + font-weight: 700; + cursor: pointer; +} + +.selected { + border-bottom: 1px solid #0ACF83; +} + +.welcome-nav h4:hover { + border-bottom: 1px solid #0ACF83; +} + +.fig-connect-btn { + position: absolute; + top: 95px; + left: 180px; + +} + +.fig-connect-btn a { + background-color: #0ACF83 ; } \ No newline at end of file diff --git a/client/src/components/Apps/Github/containers/GithubHome.js b/client/src/components/Apps/Github/containers/GithubHome.js index f546dd32..8467708d 100644 --- a/client/src/components/Apps/Github/containers/GithubHome.js +++ b/client/src/components/Apps/Github/containers/GithubHome.js @@ -1,123 +1,123 @@ -import React from "react"; -import { Link } from "react-router-dom"; -import { Link } from "react-router-dom"; -import { IoChevronBackOutline } from "react-icons/io5"; -import Image from "../assets/ZV_64LdGoao.jpg"; -import GithubLogo from "../assets/Rectangle 693.jpg"; -import "../style/GithubHome.css"; -const GithubHome = () => { - return ( -
- {/*
-

- Tool Directory -

- - - Back home - -
*/} -
-
-
-
- github logo -
-
- - -
-
-
-
-

- - Supported Languages - - English -

-

- Pricing - - Currently Free - -

-

- Categories -

    -
  • Productivity
  • -
  • Communication
  • -
  • Developer Tools
  • -
-

-
-
-
-

Github

-
- -
-
-

- Bring your code to the conversations you care about -

-
- repository -
-
-
-

- Stay up to date about what’s happening on github without - leaving Zuri by connecting GitHub and Zuri app. -

-

- With Github on Zuri, you can stay updated on: -

    -
  • New commits
  • -
  • New pull requests
  • -
  • New commits
  • -
  • Code reviews
  • -
-

-
-
-
-
-
-
- ); -}; - -export default GithubHome; +import React from "react"; +import { Link } from "react-router-dom"; +import { Link } from "react-router-dom"; +import { IoChevronBackOutline } from "react-icons/io5"; +import Image from "../assets/ZV_64LdGoao.jpg"; +import GithubLogo from "../assets/Rectangle 693.jpg"; +import "../style/GithubHome.css"; +const GithubHome = () => { + return ( +
+ {/*
+

+ Tool Directory +

+ + + Back home + +
*/} +
+
+
+
+ github logo +
+
+ + +
+
+
+
+

+ + Supported Languages + + English +

+

+ Pricing + + Currently Free + +

+

+ Categories +

    +
  • Productivity
  • +
  • Communication
  • +
  • Developer Tools
  • +
+

+
+
+
+

Github

+
+ +
+
+

+ Bring your code to the conversations you care about +

+
+ repository +
+
+
+

+ Stay up to date about what’s happening on github without + leaving Zuri by connecting GitHub and Zuri app. +

+

+ With Github on Zuri, you can stay updated on: +

    +
  • New commits
  • +
  • New pull requests
  • +
  • New commits
  • +
  • Code reviews
  • +
+

+
+
+
+
+
+
+ ); +}; + +export default GithubHome; diff --git a/client/src/components/MainPage/installedcard.js b/client/src/components/MainPage/installedcard.js index 90f09459..9a43bff3 100644 --- a/client/src/components/MainPage/installedcard.js +++ b/client/src/components/MainPage/installedcard.js @@ -1,104 +1,104 @@ -import React, { useState } from "react"; -// import ModalComponent from "../Modal/Modal"; -// import Modal from "react-bootstrap/Modal"; -import { useHistory, Link } from "react-router-dom"; - -const InstallToolsCard = ({ name, image, description, linkName }) => { - const [modalShowContent, setModalShowContent] = useState(false); - // console.log(linkName); - function MyVerticallyCenteredModal(props) { - return ( - - {/* - - Modal heading - - */} - -
-
-
-
ToolDescription
-
- -
-
- - -
-
-
- Supported Language -
-
English
-
-
-
Pricing
-
Currently Free
-
-
-
-
{props.name}
-
- -
-
- Google Drive lets you store files securely online, access them - from anywhere, and collaborate with others. Add the Google - Drive app to create Google Docs, import any type of file from - Google Drive, and get notifications on new comments, files, - and access requests — all without leaving your conversations - in Slack. -
-
-
-
-
- {/* - - */} -
- ); - } - - const history = useHistory(); - - const handleClick = () => { - history.push(`/${linkName}`); - }; - return ( -
- -
-
-
- -
-
-
{name}
-
{description}
-
-
-
- - {/* setModalShowContent(false)} - name={name} - image={image} - /> */} -
- ); -}; - -export default InstallToolsCard; +import React, { useState } from "react"; +// import ModalComponent from "../Modal/Modal"; +// import Modal from "react-bootstrap/Modal"; +import { useHistory, Link } from "react-router-dom"; + +const InstallToolsCard = ({ name, image, description, linkName }) => { + const [modalShowContent, setModalShowContent] = useState(false); + // console.log(linkName); + function MyVerticallyCenteredModal(props) { + return ( + + {/* + + Modal heading + + */} + +
+
+
+
ToolDescription
+
+ +
+
+ + +
+
+
+ Supported Language +
+
English
+
+
+
Pricing
+
Currently Free
+
+
+
+
{props.name}
+
+ +
+
+ Google Drive lets you store files securely online, access them + from anywhere, and collaborate with others. Add the Google + Drive app to create Google Docs, import any type of file from + Google Drive, and get notifications on new comments, files, + and access requests — all without leaving your conversations + in Slack. +
+
+
+
+
+ {/* + + */} +
+ ); + } + + const history = useHistory(); + + const handleClick = () => { + history.push(`/${linkName}`); + }; + return ( +
+ +
+
+
+ +
+
+
{name}
+
{description}
+
+
+
+ + {/* setModalShowContent(false)} + name={name} + image={image} + /> */} +
+ ); +}; + +export default InstallToolsCard; From 479aefebad459078ae3b3f93a6f0fc84824ca33a Mon Sep 17 00:00:00 2001 From: PabloWolf96 Date: Fri, 3 Sep 2021 19:12:18 +0100 Subject: [PATCH 4/4] resolve conflicts in yarn --- server/yarn.lock | 9 --------- 1 file changed, 9 deletions(-) diff --git a/server/yarn.lock b/server/yarn.lock index daf356e2..5cdfa016 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -675,16 +675,7 @@ async@^3.1.0, async@~3.2.0: resolved "https://registry.yarnpkg.com/async/-/async-3.2.1.tgz#d3274ec66d107a47476a4c49136aacdb00665fc8" integrity sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg== -<<<<<<< HEAD axios@^0.21.0, axios@^0.21.1: -======= -axe-core@^4.0.2: - version "4.3.3" - resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.3.3.tgz#b55cd8e8ddf659fe89b064680e1c6a4dceab0325" - integrity sha512-/lqqLAmuIPi79WYfRpy2i8z+x+vxU3zX2uAm0gs1q52qTuKwolOj1P8XbufpXcsydrpKx2yGn2wzAnxCMV86QA== - -axios@^0.21.0: ->>>>>>> 32423cfb69d2238af2d70fde23b950060807d52f version "0.21.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==