GithubHelp home page GithubHelp logo

badwaterbay / labelcopier-frontend-v1 Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 3.0 2.48 MB

Web app (GitHub App) that copies labels and milestones from one repository to another

Home Page: https://badwaterbay.com/labelcopier

License: GNU General Public License v3.0

CSS 3.18% HTML 1.01% JavaScript 91.65% SCSS 4.16%
javascript github-api github-labels github-milestones github-oauth web-application

labelcopier-frontend-v1's People

Contributors

codefactor-io[bot] avatar dependabot-preview[bot] avatar dependabot[bot] avatar dongskyler avatar hayleylhui avatar tangaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dongskyler tangaw

labelcopier-frontend-v1's Issues

Feature request: Auto-fill hex code of color picker

Issue

Clicking to edit the color of a label opens a color picker.

github label manager colorpicker

Currently, to complete the process, you need to copy and paste the desired hex code onto the label.

Desired outcome

We would like for the selected hex code to auto-populate the label.

Enable commit button after copying/delete-then-copying

Details

  • Copy labels does not enable the Commit button
  • Copy milestones does not enable the Commit button
  • Delete all existing labels and copy does not enable Commit button on a repo that has no existing labels.
    Delete all existing milestones and copy does not enable Commit button on a repo that has no existing milestones.

Clean up text in html and js

Task:

  • Clean up text in html and js
  • Clean up confusing text
  • Fix typos and grammatical errors
  • Clean up variables and confusing wordings in App.js

Allow copying of ALL labels from all pages of another repo. Currently it will only copy the first page of labels (count: 28)

Summary

Within the Labels page under Issues of any GitHub repository, the current max display amount of individual labels is 28. Take these labels for instance. Notice how there are 41 labels in total but only 28 can fit in the first page.

This affects the label-manager web app in that if you are trying to copy all labels from another repo that has more than 28 labels -- by inputting username:repo, you are only able to copy the first page of 28 labels. For all subsequent pages, you'd need to concatenate the additional path onto the existing username:repo to copy all remaining labels.

Recreating the bug

  1. Open the web app. It should look like this:

github-label-manager-2

  1. Create a dummy repository.

  2. Point to your dummy repo under the Manage your GitHub labels section and click List labels in this repo. This will generate a list of current labels under your new dummy repo. Like so:

dummy repo

  1. Click on Copy an existing repo's labels. Using this repo, input Badwater-Apps:github-label-manager-2 within username:repo.

  2. Go ahead and click Copy. You should see the addition of quite a few labels that were copied from this repo. Like so:

copied GitHub labels

BUG => Keep in mind that the repo Badwater-Apps:github-label-manager-2 contains 41 labels, but if you do a quick tally, you'll find that the Copy button only managed to pull the first 28 labels that are displayed on the first page.

  1. In order to capture the labels on page 2, you'll need to concatenate the additional path /labels?page=2&sort=name-asc onto the existing one and re-copy. Like so:

page 2 labels

Expected result after fix

Step 5 should be able to copy all labels from all pages instead of only from the first page.

Bug: Unable to commit milestones that were copied from other repos

The bug is:

When you commit new milestones that were copied from other repos, it fails. The server returns a 422 status code (Unprocessable Entity).

The reasons are:

  • Milestones copied from other repos already have 'milestone number' assigned to them.
  • When creating a new milestone for a repo via POST http request via GitHub API, the new milestone cannot contain a 'milestone number' attribute.

Separate labels, milestones, and help sections using tab layout

Implementation (open to discussion)

Elements that should be placed into tabs:

  • Labels tab
    • All elements of current Labels card
    • Revert to original labels button
    • Delete all labels button
  • Milestones tab
    • All elements of current Milestones card
    • Revert to original milestones button
    • Delete all milestones button
  • Help tab
    • How this web app works? card
    • Is my personal access token safe? card

Link to Bootstrap navs page for reference

New feature: Sort labels/milestones

Add a feature to sort labels/milestones on the web app. This feature will be convenient and helpful.

Example sorting schemes

For labels:

  • alphabetically
  • reverse-alphabetically

For milestones:

  • alphabetically
  • reverse-alphabetically
  • furthest due dates
  • closest due dates

Tip: this doesn't have any effect on GitHub API calls, meaning you don't need to modify functions related to making API calls.

Remove pop-up alert of confirming "Really want to delete this?"

