Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW: Advanced jobs admin UI. #307

Conversation

mfendeksilverstripe
Copy link
Contributor

@mfendeksilverstripe mfendeksilverstripe commented Jun 9, 2020

Advanced jobs admin UI

Optional advanced UI for jobs admin. Needs to be enabled via configuration API.

Problem

Finding specific jobs in the Jobs admin is a chore, developers often find themselves scrolling through multiple pages. Finding the right jobs is sometimes impossible as the filter criteria input is quite limited. Using Text fields for input is often tedious.

Solution

Improved UI. More filters, better input fields, more useful information in the columns.

job-admin

Notes

Related issues

#308

@mfendeksilverstripe mfendeksilverstripe force-pushed the feature/jobs-admin-ui branch 5 times, most recently from 44c4e28 to b6fea5d Compare June 10, 2020 20:50
@sachajudd
Copy link

@silverstripeux

Copy link
Collaborator

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look great, you'll need to rebase/retarget this to 4 since it contains new API

/**
* @return string
*/
public function getImplementationSummary()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of the word 'summary' is a little weird, perhaps rename it to getTrimmedImplementation() or similar?. I'd also add example to show that its trimming off the front of the namespace

README.md Outdated
@@ -819,6 +819,17 @@ As a consequence, the work might end up being very fragmented and each chunk may

Some projects do not mind this however, so this solution may still be quite suitable.

## Jobs admin UI
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Jobs admin UI
## Enabling advanced admin UI

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about 'Enabling extended admin UI' instead of 'Advanced'? Even though this is the readme, we try to avoid advanced wording coupled in UI contexts where possible.

src/Controllers/QueuedJobsAdmin.php Outdated Show resolved Hide resolved
Copy link

@Cheddam Cheddam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also comb through and add translation calls for all the new language strings?

@mfendeksilverstripe mfendeksilverstripe force-pushed the feature/jobs-admin-ui branch 2 times, most recently from db8636c to e5a655c Compare August 31, 2020 02:21
@mfendeksilverstripe mfendeksilverstripe changed the base branch from 4.5 to 4 August 31, 2020 02:21
@mfendeksilverstripe
Copy link
Contributor Author

@emteknetnz @Cheddam Rebased on 4, pushed up new changes, please review.

@emteknetnz
Copy link
Collaborator

@mfendeksilverstripe I tried testing this locally though it didn't seem to activate the filterable headers. I added the yml and installed the suggested module and ran /dev/build?flush

It's possible that it's related to merge conflicts after merging #314 - could you rebase this and see if it fixes things up?

@mfendeksilverstripe
Copy link
Contributor Author

@emteknetnz I rebased the branch. Also, I tested it on my local and it seems to be working fine. Have you enabled the UI on your local? It's disabled by default so you need to add following config to your YAML:

Symbiote\QueuedJobs\Controllers\QueuedJobsAdmin:
  advanced_admin_ui: true

@emteknetnz
Copy link
Collaborator

@mfendeksilverstripe yeah I've required silverstripe-terraformers/gridfield-rich-filter-header though it does not appear to make any difference on at the top-level view /admin/queuedjobs/

I have included the following config and run /dev/build?flush

Symbiote\QueuedJobs\Controllers\QueuedJobsAdmin:
  advanced_admin_ui: true

Also looks like you'll need to do another rebase (sorry) after I merged another one of your queuedjob prs

@mfendeksilverstripe
Copy link
Contributor Author

mfendeksilverstripe commented Sep 24, 2020

@emteknetnz I have rebased the branch and tested this feature on a vanilla install. It seems to be working fine. Here is my project config

Screen Shot 2020-09-25 at 8 48 28 AM

Note that I replaced the queued jobs module folder with this branch manually.

I recommend checking the version of the rich filter header module and also the following setting:

Screen Shot 2020-09-25 at 8 48 43 AM

This setting should be automatically set by the rich filter header module.

@madmatt
Copy link
Collaborator

madmatt commented Oct 7, 2021

^ @emteknetnz Did you happen to get anywhere with this? Looks like a great addition and I'd be keen to see it merged in (noting there's a new conflict already heh)

@mfendeksilverstripe
Copy link
Contributor Author

@madmatt I've rebased the branch so it should be easy to merge in now.

@emteknetnz
Copy link
Collaborator

@mfendeksilverstripe I must be missing something? I've included this PR, silverstripe-terraformers/gridfield-rich-filter-header:^2 and yml config in my project and run dev/build flush - the queued jobs ui still looks exactly the same? I've run it through xdebug and it's going all the way through enableAdvancedAdminUi()

Here's mysite.yml + composer.json

---
Name: myproject
---
SilverStripe\Core\Manifest\ModuleManifest:
  project: app

# UTF8MB4 has limited support in older MySQL versions.
# Remove this configuration if you experience issues.
---
Name: myproject-database
---
SilverStripe\ORM\Connect\MySQLDatabase:
  connection_charset: utf8mb4
  connection_collation: utf8mb4_unicode_ci
  charset: utf8mb4
  collation: utf8mb4_unicode_ci


