Skip to content

Commit

Permalink
[GT-187] Update code to improve wording
Browse files Browse the repository at this point in the history
  • Loading branch information
Sae126V committed Aug 30, 2023
1 parent 87c02c3 commit ffc2741
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
13 changes: 7 additions & 6 deletions htdocs/web_portal/controllers/downtime/downtime_utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ function endpointToServiceMapping($impactedIDs)
*
* @param array $servWithEndpoints Used for displaying affected service
* with endpoint(s).
* @param array $siteDetails Each site ID will have `services` which
* stores all affected service ID(s) and
* `endpoints` which stores all affected
* @param array $siteDetails Each site ID will have a `services` that
* stores all affected service ID(s) and an
* `endpoints` that stores all affected
* endpoint ID(s).
* @param bool $hasMultipleTimezones If the user selects multiple sites in
* web portal along with the option
* the web portal along with the option
* "site timezone" it will be true;
* otherwise, it will be false.
* @param mixed $downtimeDetails Downtime information.
Expand Down Expand Up @@ -107,7 +107,7 @@ function addParentServiceForEndpoints(

/**
* Converts UTC start and end timestamps to the local timezone
* of a specific site based on its timezone.
* of a specific site based on that site's timezone.
*
* @param mixed $downtimeDetails Downtime information.
* @param integer $siteID Site ID
Expand Down Expand Up @@ -150,7 +150,8 @@ function setLocalTimeForSites($downtimeDetails, $siteID)
* Unset a given variable, helper method to destroy the specified variables.
*
* @param mixed $downtimeObj Object to destroy specified variables.
* @param string $fromLocation Location from where the function is being called.
* @param string $fromLocation Location from where
* the function is being called.
*/
function unsetVariables($downtimeObj, $fromLocation)
{
Expand Down
6 changes: 3 additions & 3 deletions htdocs/web_portal/controllers/downtime/edit_downtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ function draw(\User $user = null) {
}

/**
* Retrieves the raw edited downtime's data from a portal request
* and submit it to the services layer's downtime functions.
* Retrieves the raw edited downtime data from a portal request
* and submits it to the services layer's downtime functions.
*
* @param \User $user current user
*
Expand Down Expand Up @@ -112,7 +112,7 @@ function submit(\User $user = null)
$downtimeInfo = getDowntimeFormData();

/**
* Need to sort the impacted_ids into
* Need to sort the `impacted_ids` into
* impacted services and impacted endpoints.
*/
list(
Expand Down
10 changes: 8 additions & 2 deletions htdocs/web_portal/views/downtime/add_downtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ function updateStartEndTimesInUtc()
let endTimeContent = $('#endTimeContent').val();

if (startDateContent && startTimeContent) {
let startDateInUTC = getDateTimeInUTC(startDateContent, startTimeContent);
let startDateInUTC = getDateTimeInUTC(
startDateContent,
startTimeContent
);
M_START_UTC = updateTimeInSiteTimezone(startDateInUTC);

$('#startUtcLabel').text(
Expand All @@ -278,7 +281,10 @@ function updateStartEndTimesInUtc()

// Calculate the end date time in UTC
if (endDateContent && endTimeContent) {
let endDateInUTC = getDateTimeInUTC(endDateContent, endTimeContent);
let endDateInUTC = getDateTimeInUTC(
endDateContent,
endTimeContent
);
M_END_UTC = updateTimeInSiteTimezone(endDateInUTC);

$('#endUtcLabel').text(
Expand Down
4 changes: 2 additions & 2 deletions htdocs/web_portal/views/downtime/edit_downtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ class="form-control"
* Set the start and finish times (don't echo in the full date,
* just the time values, time widget didn't like timestamp with date)
*/
$('#startTime').data("DateTimePicker").date("<?php echo date_format($startDate,"H:i"); ?>");
$('#endTime').data("DateTimePicker").date("<?php echo date_format($endDate,"H:i"); ?>");

// By default select the original affected services and endpoints
Expand Down Expand Up @@ -396,7 +395,8 @@ function loadSitesServicesAndEndpoints()
* loading the downtime and the site.
*/
$('#chooseServices').load(
'index.php?Page_Type=Edit_Downtime_view_endpoint_tree&dt_id=' + dtId,
'index.php?Page_Type=Edit_Downtime_view_endpoint_tree&dt_id=' +
dtId,
{site_id: siteId},
function(response, status, xhr)
{
Expand Down

0 comments on commit ffc2741

Please sign in to comment.