worknenjoy / gitpay

Bounties for issues on demand. Be rewarded by learning, using Git workflow and continuous integration
http://gitpay.me
Other
180 stars 160 forks source link

Allow user to sort issue #1013 #1074

Closed Precious-Macaulay closed 4 months ago

Precious-Macaulay commented 4 months ago

Pull Request Template

Closes #1013

Description

Sorting Functionality:

Code Structure and Readability:

Purpose

The purpose of this pull request is to enhance the task table component by introducing sorting functionality for better organization and dynamic sorting based on user preferences. Additionally, the code structure has been refactored to improve readability and maintainability.

Solution

The solution involves implementing sorting capabilities for each column in the task table, allowing users to efficiently organize and find tasks. Dynamic sorting is introduced, along with code refactoring to enhance code readability and maintainability. Metadata for table headers is now utilized to improve code organization.

Screenshots

711315c6-10b8-4ea0-82de-cbeda3b1f3f4.webm

711315c6-10b8-4ea0-82de-cbeda3b1f3f4.webm

Checklist

Related Issues

Closes #1013

Additional Notes

Precious-Macaulay commented 4 months ago

Codacy Static Code Analysis failure is due to destructuring of which is part of the initial code style

Precious-Macaulay commented 4 months ago

@oleksandr-shvets Please review my latest commit

alexanmtz commented 4 months ago

Hey @Precious-Macaulay , thanks for reviewing the solution; it seems to work in most cases now.

Just one thing I would like to request to have it fully working and with a good experience is to provide a way to reset the filters, so when you click the first time, it sorts up, then it sorts down, and In the third option it should reset, it would be possible to do it so we can have the original order again.

oleksandr-shvets commented 4 months ago

You cat try to create pmd.xml file in project root to Exclude UnnecessaryBlock rule

<?xml version="1.0"?>
<ruleset name="Custom Rules" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0
                            http://pmd.sourceforge.net/ruleset_2_0_0.xsd">

    <!-- Exclude UnnecessaryBlock rule for JavaScript -->
    <rule ref="category/ecmascript/codestyle.xml" />
        <exclude name="UnnecessaryBlock" />
    </rule>

</ruleset>

If still got errors:

  1. Go to your Codacy dashboard.
  2. Select your repository.
  3. Go to the "Settings" tab.
  4. Scroll down to the "Analysis configuration" section.
  5. Upload pmd.xml file.
Precious-Macaulay commented 4 months ago

Hey @Precious-Macaulay , thanks for reviewing the solution; it seems to work in most cases now.

Just one thing I would like to request to have it fully working and with a good experience is to provide a way to reset the filters, so when you click the first time, it sorts up, then it sorts down, and In the third option it should reset, it would be possible to do it so we can have the original order again.

Alright i get what you mean i will work on that now

Precious-Macaulay commented 4 months ago

i merged the improved table to my existing sorting code

alexanmtz commented 4 months ago

@Precious-Macaulay there's an error for me when I checked out your branch, please verify your debug console when open the table.

Precious-Macaulay commented 4 months ago

Yes my branch started lagging behind in commits and there was a merge conflict based on the improved table commit i could not push the fixed code.

Precious-Macaulay commented 4 months ago

i will be closing this pull request due to merge issue and i will create a new pull request with all sorting funtionality implemented