-
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
[wip] Custom Fields #5742
base: main
Are you sure you want to change the base?
[wip] Custom Fields #5742
Conversation
if (user.isAdmin || user.isSupport) return true | ||
|
||
const isBulkRequest = Array.isArray(originalInput) | ||
// Bulk requests are not supported in canManageObjectsAsB2BAppServiceUser |
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.
Todo?
if (user.deletedAt) return false | ||
if (user.isAdmin || user.isSupport) return true | ||
|
||
const isBulkRequest = Array.isArray(originalInput) |
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.
it’s better to check by itemids variable. It’s more common
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.
Can u please clarify wym? Every isBulkRequest
in code is const isBulkRequest = Array.isArray(originalInput)
locale: { | ||
schemaDoc: 'Locale of this field, For example, if you create SSN field (social security number) you should use en-US locale. If not set, then it is considered that this CustomField is global and not region specific', | ||
type: 'Text', | ||
isRequired: false, |
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.
Add options like user locale
validateInput: ({ resolvedData, fieldPath, addFieldValidationError }) => { | ||
const value = resolvedData[fieldPath] | ||
if (!(-100 < value && value <= 100)) { | ||
return addFieldValidationError('priority should be between -100 and 100') |
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.
Use GQLError
const schemaIsValid = ajv.validateSchema(value) | ||
|
||
if (!schemaIsValid) { | ||
addFieldValidationError('Bad validation rules, should be valid json-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.
GQLError
//template: 'miniapp.customField.*.name', | ||
}, | ||
|
||
priority: { |
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.
Can be updated?
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.
Yes, priority can be updated anytime. This changes only order in which fields are displayed in UI
}, | ||
}, | ||
|
||
staffCanRead: { |
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.
It’s cool to add some todos for the staffCanEdit and solid fields.
isRequired: true, | ||
}, | ||
|
||
filterDataString: { |
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.
Date time and numbers
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.
Datetime is string, I think I'll just create a special type for that
isRequired: false, | ||
}, | ||
|
||
isUniquePerObject: { |
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.
Should be with access: read only
import { generateReactHooks } from '@open-condo/codegen/generate.hooks' | ||
import { CustomValue as CustomValueGQL } from '@condo/domains/miniapp/gql' | ||
|
||
// TODO(codegen): write utils like convertToFormState and formValuesProcessor if needed, otherwise delete this TODO |
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.
….
68763dc
to
fcbe509
Compare
fcbe509
to
8284b79
Compare
|
This PR adds the ability for engineers to add their custom data to the condo