Skip to content

Commit b7b98dc

Browse files
authored
Merge pull request #125 from edsonmartins/develop
fix: permitir insert no datasource mesmo se records estirver freeze e…
2 parents ae5c967 + 7a116f4 commit b7b98dc

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/components/datasource/ArchbaseDataSource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ export class ArchbaseDataSource<T, _ID> implements IDataSource<T> {
787787

788788
this.grandTotalRecords++;
789789
const nextRecordIndex = this.getTotalRecords();
790-
this.filteredRecords.push(record);
790+
this.filteredRecords = [...this.filteredRecords, record];
791791
this.currentRecordIndex = nextRecordIndex;
792792
this.currentRecord = record;
793793
this.inserting = true;

src/components/security/UserModal.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ export interface UserModalOptions {
4040
avatarMaxSizeKB?: number;
4141
/** Qualidade da compressão da imagem do avatar (0 a 1), sendo 1 melhor qualidade */
4242
avatarImageQuality?: number;
43+
44+
/** Configuração de permissão de edição de campos */
45+
allowEditEmail?: boolean;
4346
}
4447

4548
export const defaultUserModalOptions: UserModalOptions = {
@@ -65,7 +68,9 @@ export const defaultUserModalOptions: UserModalOptions = {
6568
requiredNickname: true,
6669

6770
avatarMaxSizeKB: 2000,
68-
avatarImageQuality: 1
71+
avatarImageQuality: 1,
72+
73+
allowEditEmail: true,
6974
}
7075

7176
export interface UserModalProps {
@@ -171,6 +176,7 @@ export const UserModal = (props: UserModalProps) => {
171176
dataSource={props.dataSource}
172177
onChangeValue={(value) => props.dataSource.setFieldValue("userName", value)}
173178
dataField="email"
179+
readOnly={props.dataSource.isEditing() ? !options.allowEditEmail : false}
174180
required
175181
/>
176182
</Grid.Col>

0 commit comments

Comments
 (0)