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

Continuous testing #63

Merged
merged 46 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
2b0514e
tmp
domtra Mar 20, 2024
6debc8c
feat(alerts): replace resolve with archive
harunbleech Mar 21, 2024
9f142d1
feat(alerts): update messages about resolving alerts
harunbleech Mar 21, 2024
cdfd369
feat(test): use derived tables so we can filter by calculated status
harunbleech Mar 21, 2024
501074a
fix: linting
harunbleech Mar 21, 2024
4d80c69
refactor(tests): use dashes instead of underscores for status name
harunbleech Mar 21, 2024
d06d6eb
feat(test): no need to resume test as they are always running now
harunbleech Mar 21, 2024
dea6dc9
feat(tests): tests with alerts are still running so we remove the check
harunbleech Mar 21, 2024
74f7cfc
refactor(onboarding): rename animation and rearange config options
harunbleech Mar 21, 2024
68cde21
fest(test): resume_test generates new base screenshot so it's needed …
harunbleech Mar 24, 2024
c67aff9
feat(test): don't check for alerts on post update
harunbleech Mar 24, 2024
40fa12e
feat(alerts): remove alert from test only if the latest alert is bein…
harunbleech Mar 24, 2024
06455cc
feat(tests): show any related alert in tests table + show correct sna…
domtra Mar 27, 2024
78de54a
feat(posts): show simple status in gutenberg and classic editor
domtra Mar 27, 2024
d566d0a
fix(tests): filter items count
harunbleech Apr 8, 2024
7ce0b6b
feat(alerts-list-table): use the default link color for 'View Alert'
harunbleech Apr 8, 2024
53b826d
fix(email-notifications): decode special characters inside post title…
harunbleech Apr 8, 2024
fdcec7d
feat(test): if alert_id is 0 convert it to null
harunbleech Apr 8, 2024
96f3940
feat(onboarding): update false positive description
harunbleech Apr 10, 2024
712e7a4
feat(alerts): adjust wording and spacing for false positives label
harunbleech Apr 15, 2024
be23860
feat(test): remove passed and scheduled filters
harunbleech Apr 15, 2024
829c343
feat(uninstall): do not add plugin version to user agent
domtra Apr 22, 2024
5f548cd
refactor: update wording
harunbleech Apr 29, 2024
9044238
feat(tests): new test status view for editor and metaboxes
harunbleech May 2, 2024
ce48226
fix(test): metabox status when there is no test
harunbleech May 13, 2024
56062b6
fix(alerts): warning if s param not set
harunbleech May 16, 2024
c6397fb
feat(test): add function to get autoincrement value
harunbleech May 16, 2024
ee0ecd7
feat(onboarding): add tests and alerts onboarding
harunbleech May 16, 2024
a23a172
feat(tests): remove pagination form tests table
harunbleech May 16, 2024
de07955
feat(tests): update test status view for editor and metaboxes
harunbleech May 16, 2024
7fb36cb
fix(test): use correct text for screenshots info
harunbleech May 16, 2024
c9fd89c
feat(tests): update test status view for editor and metaboxes
harunbleech May 16, 2024
92065fd
fix(onboarding): linting
harunbleech May 16, 2024
ed0f410
docs: add ip whitelist faq to readme.txt
domtra May 23, 2024
1586140
refactor(settings): update setting example
harunbleech May 23, 2024
0f6d75e
refactor(onboarding): combine steps and udpate wording
harunbleech May 23, 2024
d46a9e0
feat(onboading): don't disable active interaction
harunbleech May 23, 2024
38376e2
feat(onboarding): automatically save onboarding when users first sees it
harunbleech May 23, 2024
07e2c56
fix(onboarding): lower the z-index so WP popups have priority
harunbleech May 23, 2024
f2b475a
fix(tests): return "Run test" to the passed status
harunbleech May 23, 2024
072e8e6
feat(test): set pagination args to show number of items but without a…
harunbleech May 23, 2024
fe2687d
refactor(onboarding): update wording
harunbleech May 24, 2024
4996b66
fix: linting
harunbleech May 24, 2024
e193b63
refactor(onboarding): uppercase Alert and Test and prefix headlines w…
steffenbew May 24, 2024
a495025
refactor(onboarding): adjust daily checks headline
steffenbew May 24, 2024
ffba047
Merge branch 'main' into continuousTesting
harunbleech May 24, 2024
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
64 changes: 63 additions & 1 deletion assets/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

