chore: removed vital.json (#12038)
This commit is contained in:
1 parent
051353e7f1
commit
ee08118ed3
25 files changed
+14
-316
No files matched your search
@@ -1,5 +1,4 @@
|
||||
import { useEffect, useState, useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { Button, Select, showToast } from "@calcom/ui";
|
||||
|
||||
@@ -34,15 +33,14 @@ const saveSettings = async ({
|
||||
};
|
||||
|
||||
const AppConfiguration = (props: IAppConfigurationProps) => {
|
||||
const { t } = useTranslation();
|
||||
const [credentialId] = props.credentialIds;
|
||||
|
||||
const options = useMemo(
|
||||
() => [
|
||||
{ label: t("vital_app_total_label", { ns: "vital" }), value: "total" },
|
||||
{ label: t("vital_app_duration_label", { ns: "vital" }), value: "duration" },
|
||||
{ label: "Total (total = rem + light sleep + deep sleep)", value: "total" },
|
||||
{ label: "Duration (duration = bedtime end - bedtime start)", value: "duration" },
|
||||
],
|
||||
[t]
|
||||
[]
|
||||
);
|
||||
|
||||
const [selectedParam, setSelectedParam] = useState<{ label: string; value: string }>(options[0]);
|
||||
@@ -92,21 +90,21 @@ const AppConfiguration = (props: IAppConfigurationProps) => {
|
||||
return (
|
||||
<div className="flex-col items-start p-3 text-sm">
|
||||
<p>
|
||||
<strong>
|
||||
{t("connected_vital_app", { ns: "vital" })} Vital App: {connected ? "Yes" : "No"}
|
||||
</strong>
|
||||
<strong>Connected with Vital App: {connected ? "Yes" : "No"}</strong>
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
<strong>{t("vital_app_sleep_automation", { ns: "vital" })}</strong>
|
||||
<strong>Sleeping reschedule automation</strong>
|
||||
</p>
|
||||
<p className="mt-1">
|
||||
You can select different parameters to trigger the reschedule based on your sleeping metrics.
|
||||
</p>
|
||||
<p className="mt-1">{t("vital_app_automation_description", { ns: "vital" })}</p>
|
||||
|
||||
<div className="w-100 mt-2">
|
||||
<div className="block sm:flex">
|
||||
<div className="min-w-24 mb-4 mt-5 sm:mb-0">
|
||||
<label htmlFor="description" className="text-sm font-bold">
|
||||
{t("vital_app_parameter", { ns: "vital" })}
|
||||
Parameter
|
||||
</label>
|
||||
</div>
|
||||
<div className="w-120 mt-2.5">
|
||||
@@ -125,7 +123,7 @@ const AppConfiguration = (props: IAppConfigurationProps) => {
|
||||
<div className="w-full">
|
||||
<div className="min-w-24 mb-4 mt-3">
|
||||
<label htmlFor="value" className="text-sm font-bold">
|
||||
{t("vital_app_trigger", { ns: "vital" })}
|
||||
Trigger at below or equal than
|
||||
</label>
|
||||
</div>
|
||||
<div className="mx-2 mt-0 inline-flex w-24 items-baseline">
|
||||
@@ -142,7 +140,7 @@ const AppConfiguration = (props: IAppConfigurationProps) => {
|
||||
className="pr-12shadow-sm border-default mt-1 block w-full rounded-sm border py-2 pl-6 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm"
|
||||
/>
|
||||
<p className="ml-2">
|
||||
<strong>{t("vital_app_hours", { ns: "vital" })}</strong>
|
||||
<strong>hours</strong>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -154,9 +152,9 @@ const AppConfiguration = (props: IAppConfigurationProps) => {
|
||||
try {
|
||||
setSaveLoading(true);
|
||||
await saveSettings({ parameter: selectedParam, sleepValue: sleepValue });
|
||||
showToast(t("vital_app_save_success"), "success");
|
||||
showToast("Success saving your Vital Configurations", "success");
|
||||
} catch (error) {
|
||||
showToast(t("vital_app_save_error"), "error");
|
||||
showToast("An error ocurred saving your Vital Configurations", "error");
|
||||
setSaveLoading(false);
|
||||
}
|
||||
setTouchedForm(false);
|
||||
@@ -164,7 +162,7 @@ const AppConfiguration = (props: IAppConfigurationProps) => {
|
||||
}}
|
||||
loading={saveLoading}
|
||||
disabled={disabledSaveButton}>
|
||||
{t("vital_app_save_button", { ns: "vital" })}
|
||||
Save configuration
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user