Skip to content

Commit

Permalink
Merge branch 'main' into chore/release-crate
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker authored Jan 10, 2025
2 parents 51ac8ff + 7e89176 commit 145cb96
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 12 deletions.
2 changes: 1 addition & 1 deletion scripts/build.csp.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const injectScriptLoader = (indexHtml) =>
* Instead, we transform these in dynamic scripts and add the sha256 value of the script to the script-src policy of the CSP.
*/
const injectLinkPreloader = (indexHtml) => {
const preload = /<link rel="preload"[\s\S]*?href="([\s\S]*?)">/gm;
const preload = /<link rel="preload"[\s\S]*?href="([\s\S]*?)">/gim;

const links = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { compare } from 'semver';
import { onDestroy, onMount, type Snippet } from 'svelte';
import { run } from 'svelte/legacy';
import { MISSION_CONTROL_v0_0_13 } from '$lib/constants/version.constants';
import { MISSION_CONTROL_v0_0_14 } from '$lib/constants/version.constants';
import { missionControlIdDerived } from '$lib/derived/mission-control.derived';
import { missionControlVersion } from '$lib/derived/version.derived';
import {
Expand Down Expand Up @@ -68,7 +68,7 @@
],
missionControlId: $missionControlIdDerived,
withMonitoringHistory:
compare($missionControlVersion.current ?? '0.0.0', MISSION_CONTROL_v0_0_13) >= 0,
compare($missionControlVersion.current ?? '0.0.0', MISSION_CONTROL_v0_0_14) >= 0,
callback: syncCanister
});
})();
Expand Down
19 changes: 18 additions & 1 deletion src/frontend/src/lib/components/monitoring/NoMonitoring.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
<script lang="ts">
import type { Principal } from '@dfinity/principal';
import { compare } from 'semver';
import { get } from 'svelte/store';
import { MISSION_CONTROL_v0_0_14 } from '$lib/constants/version.constants';
import { missionControlVersion } from '$lib/derived/version.derived';
import { loadVersion } from '$lib/services/console.services';
import { openMonitoringModal } from '$lib/services/monitoring.services';
import { i18n } from '$lib/stores/i18n.store';
import { toasts } from '$lib/stores/toasts.store';
interface Props {
missionControlId: Principal;
}
let { missionControlId }: Props = $props();
const openModal = () => {
const openModal = async () => {
await loadVersion({
satelliteId: undefined,
missionControlId,
skipReload: true
});
if (compare($missionControlVersion?.current ?? '0.0.0', MISSION_CONTROL_v0_0_14) < 0) {
toasts.warn($i18n.errors.monitoring_upgrade);
return;
}
openMonitoringModal({
type: 'create_monitoring_strategy',
missionControlId
Expand Down
5 changes: 2 additions & 3 deletions src/frontend/src/lib/constants/version.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ const VERSIONS = {
v0_0_5: '0.0.5',
v0_0_7: '0.0.7',
v0_0_12: '0.0.12',
// TODO: review for release of monitoring
v0_0_13: '0.0.13'
v0_0_14: '0.0.14'
},
SATELLITE: {
v0_0_7: '0.0.7',
Expand All @@ -29,7 +28,7 @@ export const {
v0_0_5: MISSION_CONTROL_v0_0_5,
v0_0_7: MISSION_CONTROL_v0_0_7,
v0_0_12: MISSION_CONTROL_v0_0_12,
v0_0_13: MISSION_CONTROL_v0_0_13
v0_0_14: MISSION_CONTROL_v0_0_14
},
SATELLITE: {
v0_0_7: SATELLITE_v0_0_7,
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@
"monitoring_no_modules": "Monitoring requires at least one satellite or orbiter to be set up. Add a module to get started.",
"monitoring_email_missing": "An email address must be provided.",
"monitoring_email_update": "Unexpected error(s) while trying to update your email address.",
"monitoring_notifications_update": "Unexpected error(s) while trying to update the notifications."
"monitoring_notifications_update": "Unexpected error(s) while trying to update the notifications.",
"monitoring_upgrade": "Please upgrade your Mission Control to enable the monitoring feature."
},
"document": {
"owner": "Owner",
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/src/lib/i18n/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@
"monitoring_no_modules": "Monitoring requires at least one satellite or orbiter to be set up. Add a module to get started.",
"monitoring_email_missing": "An email address must be provided.",
"monitoring_email_update": "Unexpected error(s) while trying to update your email address.",
"monitoring_notifications_update": "Unexpected error(s) while trying to update the notifications."
"monitoring_notifications_update": "Unexpected error(s) while trying to update the notifications.",
"monitoring_upgrade": "Please upgrade your Mission Control to enable the monitoring feature."
},
"document": {
"owner": "拥有者",
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/src/lib/services/mission-control.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { setMissionControlController004 } from '$lib/api/mission-control.depreca
import { satelliteVersion } from '$lib/api/satellites.api';
import { METADATA_KEY_EMAIL, METADATA_KEY_NAME } from '$lib/constants/metadata.constants';
import {
MISSION_CONTROL_v0_0_13,
MISSION_CONTROL_v0_0_14,
MISSION_CONTROL_v0_0_3,
MISSION_CONTROL_v0_0_5,
MISSION_CONTROL_v0_0_7
Expand Down Expand Up @@ -255,7 +255,7 @@ export const loadSettings = async ({
}): Promise<{ success: boolean }> => {
const versionStore = get(missionControlVersionStore);

if (compare(versionStore?.current ?? '0.0.0', MISSION_CONTROL_v0_0_13) < 0) {
if (compare(versionStore?.current ?? '0.0.0', MISSION_CONTROL_v0_0_14) < 0) {
missionControlSettingsDataStore.reset();
return { success: true };
}
Expand Down Expand Up @@ -291,7 +291,7 @@ export const loadUserData = async ({
}): Promise<{ success: boolean }> => {
const versionStore = get(missionControlVersionStore);

if (compare(versionStore?.current ?? '0.0.0', MISSION_CONTROL_v0_0_13) < 0) {
if (compare(versionStore?.current ?? '0.0.0', MISSION_CONTROL_v0_0_14) < 0) {
missionControlUserDataStore.reset();
return { success: true };
}
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/lib/types/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ interface I18nErrors {
monitoring_email_missing: string;
monitoring_email_update: string;
monitoring_notifications_update: string;
monitoring_upgrade: string;
}

interface I18nDocument {
Expand Down

0 comments on commit 145cb96

Please sign in to comment.