Merge branch 'main' of github.com:formbricks/formbricks

This commit is contained in:
Johannes
2023-04-12 12:15:28 +02:00
6 changed files with 17 additions and 54 deletions
@@ -55,6 +55,7 @@ interface EnvironmentsNavbarProps {
export default function EnvironmentsNavbar({ environmentId, session }: EnvironmentsNavbarProps) {
const router = useRouter();
const [loading, setLoading] = useState(false);
const { environment, isErrorEnvironment, isLoadingEnvironment } = useEnvironment(environmentId);
const pathname = usePathname();
@@ -180,7 +181,7 @@ export default function EnvironmentsNavbar({ environmentId, session }: Environme
router.push(`/environments/${newEnvironmentId}/`);
};
if (isLoadingEnvironment) {
if (isLoadingEnvironment || loading) {
return <LoadingSpinner />;
}
@@ -328,12 +329,9 @@ export default function EnvironmentsNavbar({ environmentId, session }: Environme
<div className="flex items-center">
<ArrowRightOnRectangleIcon className="mr-2 h-4 w-4" />
<button
onClick={async () => {
try {
await signOut();
} catch (error) {
console.error("Failed to sign out:", error);
}
onClick={() => {
signOut();
setLoading(true);
}}>
Logout
</button>
@@ -19,10 +19,10 @@ const AddEmailAlertModal: React.FC<AddEmailAlertModalProps> = ({ open, setOpen }
];
const onTest = () => {
console.log("Test button clicked!");
throw Error("not implemented");
};
const onSave = () => {
console.log("Save button clicked!");
throw Error("not implemented");
};
return (
@@ -33,7 +33,5 @@ export default function ApiKeyList({
const environmentTypeId = findEnvironmentByType(product?.environments, environmentType);
console.log(environmentTypeId);
return <EditApiKeys environmentTypeId={environmentTypeId} environmentType={environmentType} />;
}
@@ -80,7 +80,7 @@ export default function RecontactOptionsCard({
)}>
<Collapsible.CollapsibleTrigger asChild className="h-full w-full cursor-pointer">
<div className="inline-flex px-4 py-6">
<div className="flex items-center pr-5 pl-2">
<div className="flex items-center pl-2 pr-5">
<CheckCircleIcon className="h-8 w-8 text-green-400" />
</div>
<div>
@@ -173,7 +173,7 @@ export default function RecontactOptionsCard({
htmlFor="newDays"
className="flex w-full cursor-pointer items-center rounded-lg border bg-slate-50 p-4">
<RadioGroupItem
value={inputDays.toString()}
value={inputDays === 0 ? "1" : inputDays.toString()} //Fixes that both radio buttons are checked when inputDays is 0
id="newDays"
className="aria-checked:border-brand-dark mx-5 disabled:border-slate-400 aria-checked:border-2"
/>
@@ -184,7 +184,7 @@ export default function RecontactOptionsCard({
type="number"
min="1"
id="inputDays"
value={inputDays}
value={inputDays === 0 ? 1 : inputDays}
onChange={handleRecontactDaysChange}
className="ml-2 mr-2 inline w-16 text-center text-sm"
/>
@@ -192,7 +192,7 @@ export default function RecontactOptionsCard({
</p>
<p className="mt-2 text-xs font-normal text-slate-600">
Overwrites waiting period between surveys to {inputDays} day(s).
Overwrites waiting period between surveys to {inputDays === 0 ? 1 : inputDays} day(s).
</p>
</div>
</label>