Symbiote\QueuedJobs\Controllers\QueuedJobsAdmin:
  advanced_admin_ui: true
{
    "name": "silverstripe/installer",
    "type": "silverstripe-recipe",
    "description": "The SilverStripe Framework Installer",
    "require": {
        "php": "^7.1 || ^8",
        "silverstripe/recipe-plugin": "^1.2",
        "silverstripe/recipe-cms": "4.x-dev",
        "silverstripe-themes/simple": "~3.2.0",
        "silverstripe/login-forms": "4.x-dev",
        "symbiote/silverstripe-queuedjobs": "dev-feature/jobs-admin-ui as 4.x-dev",
        "silverstripe/recipe-content-blocks": "2.x-dev",
        "silverstripe/graphql": "^3@dev",
        "symfony/yaml": "^3",
        "silverstripe-terraformers/gridfield-rich-filter-header": "^2"
    },
    "require-dev": {
        "sminnee/phpunit": "^5.7",
        "sminnee/phpunit-mock-objects": "^3.4.5",
        "silverstripe/recipe-testing": "^1"
    },
    "extra": {
        "project-files": [
            "app/_config/*",
            ".env.example"
        ],
        "public-files": [
            "assets/*",
            "favicon.ico"
        ],
        "resources-dir": "_resources",
        "project-files-installed": [
            "app/.htaccess",
            "app/_config.php",
            "app/_config/contentblocks.yml",
            "app/_config/mimevalidator.yml",
            "app/_config/mysite.yml",
            "app/src/BlocksPage.php",
            "app/src/Page.php",
            "app/src/PageController.php",
            "behat.yml",
            "phpcs.xml.dist",
            "phpunit.xml.dist"
        ],
        "public-files-installed": [
            ".htaccess",
            "index.php",
            "web.config"
        ]
    },
    "config": {
        "process-timeout": 600,
        "platform": {
            "php": "7.2"
        }
    },
    "prefer-stable": true,
    "minimum-stability": "dev",
    "repositories": {
        "x1": {
            "type": "vcs",
            "url": "[email protected]:silverstripe-terraformers/silverstripe-queuedjobs.git"
        }
    }
}

@mfendeksilverstripe
Copy link
Contributor Author

mfendeksilverstripe commented Oct 18, 2021

Hey @emteknetnz here is a step by step guide which I used to test this feature on a vanilla install. Hopefully, this helps :)

1 - composer create-project silverstripe/installer vanilla ^4
2 - add .env and vagrant files
3 - vagrant up
4 - composer install
5 - dev/build with flush
6 - add fork to the composer file

"repositories": {
    "silverstripe/queuedjobs": {
        "type": "git",
        "url": "https://github.com/silverstripe-terraformers/silverstripe-queuedjobs.git"
    }
},

7 - composer require symbiote/silverstripe-queuedjobs
8 - change the queued jobs module in your composer JSON to point to the fork:

"symbiote/silverstripe-queuedjobs": "dev-feature/jobs-admin-ui as 4.x-dev",

9 - composer update symbiote/silverstripe-queuedjobs
10 - composer require silverstripe-terraformers/gridfield-rich-filter-header
11 - Enable the advanced UI via static configuration

Symbiote\QueuedJobs\Controllers\QueuedJobsAdmin:
  advanced_admin_ui: true

12 - dev/build with flush

This is what I see when I navigate to the Queued jobs admin:

Screen Shot 2021-10-18 at 2 02 33 PM

cc: @madmatt

@emteknetnz
Copy link
Collaborator

emteknetnz commented Oct 18, 2021

Nope I'm still not seeing it. The steps you've given are basically the same as the sample composer.json and mysite.yml I provided above. I've also tried ^2 and dev-master of silverstripe-terraformers/gridfield-rich-filter-header though it made no difference

Is there some extra config missing in either your .env file of vagrantfile?

@mfendeksilverstripe
Copy link
Contributor Author

@emteknetnz I don't think my env file is related to this but here it is just for reference:

SS_ENVIRONMENT_TYPE="dev"

SS_DATABASE_CLASS="MySQLDatabase"
SS_DEFAULT_ADMIN_USERNAME="admin"
SS_DEFAULT_ADMIN_PASSWORD="password"
SS_DATABASE_SERVER="localhost"
SS_DATABASE_USERNAME="root"
SS_DATABASE_PASSWORD="root"
SS_DATABASE_NAME="SS_vanilla"

SS_DATABASE_TIMEZONE="+00:00"
SS_BASE_URL="http://vanilla.local/"
SS_SEND_ALL_EMAILS_TO=""

I don't have anything out of ordinary in the vagrant file either. I'll try to add a unit test which would validate that the UI is loading properly.

@mfendeksilverstripe mfendeksilverstripe force-pushed the feature/jobs-admin-ui branch 2 times, most recently from 35db45a to 4b7af85 Compare October 19, 2021 03:44
@mfendeksilverstripe
Copy link
Contributor Author

Hey @emteknetnz I've added unit tests to showcase that the new UI is working as expected. I recommend running the test suite on your local setup and see if it passes.

Copy link
Collaborator

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, looking again at this with fresh eyes I'm really not sure that we should be essentially baking an third party optional module into queuedjobs. I feel like things should be implemented in a bit more of an "extendable" fashion.

Most core maintainers won't have merge access on the terraformers account. It seems like if we're going to integrate this module to this degree we'd probably need everything on the Silverstripe account. However that goes against the idea that functionality like this would be better maintained outside of the core team

It also seems like you could simply use the existing $this->extend('updateEditForm', $form); hook within the terraformers module to to do everything you need to ... does this seem correct?

I'm happy with linking to the module within docs. Not so sure about suggest in composer.json, does that still work in composer 2?

@mfendeksilverstripe
Copy link
Contributor Author

Thanks for clarification, I'll close this PR then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants