mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-18 07:52:23 +01:00
(ui) remove workaround
This commit is contained in:
parent
fc2169980f
commit
2f0a8064c2
@ -1,4 +1,4 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import React from 'react';
|
||||
import { react2angular } from 'react2angular';
|
||||
import { SubmitHandler, useForm, useWatch } from 'react-hook-form';
|
||||
import { isNil as _isNil } from 'lodash';
|
||||
@ -14,8 +14,6 @@ import { FormSwitch } from '../form/form-switch';
|
||||
import { FormRichText } from '../form/form-rich-text';
|
||||
import MemberAPI from '../../api/member';
|
||||
import { AvatarInput } from './avatar-input';
|
||||
import moment from 'moment';
|
||||
import { TDateISODate } from '../../typings/date-iso';
|
||||
import { FabButton } from '../base/fab-button';
|
||||
|
||||
declare const Application: IApplication;
|
||||
@ -39,14 +37,6 @@ export const UserProfileForm: React.FC<UserProfileFormProps> = ({ action, size,
|
||||
const { handleSubmit, register, control, formState, setValue } = useForm<User>({ defaultValues: { ...user } });
|
||||
const output = useWatch<User>({ control });
|
||||
|
||||
useEffect(() => {
|
||||
// this is a workaround needed because something in angular.js is transforming the YYY-MM-DD string to a Date Object
|
||||
setValue(
|
||||
'statistic_profile_attributes.birthday',
|
||||
moment(user.statistic_profile_attributes.birthday).format('YYYY-MM-DD') as TDateISODate
|
||||
);
|
||||
}, [user]);
|
||||
|
||||
const [isOrganization, setIsOrganization] = React.useState<boolean>(!_isNil(user.invoicing_profile_attributes.organization_attributes));
|
||||
|
||||
/**
|
||||
|
@ -302,9 +302,6 @@ Application.Controllers.controller('EditProfileController', ['$scope', '$rootSco
|
||||
const initialize = function () {
|
||||
CSRF.setMetaTags();
|
||||
|
||||
// init the birth date to JS object
|
||||
$scope.user.statistic_profile_attributes.birthday = moment($scope.user.statistic_profile_attributes.birthday).toDate();
|
||||
|
||||
if ($scope.activeProvider.providable_type !== 'DatabaseProvider') {
|
||||
$scope.preventPassword = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user