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 56 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
91 changes: 91 additions & 0 deletions assets/css/admin-tables.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
.column-error_status .tooltip {
display: none;
}
.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;
}
.sources-plugins, .sources-core {
margin-left: 25px;
margin-bottom: 15px;
}
.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 .sources-plugins.collapsed, .column-sources_with_invalid_output .sources-core.collapsed {
display: none;
}
.column-sources_with_invalid_output .source {
margin-bottom: 10px;
}
.column-sources_with_invalid_output .source {
margin-bottom: 10px;
display: block;
}
.dashicons.toggle-sources {
cursor: pointer;
float: right;
margin-right: 20%;
}
.column-sources_with_invalid_output .double-arrow {
height: 20px;
width: 12px;
display: inline-block;
position: relative;
float: right;
margin-right: 23%;
cursor: pointer;
}
.column-sources_with_invalid_output .double-arrow .dashicons.top-arrow {
font-size: 20px;
line-height: 1;
position: absolute;
bottom: 0;
}
.column-sources_with_invalid_output .double-arrow .dashicons.bottom-arrow {
font-size: 20px;
line-height: 1;
position: absolute;
bottom: -6px;
}
.wrap .wp-heading-inline + .page-title-action {
margin-left: 1rem;
}
.page-title-action strong {
font-weight: 900;
}
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.
40 changes: 40 additions & 0 deletions assets/js/amp-admin-tables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* global jQuery, ampAdminTables */
( function( $ ) {
'use strict';

var adminTables = {
Copy link
Member

Choose a reason for hiding this comment

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

Some of the code here might be duplicated with https://github.com/Automattic/amp-wp/blob/develop/assets/src/amp-validation-error-detail-toggle.js

Can we unify them?

Copy link
Contributor

Choose a reason for hiding this comment

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

@westonruter I started working on this but realized a dependency of the script you mentioned is wp-dom-ready which is a part of Gutenberg. So this script doesn't load for me since on my test site Gutenberg is not activated. Are we assuming that everyone will have Gutenberg as well or why is this a dependency? Or did I miss something in the build process?

Copy link
Contributor

@kienstra kienstra Sep 14, 2018

Choose a reason for hiding this comment

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

Hi @westonruter and @jacobschweitzer,
Do you think we should add dom-ready to package.json, like how i18n is included there:

  "@wordpress/dom-ready": "^2.0.0",
  "@wordpress/i18n": "^1.1.0",

Still, npm run dev seemed to build amp-validation-error-detail-toggle.js fine in my local, and that script ran without error on the 'AMP Validation Error Index' page.

Copy link
Contributor

Choose a reason for hiding this comment

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

@kienstra I've added that line to package.json and ran npm run build / npm run dev but the script still won't load on the Error Index page. Am I missing something here? I did have to install webpack and wp-cli but I have those now so I'm not sure if there is another dependency I'm missing since there aren't any errors in the build process now.


load: function() {
$( document ).ready( $.proxy( function() {
this.sourcesHideShow();
this.allSourcesHideShow();
this.addViewErrorsByTypeLinkButton();
}, this ) );
},

sourcesHideShow: function() {
$( 'span.dashicons.toggle-sources' ).on( 'click', function() {
$( this ).next( '.sources-container' ).toggleClass( 'collapsed' );
$( this ).toggleClass( 'dashicons-arrow-down dashicons-arrow-up' );
} );
},

allSourcesHideShow: function() {
$( '.double-arrow' ).on( 'click', function() {
$( '.double-arrow' ).find( '.dashicons' ).toggleClass( 'dashicons-arrow-down dashicons-arrow-up' );
$( 'span.dashicons.toggle-sources' ).toggleClass( 'dashicons-arrow-down dashicons-arrow-up' );
$( '.sources-container' ).toggleClass( 'collapsed' );
} );
},

addViewErrorsByTypeLinkButton: function() {
var link = $( '<a></a>' );
link.prop( 'text', ampAdminTables.errorIndexAnchor );
link.prop( 'href', ampAdminTables.errorIndexLink );
link.prop( 'class', 'page-title-action' );
$( '.wp-heading-inline' ).after( link );
}
};

adminTables.load();
}( jQuery ) );
Loading