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

Improve URL Listing view #1397

Merged
merged 63 commits into from
Sep 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
0131c71
Start with listing view design improvements.
miina Aug 30, 2018
1e2dccf
Merge remote-tracking branch 'origin/develop' into 1362-improved_url_…
miina Sep 4, 2018
fd51be5
Add icons. Add tooltip skeleton. Fix sources.
miina Sep 4, 2018
8ab7166
Conform to validation error data model.
kienstra Sep 6, 2018
b31d123
Merge in develop, resolve conflict.
kienstra Sep 6, 2018
99a35b8
Update status names to latest design
kienstra Sep 6, 2018
e263b55
Use dashicons for tooltip icon
jacobschweitzer Sep 6, 2018
9e99f1a
Add admin-tables.css file
jacobschweitzer Sep 6, 2018
273cccf
Hide tooltip
jacobschweitzer Sep 6, 2018
df68ed8
Target class instead of id and add color to icon
jacobschweitzer Sep 6, 2018
54ae458
Change Plug-In to Plugin
jacobschweitzer Sep 6, 2018
4075cb0
Fix variable typo
jacobschweitzer Sep 6, 2018
9094366
Add plugin icon with color from design
jacobschweitzer Sep 6, 2018
604c4b9
Add theme icon with color
jacobschweitzer Sep 6, 2018
90b4920
Remove extra linebreaks
jacobschweitzer Sep 6, 2018
0be3a56
Add containers around sources for styling
jacobschweitzer Sep 6, 2018
1cb3da7
Add margins around sources containers
jacobschweitzer Sep 6, 2018
49ca0d8
Add color to WP icon
jacobschweitzer Sep 6, 2018
6d7f35b
Change wording - found to removed
jacobschweitzer Sep 6, 2018
f6a0878
Add icons to status column
jacobschweitzer Sep 6, 2018
c71addb
Add amp logo icon class
jacobschweitzer Sep 6, 2018
ca2e7d2
Add error-status class
jacobschweitzer Sep 6, 2018
36564fd
Style error statuses
jacobschweitzer Sep 6, 2018
736b2f2
Add closing span tag
jacobschweitzer Sep 6, 2018
7af56d6
Add color to removed elements column text
jacobschweitzer Sep 6, 2018
25ab2b3
Add class to warning icons for styling
jacobschweitzer Sep 6, 2018
139883e
Add color to identified and rejected icons
jacobschweitzer Sep 6, 2018
2583e44
Fix translation functions, switch to esc_html__
jacobschweitzer Sep 6, 2018
8649b91
Add plugins icon when there is multiple plugins
jacobschweitzer Sep 7, 2018
53021cc
Hide invalid sources if more than 1 and add icon
jacobschweitzer Sep 10, 2018
e87cca2
Only enqueue stylesheet on its post type screens
jacobschweitzer Sep 10, 2018
8aebc0c
Add common container class for sources
jacobschweitzer Sep 10, 2018
9ae7e58
Add JS for admin tables expand and collapse
jacobschweitzer Sep 10, 2018
ffb3fdc
Add margin after source container
jacobschweitzer Sep 10, 2018
ab73ddf
Merge branch 'develop' into 1362-improved_url_listing_view
jacobschweitzer Sep 10, 2018
4f14433
Remove todo
jacobschweitzer Sep 10, 2018
bda4140
Change wording: Removed to Invalid
jacobschweitzer Sep 10, 2018
c5ad3e6
Wrap in <code> and add brackets for attributes
jacobschweitzer Sep 10, 2018
4ea9638
Fix translation function reference
jacobschweitzer Sep 10, 2018
392ee24
Add double arrow to Sources column
jacobschweitzer Sep 10, 2018
163908e
Add hide all sources functionality and styles
jacobschweitzer Sep 10, 2018
0ad0cf6
Change new status icons based on AMP options
jacobschweitzer Sep 11, 2018
d4b586f
Combine duplicated post_row_actions filters; ensure only relevant lin…
westonruter Sep 11, 2018
1ab6bd3
Re-use AMP_Validation_Manager::is_sanitization_forcibly_accepted()
westonruter Sep 11, 2018
7eafdc6
Add view errors by type title link button
jacobschweitzer Sep 11, 2018
5b9b243
Change title of page and highlight word URL
jacobschweitzer Sep 11, 2018
52babee
Bolder font weight for page title action link keyword
jacobschweitzer Sep 11, 2018
8f88d0c
ESLint fixes
jacobschweitzer Sep 11, 2018
1d95cae
Fix PHP 5.3 compatibility issues
jacobschweitzer Sep 12, 2018
a4bdee9
Update tests to reflect changes
jacobschweitzer Sep 12, 2018
fe7e4de
Update to tests and add an error check
jacobschweitzer Sep 12, 2018
6936f05
Address unit test errors
kienstra Sep 13, 2018
4cbee48
Merge branch 'develop' into 1362-improved_url_listing_view
kienstra Sep 13, 2018
2ce2e5e
Addres PHPCS warning by aligning =
kienstra Sep 13, 2018
74feb85
Get full plugin names and fix theme source output
jacobschweitzer Sep 13, 2018
5baae3f
Code review changes and text changes
jacobschweitzer Sep 13, 2018
6911305
Unify JS for text expansion and update styles
jacobschweitzer Sep 14, 2018
56915da
Implement workaround to fix JS not loading issue
jacobschweitzer Sep 14, 2018
6488c05
Update unit tests based on latest changes
jacobschweitzer Sep 15, 2018
88e7b7e
Merge branch 'develop' into 1362-improved_url_listing_view
jacobschweitzer Sep 15, 2018
145a9ef
Fix test listing amp plugin
jacobschweitzer Sep 15, 2018
6624e68
Fix unit tests
jacobschweitzer Sep 15, 2018
716a869
Apply remaining changes from code review
westonruter Sep 16, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions assets/css/admin-tables.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.column-error_status .dashicons-editor-help {
color: #767676;
}
.column-sources_with_invalid_output .dashicons {
margin-right: 5px;
}
.column-sources_with_invalid_output .dashicons-admin-plugins {
color: #64a2e9;
}
.column-sources_with_invalid_output .dashicons-admin-appearance {
color: #ebb04f;
}
.column-sources_with_invalid_output .dashicons-wordpress-alt {
color: #92b371;
}
.amp-logo-icon {
background-image: url( '../images/amp-logo-icon.svg' );
background-color: transparent;
background-size: 20px 20px;
height: 20px;
width: 20px;
display: inline-block;
}
.column-error_status .error-status {
line-height: 20px;
display: inline-block;
position: relative;
vertical-align: top;
margin-left: 10px;
}
td.column-found_elements_and_attributes {
color: #c06e60;
}
.column-error_status .dashicons-flag.new {
color: #d98501;
}
.column-error_status .dashicons-yes.new {
color: #ff0000;
}
.column-error_status .dashicons-warning.rejected {
color: #68c6ff;
}
.column-sources_with_invalid_output .source {
margin-bottom: 10px;
}
.column-sources_with_invalid_output .source {
margin-bottom: 10px;
display: block;
}
.wrap .wp-heading-inline + .page-title-action {
margin-left: 1rem;
}
14 changes: 12 additions & 2 deletions assets/css/amp-validation-error-taxonomy.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,27 @@ details[open] .details-attributes__summary::after {
color: #00a0d2;
}

