-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doma-9987 synchronization template #5767
base: main
Are you sure you want to change the base?
doma-9987 synchronization template #5767
Conversation
@@ -191,8 +191,8 @@ export const CreateNewsForm: React.FC = () => { | |||
const templates = isNewsItemTemplatesFetching || !newsItemTemplates?.length ? null : newsItemTemplates | |||
.reduce((acc, template) => { | |||
acc[template.id] = { | |||
title: template.title, | |||
body: template.body, | |||
title: template.title.replace(/<\/br>/g, '\n'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced the /n on
templates because when sending the transfer symbol is shielded, well, here you need to return it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just use url encoding?
apps/condo-news-greenhouse
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think u need to rebase :-) strange that u add a new submodule, u should be just updating one added by @sitozzz
review changes Co-authored-by: Mikhail Gorbunov <[email protected]>
@@ -1462,6 +1466,7 @@ export const BaseNewsForm: React.FC<BaseNewsFormProps> = ({ | |||
(getStepTypeByStep(currentStep) === 'sharingApp') && ( | |||
// TODO (DOMA-9328) Move onSkip to BaseNewsForm component, since steps are handled here! | |||
<NewsItemSharingForm | |||
template={{ id: templateId, ...templates[templateId] }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just ...templates[templateId] ?
@@ -191,8 +191,8 @@ export const CreateNewsForm: React.FC = () => { | |||
const templates = isNewsItemTemplatesFetching || !newsItemTemplates?.length ? null : newsItemTemplates | |||
.reduce((acc, template) => { | |||
acc[template.id] = { | |||
title: template.title, | |||
body: template.body, | |||
title: template.title.replace(/<\/br>/g, '\n'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just use url encoding?
@@ -1,4 +1,4 @@ | |||
import { B2BApp } from '@app/condo/schema' | |||
import { B2BApp, NewsItemTemplateTypeType } from '@app/condo/schema' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why TypeType?
@@ -621,7 +621,11 @@ export const BaseNewsForm: React.FC<BaseNewsFormProps> = ({ | |||
Body.setTextLength(initialBody.length) | |||
}, []) | |||
|
|||
const [templateId, setTemplateId] = useState('') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think when dealing with Ids its more clean to make values null || string
Co-authored-by: Mikhail Gorbunov <[email protected]>
hooks: { | ||
resolveInput: async ({ resolvedData }) => { | ||
return normalizeText(resolvedData['title']) | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to do same for the name
field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, field is used in the selector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this type for the name
field: Text
, not Select
This means that users can write anything there
|
add emoji, add symbols of transfer, add receiving template