Issue

Currently, when you delete an existing label, the window pops up an alert asking you "Really want to delete this?"

Since we have the "restore" button and the "revert to original" button, we don't need this pop-up alert. It is unnecessary and intrusive and slows the workflow down.

Task

Remove all functionalities that involves this pop-up alert.

It starts on Line 230 in app.js:

confirm('Really want to delete this?\n\nNote that this action only removes the label from this list not from Github.')

Redesign UI

Redesign UI to today's taste.

This is up for discussion, to break it down to specific tasks.

Modernize color picker

Use a more modern approach for the color picker.

This will also address #35 Feature request: Auto-fill hex code of color picker.
Issue #35 was addressed by a separate PR.

Copying Labels from another Repo - Commit Button Disabled

Issue occurs when copying labels from another repo (Chrome & IE)

Commit Changes button remains disabled when the labels are copied from another repo - until another change to the label list is made.

Repro

View list of existing labels for your repo (click List labels in this repo)
Enter repo to copy labels from (click Copy an existing repo's labels (Optional) & enter repo info)
Click Copy
Label list updates, but Commit Changes button remains disabled
-- Workaround --
5. Click Add new label button
6. Delete the newly added label
7. Confirm the delete
8. Commit Changes button is now enabled & clicking it saves the updated list of labels

Adopted from destan/github-label-manager#9

Upgrade bootstrap.css to the latest version and make all necessary adjustments

The bootstrap.css the web app uses is severely out of date.

Upgrade bootstrap.css to the latest version and make all necessary adjustments (in index.html and associated files), because the latest version might use slightly different names of classes and variables.

Please test the code before submitting a PR:

  • Run the index.html locally
  • Use the web app to change labels in a dummy repo and see if it works
  • Don’t use your password for authentication. Use a token instead. The instructions are in the web app itself

Remove defined but unused variables from functions, as pointed out by CodeFactor bot

Issue

Take a look at the issues pointed out by CodeFactor.

Example issue

Issue: 'e' is defined but never used, found in js\app.js on line 352:

$('#copyFromRepoButton').click(function(e) {

Task

Remove all defined but unused variables that can be safely removed in terms of syntax and the code's functionality, as pointed out by CodeFactor.

Solution 1

The e can be omitted. This example code on line 352 can be written as:

$('#copyFromRepoButton').click(function() {

Solution 2

Another way is to use the arrow notation, if this keyword is not used in the function:

$('#copyFromRepoButton').click(() => {

If you don't understand when to use arrow notation or how this keyword works, please stick to Solution 1.

Test

Before submitting a pull request, please test the code and make sure it works. Please check the console for potential errors.

In "Which repo is in use?" Card, "username" is not fully functional

In "Which repo is in use?" Card, "username" is not fully functional.

Observed behavior

Currently, the username is identical as repo-owner.

I'm not 100% sure what the current behavior is, but I'm sure it is NOT functional in all scenarios.

Part of the task is to debug this erroneous behavior.

Expected behavior

The username is the username for login authentication, which may or may not be the same as the repo-owner.

Write a function/object to query API login info and call it before every API calls

Task

  • Write a function/object to query info for API calls at the top level
  • Call the function before every API calls
  • Use consistent variable names for these variables inside js/app.js to improve readability

Fields to query

  • target owner
  • target repo
  • username
  • personal access token
  • copy-from owner
  • copy-from repo

Some fields are allowed to be empty for some API calls, while some are not.

Upgrade JQuery from ver. 1.8.3 to the latest version (ver. 3.5.1) and make all necessary adjustments (in index.html, app.js, and all other associated files, if any)

The JQuery the web app uses is severely out of date. It uses JQuery 1.8.3, and the latest version is 3.5.1.

Task:

Upgrade jquery.js to the latest version (ver. 3.5.1) and make all necessary adjustments (in index.html, app.js, and all other associated files, if any), because the latest version might use slightly different names of variables and functions.

Please test the code before submitting a PR:

  • Run the index.html locally
  • Use the web app to change labels in a dummy repo and see if it works
  • Don’t use your password for authentication. Use a token instead. The instructions are in the web app itself

Remove unnecessary semicolons in js/app.js

Title: Remove unnecessary semicolons in javascript

Task

Remove semicolons in js/app.js on the following lines:

  • Line 133
  • Line 167

Then create a pull request (PR) for review

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.