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

move to production #1807

Merged
merged 9 commits into from
Jan 15, 2024
2 changes: 1 addition & 1 deletion .github/workflows/deploy-frontend-pr-previews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ jobs:
- name: Delete Old Versions
run: |-
service="website-pr-previews"
versions=$(gcloud app versions list --service=$service --sort-by '~LAST_DEPLOYED' --format 'value(VERSION.ID)' | sort -r | tail -n +4)
versions=$(gcloud app versions list --service=$service --sort-by '~LAST_DEPLOYED' --format 'value(VERSION.ID)' | grep -v 'maintenance' | sort -r | tail -n +4)
for version in $versions; do
echo "Deleting version: $version for service: $service"
gcloud app versions delete "$version" --service=$service --quiet
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-frontends-to-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ jobs:
- name: Delete Old Versions
run: |-
service="default"
versions=$(gcloud app versions list --service=$service --sort-by '~LAST_DEPLOYED' --format 'value(VERSION.ID)' | sort -r | tail -n +4)
versions=$(gcloud app versions list --service=$service --sort-by '~LAST_DEPLOYED' --format 'value(VERSION.ID)' | grep -v 'maintenance' | sort -r | tail -n +4)
for version in $versions; do
echo "Deleting version: $version for service: $service"
gcloud app versions delete "$version" --service=$service --quiet
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-frontends-to-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ jobs:
- name: Delete Old Versions
run: |-
service="staging"
versions=$(gcloud app versions list --service=$service --sort-by '~LAST_DEPLOYED' --format 'value(VERSION.ID)' | sort -r | tail -n +4)
versions=$(gcloud app versions list --service=$service --sort-by '~LAST_DEPLOYED' --format 'value(VERSION.ID)' | grep -v 'maintenance' | sort -r | tail -n +4)
for version in $versions; do
echo "Deleting version: $version for service: $service"
gcloud app versions delete "$version" --service=$service --quiet
Expand Down
2 changes: 1 addition & 1 deletion inventory/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# deploy .
# AirQo Hardware Inventory
metadata
2 changes: 1 addition & 1 deletion k8s/inventory/values-stage.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
replicaCount: 2
image:
repository: eu.gcr.io/airqo-250220/airqo-stage-inventory
tag: stage-da9849e0-1700073280
tag: stage-fcff95f3-1705327162
pullPolicy: Always
imagePullSecrets: []
nameOverride: ''
Expand Down
2 changes: 1 addition & 1 deletion k8s/netmanager/values-prod.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
replicaCount: 2
image:
repository: eu.gcr.io/airqo-250220/airqo-platform-frontend
tag: prod-08f61b20-1705146189
tag: prod-1773affb-1705270519
pullPolicy: Always
imagePullSecrets: []
nameOverride: ''
Expand Down
17 changes: 11 additions & 6 deletions netmanager/src/views/pages/Analytics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const Analytics = () => {

useEffect(() => {
const loadSummaryAsync = async () => {
if (!activeNetwork) {
if (!activeNetwork || activeNetwork.net_name === '') {
return;
}

Expand Down Expand Up @@ -386,14 +386,16 @@ const Analytics = () => {
justifyContent={'space-between'}
alignItems={'center'}
width={'100%'}
position={'relative'}>
position={'relative'}
>
<Box
display={'flex'}
justifyContent={'space-between'}
gap={'16px'}
width={'100%'}
maxWidth={'450px'}
marginBottom={{ xs: '20px', sm: '20px', md: '0', lg: '0', xl: '0' }}>
marginBottom={{ xs: '20px', sm: '20px', md: '0', lg: '0', xl: '0' }}
>
<AnalyticsAirqloudsDropDown
isCohort={isCohort}
airqloudsData={
Expand Down Expand Up @@ -424,7 +426,8 @@ const Analytics = () => {
width={'auto'}
marginTop={{ xs: '25px', sm: '25px', md: '0', lg: '0', xl: '0' }}
display={'flex'}
gridGap="12px">
gridGap="12px"
>
<Button
margin="dense"
color="primary"
Expand All @@ -436,7 +439,8 @@ const Analytics = () => {
}}
variant="outlined"
onClick={submitExportData}
disabled={downloadingData || isGridLoading || isCohortLoading || isSummaryLoading}>
disabled={downloadingData || isGridLoading || isCohortLoading || isSummaryLoading}
>
Download data
</Button>
<Button
Expand All @@ -449,7 +453,8 @@ const Analytics = () => {
position: 'relative'
}}
variant="contained"
onClick={handleSwitchAirqloudTypeClick}>
onClick={handleSwitchAirqloudTypeClick}
>
<ImportExportIcon /> Switch to {isCohort ? 'Grid View' : 'Cohort View'}
</Button>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const AveragesChart = ({ classes, analyticsSites, isGrids, isCohorts, analyticsD
const deviceOptions = [];
!isEmpty(analyticsDevices) &&
analyticsDevices.map((device) => {
deviceOptions.push(device._id);
deviceOptions.push(device.long_name.toLowerCase());
});
setAverageChartDevices(deviceOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const ExceedancesChart = (props) => {
const deviceOptions = [];
!isEmpty(analyticsDevices) &&
analyticsDevices.map((device) => {
deviceOptions.push(device._id);
deviceOptions.push(device.long_name.toLowerCase());
});
setAverageChartDevices(deviceOptions);
}
Expand Down Expand Up @@ -233,10 +233,10 @@ const ExceedancesChart = (props) => {
const exceedanceData = responseData.data;
exceedanceData.sort((a, b) => {
const a0 = isCohorts
? a.device.name.trim()
? a.device_id.trim()
: (a.site.name || a.site.description || a.site.generated_name).trim();
const b0 = isCohorts
? b.device.name.trim()
? b.device_id.trim()
: (b.site.name || b.site.description || b.site.generated_name).trim();
if (a0 < b0) return -1;
if (a0 > b0) return 1;
Expand All @@ -247,7 +247,7 @@ const ExceedancesChart = (props) => {
const myLocations = exceedanceData
.map((element) =>
isCohorts
? element.device.name
? element.device_id
: element.site.name || element.site.description || element.site.generated_name
)
.slice(0, maxLocations);
Expand All @@ -261,7 +261,11 @@ const ExceedancesChart = (props) => {
myDataset = labels.map((label, index) => ({
label,
data: exceedanceData
.map((element) => element.exceedance[properties[index]])
.map((element) =>
isCohorts
? element.exceedances[properties[index]]
: element.exceedance[properties[index]]
)
.slice(0, maxLocations),
backgroundColor: colors[index],
borderColor: 'rgba(0,0,0,1)',
Expand All @@ -271,7 +275,9 @@ const ExceedancesChart = (props) => {
myDataset = [
{
label: 'Exceedances',
data: exceedanceData.map((element) => element.exceedance).slice(0, maxLocations),
data: exceedanceData
.map((element) => (isCohorts ? element.exceedances : element.exceedance))
.slice(0, maxLocations),
backgroundColor: palette.primary.main,
//borderColor: 'rgba(0,0,0,1)',
borderWidth: 1
Expand All @@ -285,9 +291,9 @@ const ExceedancesChart = (props) => {
{
label: 'Exceedances',
data: exceedanceData.map((element) => [
isCohorts ? element.device : element.site,
isCohorts ? element.device_id : element.site,
element.total,
element.exceedance
isCohorts ? element.exceedances : element.exceedance
]),

backgroundColor: palette.primary.main,
Expand All @@ -300,9 +306,9 @@ const ExceedancesChart = (props) => {
{
// label: "Exceedances",
data: exceedanceData.map((element) => [
isCohorts ? element.device : element.site,
isCohorts ? element.device_id : element.site,
element.total,
element.exceedance
isCohorts ? element.exceedances : element.exceedance
]),

backgroundColor: palette.primary.main,
Expand Down
Loading