.vrts_list_table_page {

.testing-status {
.vrts-testing-status {
display: flex;
flex-direction: column;
align-items: flex-start;
margin: 0;

&--paused {
color: $alert-red;
Expand Down Expand Up @@ -76,3 +80,61 @@
margin-bottom: 0;
}
}

.vrts-tooltip {
position: relative;

&-icon {
color: $blue-50;
display: flex;
align-items: center;
justify-content: center;

&::before {
font-size: 1rem;
}

svg {
fill: currentcolor;
}
}

&-content {
display: block;
position: absolute;
visibility: hidden;
padding: 0.5rem;
width: 240px;
z-index: 1000002;
top: -10px;
right: 20px;
}

&-content-inner {
display: block;
background: #000;
border-radius: 2px;
color: #f0f0f0;
font-size: 12px;
line-height: 1.4;
padding: 0.725rem;

a {
color: #fff;
}
}

&:hover &-content {
visibility: visible;
}
}

.vrts-testing-toogle {
display: flex;
align-items: center;
gap: 0.25rem;

.vrts-tooltip {
margin-left: auto;
}
}
86 changes: 52 additions & 34 deletions assets/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,8 @@
}
}

.testing-status {
display: flex;
justify-content: space-between;
gap: 1rem;
margin-bottom: 0;

&--paused {
color: $alert-red;
}

&--running {
color: $alert-green;
}

&-wrapper {
margin: 1.5rem 0;

> :first-child {
margin-top: 0;
}

> :last-child {
margin-bottom: 0;
}

.howto {
margin-top: 0.25rem;
font-size: 0.75rem;
color: $gray-700;
}
}
}

.figure {
margin: 0;
aspect-ratio: 16/9;

&-link {
outline: none;
Expand All @@ -60,6 +26,7 @@
}

&-image {
aspect-ratio: 16/9;
border: solid 1px #bfbfbf;
width: 100%;
height: 100%;
Expand All @@ -77,6 +44,10 @@

&-title {
margin-bottom: 0.5rem;
display: flex;
gap: 0.5rem;
justify-content: space-between;
align-items: center;
}

label {
Expand All @@ -91,3 +62,50 @@
}
}
}

