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

fix(customer): this field may not be set #2573

Merged
merged 2 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 4 additions & 5 deletions www/assets/css/pagestyle2.css
Original file line number Diff line number Diff line change
Expand Up @@ -1260,13 +1260,12 @@ h4.experiments_list_hed-recs {
.experiments_foot details div p.experiments_jump {
color: #333;
font-size: 1rem;
margin-bottom: .5em;
margin-bottom: 0.5em;
}
.experiments_foot details div p.experiments_jump i {
display: block;
font-weight: 300;
font-size: .8em;

font-size: 0.8em;
}
.experiments_foot details ol {
max-height: 70vh;
Expand All @@ -1278,7 +1277,7 @@ h4.experiments_list_hed-recs {

.experiments_foot details ol li {
padding: 0.6em 0;
font-size: .8em;
font-size: 0.8em;
border-bottom: 1px solid #eee;
list-style-position: inside;
}
Expand Down Expand Up @@ -1343,7 +1342,7 @@ h4.experiments_list_hed-recs {
display: inline-block;
}
.experiments_foot details ol li:first-child button.experiment_sort {
display: none;
display: none;
}

.experiments_create {
Expand Down
4 changes: 2 additions & 2 deletions www/experiments.php
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ function refreshExperimentOrder(){
}
let currentTestID = '<?php if (isset($id)) {
echo "$id";
} ?>';
} ?>';
if(currentTestID && priorState && priorState && priorState[0] === currentTestID){
priorState.reverse();
for(var i = 0; i < priorState.length-1; i++){
Expand All @@ -662,7 +662,7 @@ function saveExperimentOrder(){
let appliedOrder = document.querySelectorAll('.exps-active li');
let currentTestID = '<?php if (isset($id)) {
echo "$id";
} ?>';
} ?>';
if( currentTestID ){
let orderObj = [currentTestID];
appliedOrder.forEach(li => {
Expand Down
2 changes: 1 addition & 1 deletion www/experiments/lcp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ if (isset($lcp)) {
"expval" => array($lcpSource . "|as_image"),
"explabel" => array($lcpSource)
];

// priority Hints only help for foreground images
$suggest_priority_hints = !$isBG && !$isVideo && !$hasHighFetchPriority;
if ($suggest_priority_hints) {
Expand Down
8 changes: 4 additions & 4 deletions www/src/CPGraphQlTypes/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Customer
private string $customer_id;
private string $subscription_id;
private string $wpt_plan_id;
private DateTime $billing_period_end_date;
private ?DateTime $billing_period_end_date;
private float $subscription_price;
private string $formatted_subscription_price;
private string $status;
Expand All @@ -37,7 +37,6 @@ public function __construct(array $options)
!(isset($options['customerId']) &&
isset($options['subscriptionId']) &&
isset($options['wptPlanId']) &&
isset($options['billingPeriodEndDate']) &&
isset($options['subscriptionPrice']) &&
isset($options['status']) &&
isset($options['wptPlanName']) &&
Expand All @@ -50,7 +49,8 @@ public function __construct(array $options)
$this->customer_id = $options['customerId'];
$this->subscription_id = $options['subscriptionId'];
$this->wpt_plan_id = $options['wptPlanId'];
$this->billing_period_end_date = new DateTime($options['billingPeriodEndDate']);
$this->billing_period_end_date = isset($options['billingPeriodEndDate']) ?
new DateTime($options['billingPeriodEndDate']) : null;
$this->subscription_price = $options['subscriptionPrice'];
$this->formatted_subscription_price = number_format(($options['subscriptionPrice'] / 100), 2, '.', ',');
$this->status = $options['status'];
Expand Down Expand Up @@ -125,7 +125,7 @@ public function getNextWptPlanId(): ?string
return $this->next_wpt_plan_id;
}

public function getBillingPeriodEndDate(): DateTime
public function getBillingPeriodEndDate(): ?DateTime
{
return $this->billing_period_end_date;
}
Expand Down
2 changes: 1 addition & 1 deletion www/technologies.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
'detected' => $detected,
'count' => count($detected),
'error_message' => $error_message,
]);
]);