#55 Functional SourceLink Component
Closed 2 years ago by lbrabec. Opened 3 years ago by queeniva.
fedora-qa/ queeniva/landingpage functionalSourceLink  into  master

file modified
+23 -2
@@ -25,15 +25,36 @@ 

  

  * Try Fedora QA Dashboard yourself, clone the repo, browse the code, try to do a small change and see the results. If you want to start contributing to this project, look for issues tagged "easyfix".

  

+ 

+ ### How to generate your public SSH Key, because you will need it before you can do a pull request

+ 

+ * Before generating your key, you should check to make sure you dont already have your ssh key

+ 

+ * You can easily check to see if you already have the key by going to the directory and listing it

+ 

+     $ cd ~/.ssh

+     $ ls

+     authorized_keys2  id_dsa       known_hosts

+     config            id_dsa.pub

+ 

+ * Open your shell/terminal and type in the command

+ 

+     $ ssh-keygen -o

+ 

+ * Visit (https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key) for more information on SSH Keys.

+ 

  ### How to do pull requests

  

  * create an account on Pagure, don't forget to add your public ssh key to Pagure (click on your avatar > My settings > SSH Keys > Add SSH key)

  

  * fork this repository (upper right corner)

  

- * clone your forked repo using SSH option

+ * clone your forked repo using SSH option by running the command below

+ ```

+ $ git clone <SSH link you copied from the upper right corner of your forked repo>

+ ```

  

- * add our repo as upstream remote

+ * add our repo as upstream remote by running the command below

  ```

  $ git remote add upstream https://pagure.io/fedora-qa/landingpage.git

  ```

file modified
+1 -1
@@ -14,7 +14,7 @@ 

          <div>

            <h1 className="padded">

              Fedora {this.props.release} blockers and FEs{" "}

-             <SourceLink href="https://qa.fedoraproject.org/blockerbugs/" />

+             <SourceLink href="https://qa.fedoraproject.org/blockerbugs/" className="smallsuper" icon />

            </h1>

            <Row>

              <div className="col-md-6">

file modified
+2 -4
@@ -32,7 +32,7 @@ 

        <div>

          <h1 className="padded">

            Meetings and testdays in the next 7 days{" "}

-           <SourceLink href="https://apps.fedoraproject.org/calendar/QA/" />

+           <SourceLink href="https://apps.fedoraproject.org/calendar/QA/" className="smallsuper" icon />

          </h1>

          <ul className="events">{meetings}</ul>

        </div>
@@ -46,9 +46,7 @@ 

        <li key={this.props.start + this.props.summary}>

          <b>{this.props.start}</b>

          <br />

-         <a target="_blank" rel="noopener noreferrer" href={this.props.link}>

-           {this.props.summary}

-         </a>

+           <SourceLink href={this.props.link} linkName={this.props.summary}/>

          <br />

        </li>

      )

file modified
+6 -5
@@ -1,5 +1,6 @@ 

  import React, { Component } from "react"

  import _ from "lodash"

+ import SourceLink from "./SourceLink"

  

  class Hideable extends Component {

    constructor(props) {
@@ -22,13 +23,13 @@ 

              : ""

          }>

          {this.props.children}

-         <a

-           href="#"

+         <SourceLink

+           href='#'

            className={this.props.config_mode ? "d-block text-center badge badge-primary" : "d-none"}

            onClick={(e) => this.props.toggle_handler(e, this.props.component_name)}

-           role="button">

-           {this.props.is_enabled ? "Disable" : "Enable"}

-         </a>

+           linkName = {this.props.is_enabled ? "Disable" : "Enable"}

+           role="button"

+         />

        </div>

      )

    }

@@ -14,6 +14,7 @@ 

  import { loadData } from "../actions/reduxActions"

  

  import Cookies from "universal-cookie"