.vrts-testing-status {
position: relative;
display: flex;
justify-content: space-between;
gap: 1rem;
margin-bottom: 0;

&--paused {
color: $alert-red;
}

&--waiting {
color: $alert-yellow;
}

&--running {
color: $alert-green;
}

&-wrapper {
display: flex;
flex-direction: column;
gap: 5px;
margin: 1.5rem 0;

> :first-child {
margin-top: 0;
}

> :last-child {
margin-bottom: 0;
}

.dashicons {
display: none;
}
}

&-info {
display: flex;
justify-content: space-between;
gap: 5px;
font-size: 0.75rem;
color: $gray-700;
}
}
16 changes: 11 additions & 5 deletions assets/scripts/onboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,29 @@ if ( window.vrts_admin_vars.onboarding ) {
const onboarding = driver( {
overlayColor: 'rgba(44, 51, 56, 0.35)',
stageRadius: 0,
animate: false,
stagePadding: 10,
stagePadding: 0,
popoverOffset: 20,
allowClose: false,
showProgress: ! isHighlight,
popoverClass: isHighlight
? 'vrts-onboarding-nonblocking'
: 'vrts-onboarding',
disableActiveInteraction: false,
progressText: __(
'{{current}} of {{total}}',
'visual-regression-tests'
),
nextBtnText: __( 'Next', 'visual-regression-tests' ),
prevBtnText: __( 'Previous', 'visual-regression-tests' ),
nextBtnText: __( 'Next', 'visual-regression-tests' ),
doneBtnText: __( 'Got it!', 'visual-regression-tests' ),
onPopoverRender: ( popover, { config, state } ) => {
const steps = config.steps;
const hasNextStep = steps[ state.activeIndex + 1 ];

config.stagePadding =
window.vrts_admin_vars.onboarding.steps[ state.activeIndex ]
.padding || 0;

popover.previousButton.classList.add(
'button',
'button-secondary',
Expand Down Expand Up @@ -53,14 +60,12 @@ if ( window.vrts_admin_vars.onboarding ) {
const hasNextStep = steps[ state.activeIndex + 1 ];

if ( ! hasNextStep ) {
saveOnboarding();
onboarding.destroy();
} else {
onboarding.moveNext();
}
},
onCloseClick: () => {
saveOnboarding();
onboarding.destroy();
},
steps: window.vrts_admin_vars.onboarding.steps.map( ( step ) => {
Expand All @@ -77,6 +82,7 @@ if ( window.vrts_admin_vars.onboarding ) {
} );

onboarding.drive();
saveOnboarding();
}

async function saveOnboarding() {
Expand Down
88 changes: 88 additions & 0 deletions assets/scripts/relative-time-element.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
class RelativeTimeElement extends window.HTMLElement {
// constructor (element) {
// this.element = element
// // get date from utc timestamp

// // this.time = new Date( element.getAttribute( 'time' ) );
// // this.update();
// }

// observe attribute time
static get observedAttributes() {
return [ 'time' ];
}

// update time when attribute time changes
attributeChangedCallback( name, oldValue, newValue ) {
if ( name === 'time' ) {
this.time = new Date( newValue );
this.update();
}
}

// connectedCallback() {
// this.time = new Date( this.getAttribute( 'time' ) );
// this.update();
// }

update() {
this.innerText = `${ extractDate( this.time ) } at ${ extractTime(
this.time
) }`;
}
}

window.customElements.define( 'vrts-relative-time', RelativeTimeElement );

function extractDate( inputDate ) {
const { __ } = wp.i18n;
const today = new Date();
// Set the time to midnight for an accurate date comparison
today.setHours( 0, 0, 0, 0 );

// Create a Date object for the input date
const comparisonDate = new Date( inputDate );
comparisonDate.setHours( 0, 0, 0, 0 );

// Calculate the difference in days
const difference = ( comparisonDate - today ) / ( 1000 * 3600 * 24 );

// Determine if the date is today, tomorrow, or yesterday
if ( difference === 0 ) {
return __( 'Today', 'visual-regression-testing' );
} else if ( difference === 1 ) {
return __( 'Tomorrow', 'visual-regression-testing' );
} else if ( difference === -1 ) {
return __( 'Yesterday', 'visual-regression-testing' );
}
return dateFormat( inputDate, 'Y/m/d' );
}

function extractTime( inputDate ) {
return dateFormat( inputDate, 'g:i a' );
}

// format date like in php date_format
function dateFormat( date, format ) {
const pad = ( number ) => ( number < 10 ? `0${ number }` : number );
const d = pad( date.getDate() );
const m = pad( date.getMonth() + 1 );
const y = date.getFullYear();
const Y = date.getFullYear();
const H = date.getHours();
const i = pad( date.getMinutes() );
const s = date.getSeconds();
const g = date.getHours() % 12 || 12;
const a = date.getHours() >= 12 ? 'pm' : 'am';

return format
.replace( 'd', d )
.replace( 'm', m )
.replace( 'y', y )
.replace( 'Y', Y )
.replace( 'H', H )
.replace( 'i', i )
.replace( 's', s )
.replace( 'g', g )
.replace( 'a', a );
}
Loading
Loading