Client: fix profile login crash and RoomsTypes values

This commit is contained in:
Timofey Boyko 2024-01-15 13:11:15 +03:00
parent fe5ed638c7
commit 5231eb4116
7 changed files with 12 additions and 10 deletions

View File

@ -4,7 +4,7 @@ import styled from "styled-components";
import RoomType from "../RoomType";
import { Base } from "@docspace/shared/themes";
import { RoomsType } from "@docspace/shared/enums";
import { RoomsTypeValues } from "@docspace/shared/utils/common";
const StyledDropdownDesktop = styled.div`
max-width: 100%;
@ -42,7 +42,7 @@ const DropdownDesktop = ({ t, open, chooseRoomType }) => {
return (
<StyledDropdownDesktop className="dropdown-content-wrapper" isOpen={open}>
<div className="dropdown-content">
{Object.values(RoomsType).map((roomType) => (
{Object.values(RoomsTypeValues).map((roomType) => (
<RoomType
id={roomType}
t={t}

View File

@ -2,7 +2,7 @@ import React from "react";
import styled from "styled-components";
import RoomType from "../RoomType";
import { RoomsType } from "@docspace/shared/enums";
import { RoomsTypeValues } from "@docspace/shared/utils/common";
import { Backdrop } from "@docspace/shared/components/backdrop";
import { Base } from "@docspace/shared/themes";
@ -31,7 +31,7 @@ const DropdownMobile = ({ t, open, onClose, chooseRoomType }) => {
<>
<Backdrop visible={open} onClick={onClose} zIndex={450} />
<StyledDropdownMobile className="dropdown-mobile" isOpen={open}>
{Object.values(RoomsType).map((roomType) => (
{Object.values(RoomsTypeValues).map((roomType) => (
<RoomType
id={roomType}
t={t}

View File

@ -6,7 +6,7 @@ import RoomType from "./RoomType";
import withLoader from "@docspace/client/src/HOCs/withLoader";
import Loaders from "@docspace/common/components/Loaders";
import { RoomsType } from "@docspace/shared/enums";
import { RoomsTypeValues } from "@docspace/shared/utils/common";
const StyledRoomTypeList = styled.div`
width: 100%;
@ -19,7 +19,7 @@ const StyledRoomTypeList = styled.div`
const RoomTypeList = ({ t, setRoomType }) => {
return (
<StyledRoomTypeList>
{Object.values(RoomsType).map((roomType) => (
{Object.values(RoomsTypeValues).map((roomType) => (
<RoomType
id={roomType}
t={t}

View File

@ -7,6 +7,7 @@ import find from "lodash/find";
import result from "lodash/result";
import { isTablet, isMobile } from "@docspace/shared/utils";
import { RoomsTypeValues } from "@docspace/shared/utils/common";
import FilterInput from "@docspace/common/components/FilterInput";
import Loaders from "@docspace/common/components/Loaders";
import { withLayoutSize } from "@docspace/shared/HOC/withLayoutSize";
@ -1200,7 +1201,7 @@ const SectionFilterContent = ({
isHeader: true,
isLast: isLastTypeOptionsRooms,
},
...Object.values(RoomsType).map((roomType) => {
...Object.values(RoomsTypeValues).map((roomType) => {
switch (roomType) {
case RoomsType.FillingFormsRoom:
return {

View File

@ -1,6 +1,6 @@
import React from "react";
import { RoomsType } from "@docspace/shared/enums";
import { RoomsTypeValues } from "@docspace/shared/utils/common";
import { RectangleSkeleton } from "@docspace/shared/skeletons";
import { StyledBlock, StyledContainer } from "./StyledFilterBlockLoader";
@ -16,7 +16,7 @@ const FilterBlockLoader = ({
}) => {
const roomTypeLoader = isRooms ? (
<>
{Object.values(RoomsType).map((roomType) => {
{Object.values(RoomsTypeValues).map((roomType) => {
switch (roomType) {
case RoomsType.FillingFormsRoom:
return (

View File

@ -698,6 +698,7 @@ export function getObjectByLocation(location: Location) {
export const RoomsTypeValues = Object.values(RoomsType).reduce(
(acc, current) => {
if (typeof current === "string") return { ...acc };
return { ...acc, [current]: current };
},
{},

View File

@ -3,6 +3,6 @@ import moment from "moment-timezone";
export const convertTime = (date: moment.Moment, locale: string) => {
return moment(date)
.tz(window.timezone || "")
.locale(locale)
.locale(locale || "")
.format("L, LTS");
};