+ import SourceLink from "./SourceLink"

  

  class LandingPage extends Component {

    constructor(props) {
@@ -113,6 +114,7 @@ 

                    ? "Save changes"

                    : "Configure visibility of the info-cards"}

                </a>

+ 

              </div>

            </Row>

            <Row className="padded">

file modified
+4 -9
@@ -1,4 +1,5 @@ 

  import React, { Component } from "react"

+ import SourceLink from "./SourceLink"

  

  class Events extends Component {

    render() {
@@ -6,17 +7,11 @@ 

        <div>

          <h1 className="padded">Fedora QA Meeting Minutes</h1>

          <div className="events">

-           <a target="_blank" href={this.props.data.link} rel="noopener noreferrer">

-             Latest minutes from {this.props.data.date}

-           </a>

+           <SourceLink href={this.props.data.link} linkName={`Latest minutes from ${this.props.data.date}`} />

            <br />

            Visit{" "}

-           <a

-             target="_blank"

-             href="https://meetbot.fedoraproject.org/sresults/?group_id=fedora-qa&type=team"

-             rel="noopener noreferrer">

-             meetbot

-           </a>{" "}

+          

+           <SourceLink href="https://meetbot.fedoraproject.org/sresults/?group_id=fedora-qa&type=tea" linkName="meetbot"/>{" "}

            to see older.

            <br />

          </div>

file modified
+19 -13
@@ -1,17 +1,23 @@ 

- import React, {Component} from 'react'

  

- class SourceLink extends Component {

-     render() {

-         return (

-             <a

-                 target="_blank"

-                 rel="noopener noreferrer"

-                 href={this.props.href}

-                 className="smallsuper">

-                 <i className="fas fa-external-link-alt"></i>

-             </a>

-         )

-     }

+ import React from 'react'

+ 

+ const SourceLink = ({ href, className, linkName, onClick, role, icon }) => {

+ 

+     return (

+         <a

+             target="_blank"

+             rel="noopener noreferrer"

+             href={href}

+             className={className}

+             onClick={onClick}

+             role={role}

+         >

+             {icon && <i className="fas fa-external-link-alt" />}

+             

+             {linkName}

+         </a>

+ 

+     )

  }

  

  export default SourceLink

file modified
+1 -1
@@ -50,7 +50,7 @@ 

        <div>

          <h1 className="padded">

            Current development schedule{" "}

-           <SourceLink href="https://fedorapeople.org/groups/schedule/" />

+           <SourceLink href="https://fedorapeople.org/groups/schedule/"  className="smallsuper" icon />

          </h1>

          <div className="table-responsive">

            <table className="timeline">

file modified
+2 -1
@@ -1,11 +1,12 @@ 

  import React, { Component } from "react"

+ import SourceLink from "../landingpage/SourceLink"

  

  class Footer extends Component {

    render() {

      return (

        <div className="footer">

          <div className="container">

-           <a href="https://pagure.io/fedora-qa/landingpage">Source</a> on Pagure{" "}

+            <SourceLink href="https://pagure.io/fedora-qa/landingpage" linkName="Source"/>on Pagure{" "}

            <span className="float-right">version 0.1.0</span>

          </div>

        </div>

file modified
+2 -3
@@ -1,4 +1,5 @@ 

  import React, { Component } from "react"

+ import SourceLink from "../landingpage/SourceLink"

  import { CollapsableCard } from "./components"

  

  export default class Easyfix extends Component {
@@ -76,9 +77,7 @@ 

    render() {

      const items = this.props.data.map((action) => (

        <li key={action.extra_data.ticket_url}>

-         <a href={action.extra_data.ticket_url} target="_blank" rel="noopener noreferrer">

-           {action.name}

-         </a>

+         <SourceLink href={action.extra_data.ticket_url} linkName={action.name} />

        </li>

      ))

  

file modified
+8 -15
@@ -1,4 +1,5 @@ 

  import React, { Component } from "react"

+ import SourceLink from "../landingpage/SourceLink"

  import { CollapsableBadge } from "./components"

  

  export default class FedoraEasyKarmaItemsList extends Component {
@@ -12,9 +13,9 @@ 

            needs to be tested and proved functional.{" "}

            <CollapsableBadge expand_text="Tell me more about the process!">

              The updates are kept in{" "}

-             <a target="_blank" rel="noopener noreferrer" href="https://bodhi.fedoraproject.org/">

-               Bodhi

-             </a>

+             

+            <SourceLink  href="https://bodhi.fedoraproject.org/" linkName="Bohdi"/>

+ 

              , which acts as a gatekeeper between new package releases and the stable repositories.{" "}

              Users (or automated systems) can then provide feedback in form of positive/negative

              Karma, marking the update as working (or not) within the scope of their expectations.{" "}
@@ -29,12 +30,8 @@ 

                  <ul>

                    <li>

                      Visit{" "}

-                     <a

-                       target="_blank"

-                       rel="noopener noreferrer"

-                       href="https://admin.fedoraproject.org/accounts/user/new">

-                       FAS Sign-up page

-                     </a>{" "}

+                   

+                     <SourceLink href="https://admin.fedoraproject.org/accounts/user/new"  linkName="FAS Sign-up page"/>{" "}

                      and create it.

                    </li>

                    <li>Note the username and password, you will need it later on.</li>
@@ -101,12 +98,8 @@ 

                        far as you can tell), or <code>-1</code> to mark the package as broken.{" "}

                        <br />

                        Not sure you can judge the package's state? Have a look at the{" "}

-                       <a

-                         target="_blank"

-                         href="https://fedoraproject.org/wiki/QA:Update_feedback_guidelines"

-                         rel="noopener noreferrer">

-                         Update Feedback Guidelines

-                       </a>

+                      

+                       <SourceLink className="smallsuper" href="https://fedoraproject.org/wiki/QA:Update_feedback_guidelines" linkName="Update Feedback Guidelines" />

                        <br />

                        Still not sure? Just press <code>Enter</code> to skip it.

                      </li>

@@ -1,5 +1,6 @@ 

  import React, { Component } from "react"

  import { Modal, ModalHeader, ModalBody, ModalFooter } from "reactstrap"

+ import SourceLink from "../landingpage/SourceLink"

  import { CollapsableCard, CollapsableBadge } from "./components"

  

  export default class FedoraManualTesting extends Component {
@@ -91,12 +92,8 @@ 

              environments like EC2 or Openstack, you can also perform them locally using Testcloud.

              <br />

              Have a look at the{" "}

-             <a

-               target="_blank"

-               rel="noopener noreferrer"

-               href="https://fedoraproject.org/wiki/Test_Results:Fedora_Current_Cloud#Cloud_Provider_Setup">

-               Cloud provider setup

-             </a>{" "}

+             

+             <SourceLink href="https://fedoraproject.org/wiki/Test_Results:Fedora_Current_Cloud#Cloud_Provider_Setup" linkName="Cloud provider setup" />{" "}

              guides for more details.

            </div>

          )
@@ -164,9 +161,8 @@ 

          <ol className="steps">

            <li>

              Identify the testcase and `environment` in our{" "}

-             <a target="_blank" rel="noopener noreferrer" href={matrix_url}>

-               Tescase matrix

-             </a>{" "}

+            

+             <SourceLink href={matrix_url} linkName="Tescase matrix" />

              <CollapsableBadge expand_text="Not sure what that means?">

                <ul>

                  <li>
@@ -186,9 +182,8 @@ 

  

            <li>

              Read the{" "}

-             <a target="_blank" rel="noopener noreferrer" href={tc_url}>

-               Testcase

-             </a>{" "}

+            

+             <SourceLink href={tc_url} linkName="Testcase" />{" "}

              briefly, just to have a general idea of what you will be doing.{" "}

              <CollapsableBadge expand_text="Not making much sense?">

                The testcases are generally split into four sections:
@@ -215,12 +210,8 @@ 

  

            <li>

              Based on the enviromnent, select and download and appropriate ISO{" "}

-             <a

-               target="_blank"

-               rel="noopener noreferrer"

-               href="https://fedoraproject.org/wiki/Test_Results:Current_Installation_Test#How_to_test">

-               here

-             </a>

+             

+             <SourceLink href="https://fedoraproject.org/wiki/Test_Results:Current_Installation_Test#How_to_test" linkName="here" />

              .{" "}

              <CollapsableBadge expand_text="Not sure how?">

                <ul>
@@ -253,9 +244,8 @@ 

  

            <li>

              Study the{" "}

-             <a target="_blank" rel="noopener noreferrer" href={tc_url}>

-               Testcase

-             </a>{" "}

+             

+             <SourceLink href={tc_url} linkName="Testcase" />{" "}

              thoroughly, to be sure you know what to do.{" "}

              <CollapsableBadge expand_text="Feeling a bit lost?">

                <ul>
@@ -288,12 +278,8 @@ 

                    IRC channel #fedora-qa at freenode.net{" "}

                    <CollapsableBadge expand_text="Don&#39;t have an IRC client?">

                      If you are not that familiar with IRC, you can use the{" "}

-                     <a

-                       target="_blank"

-                       rel="noopener noreferrer"

-                       href="http://webchat.freenode.net">

-                       web-interface

-                     </a>{" "}

+                   

+                   <SourceLink href="http://webchat.freenode.net" linkName="web-interface"/>{" "}

                      just enter a Nickname of your choice, #fedora-qa (including the hash sign) in

                      the Channels field, and click Connect.

                    </CollapsableBadge>
@@ -307,9 +293,8 @@ 

              <CollapsableBadge expand_class="success" expand_text="Everything went well" type="btn">

                Great! Either use <code>relval report-results</code> on command line (make sure to

                install the <code>relval</code> package first), or modify the{" "}

-               <a target="_blank" rel="noopener noreferrer" href={matrix_url}>

-                 matrix

-               </a>{" "}

+               

+               <SourceLink href={matrix_url} linkName="matrix" />{" "}

                directly by clicking on the <code>Edit</code> link next to the Matrice's header, and

                put <code>&#123;&#123;result|pass|YOUR_NAME_HERE|&#125;&#125;</code> in the

                appropriate spot.
@@ -351,9 +336,8 @@ 

                Once you get the Bug reported, make sure to also submit the result into the testing

                matrix. Either use <code>relval report-results</code> on command line (make sure to

                install the <code>relval</code> package first), or modify the{" "}

-               <a target="_blank" rel="noopener noreferrer" href={matrix_url}>

-                 matrix

-               </a>{" "}

+               

+               <SourceLink  href={matrix_url} linkName="matrix"/>{" "}

                directly by clicking on the <code>Edit</code> link next to the Matrice's header, and

                put <code>&#123;&#123;result|fail|YOUR_NAME_HERE|BUG_NUMBER|&#125;&#125;</code> in

                the appropriate spot.
@@ -388,9 +372,12 @@ 

  

      return (

        <div>

-         <a href="#" onClick={(e) => this.toggle(e)}>

-           {this.props.buttonLabel}

-         </a>

+       

+         <sourceLink 

+           href="#"

+           linkName={this.props.buttonLabel}

+           onClick={(e) => this.toggle(e)}

+         />

          <Modal

            isOpen={this.state.modal}

            toggle={this.toggle}

file modified
+3 -1
@@ -7,6 +7,7 @@ 

  

  import { connect } from "react-redux"

  import { loadWizardData } from "../actions/reduxActions"

+ import SourceLink from "../landingpage/SourceLink"

  

  class Wizard extends Component {

    constructor(props) {
@@ -46,7 +47,8 @@ 

              <h1>Nothing sparked joy?</h1>

              <div>

                None of the above looks interesting to you? We'd be happy if you looked around at{" "}

-               <a href="https://whatcanidoforfedora.org/">https://whatcanidoforfedora.org/</a>!

+              

+               <SourceLink href="https://whatcanidoforfedora.org/" linkName="https://whatcanidoforfedora.org/" />!

              </div>

            </Container>

          </div>

file modified
+5
@@ -5190,6 +5190,11 @@ 

    resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"

    integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=

  

+ i18n-js@^3.8.0:

+   version "3.8.0"

+   resolved "https://registry.yarnpkg.com/i18n-js/-/i18n-js-3.8.0.tgz#b8fd6b12e1d88cb71f9806c29bca7c31c012e504"

+   integrity sha512-hDsGgPuvw/2P+lXSbOafAwspK8Ste8YrwuuUg17W3wEcO1JkQxBlPgsN1t2+852nTnz4YSYTjZc/1nAA2PC/nw==

+ 

  iconv-lite@0.4.24, iconv-lite@^0.4.24:

    version "0.4.24"

    resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"

Changed Source Link component from Class based to funtional and also added icon and onpress props, also changed all the anchor tags to use the SorceLink component .

also included in the readme how to generate your ssh KEY

Thanks for participating in contribution period of Outreachy. This pull-request has not been selected to be merged and will be closed for housecleaning purposes. We may revisit this pull-request later, but as of now we will focus on merging pull-requests from our accepted intern.

Pull-Request has been closed by lbrabec

2 years ago