.column-sources_with_invalid_output details[open] .details-attributes__summary {
margin-bottom: 5px;
}
.column-sources_with_invalid_output details > div {
padding-left: 25px;
}

/* Error details toggle button */
.manage-column.column-details {
.manage-column.column-details, .manage-column.column-sources_with_invalid_output {
display: flex;
justify-content: space-between;
align-items: center;
}
.manage-column.column-sources_with_invalid_output .error-details-toggle {
margin: 0;
}

.error-details-toggle {
display: flex;
flex-direction: column;
height: 12px;
height: 14px;
margin-right: 10px;
padding: 0;
background: none;
Expand Down
10 changes: 10 additions & 0 deletions assets/images/amp-logo-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions assets/images/baseline-error-blue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions assets/images/baseline-error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/images/editor-help.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 24 additions & 3 deletions assets/src/amp-validation-error-detail-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import domReady from '@wordpress/dom-ready';
/**
* Localized data
*/
import { btnAriaLabel } from 'amp-validation-i18n';
import { btnAriaLabel, errorIndexLink, errorIndexAnchor } from 'amp-validation-i18n';

const OPEN_CLASS = 'is-open';

Expand All @@ -16,12 +16,19 @@ const OPEN_CLASS = 'is-open';
* table column via backend code.
*/
function addToggleButtons() {
[ ...document.querySelectorAll( 'th.column-details.manage-column' ) ].forEach( th => {
const addButtons = ( th ) => {
const button = document.createElement( 'button' );
button.setAttribute( 'aria-label', btnAriaLabel );
button.setAttribute( 'type', 'button' );
button.setAttribute( 'class', 'error-details-toggle' );
th.appendChild( button );
};

[ ...document.querySelectorAll( 'th.column-details.manage-column' ) ].forEach( th => {
addButtons( th );
} );
[ ...document.querySelectorAll( 'th.manage-column.column-sources_with_invalid_output' ) ].forEach( th => {
addButtons( th );
} );
}

Expand All @@ -31,7 +38,7 @@ function addToggleButtons() {
function addToggleListener() {
let open = false;

const details = [ ...document.querySelectorAll( '.column-details details' ) ];
const details = [ ...document.querySelectorAll( '.column-details details, .column-sources_with_invalid_output details' ) ];
const toggleButtons = [ ...document.querySelectorAll( 'button.error-details-toggle' ) ];
const onButtonClick = () => {
open = ! open;
Expand All @@ -54,7 +61,21 @@ function addToggleListener() {
} );
}

// @todo This should be harmonized with the approach in PHP via AMP_Validation_Error_Taxonomy::render_link_to_errors_by_url().
function addViewErrorsByTypeLinkButton() {
if ( 'undefined' === typeof errorIndexAnchor || 'undefined' === typeof errorIndexLink ) {
return;
}
const heading = document.querySelector( '.wp-heading-inline' );
const link = document.createElement( 'a' );
link.innerText = errorIndexAnchor;
link.setAttribute( 'href', errorIndexLink );
link.setAttribute( 'class', 'page-title-action' );
heading.after( link );
}

domReady( () => {
addToggleButtons();
addToggleListener();
addViewErrorsByTypeLinkButton();
} );
Loading