Skip to content

Commit 6db0aa2

Browse files
authored
Merge branch 'dev' into feature/add-new-member-to-about-us-modal
2 parents 6b7eaab + f64f6db commit 6db0aa2

2 files changed

Lines changed: 47 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ Team members participating in this project
144144
<a href="https://github.com/omarlm">
145145
<kbd><img src="https://github.com/omarlm.png" alt="Omar Lorenzo" width="50" height="50" style="border-radius: 50%;"></kbd>
146146
</a>
147+
<a href="https://github.com/iria-carballo">
148+
<kbd><img src="https://github.com/iria-carballo.png" alt="Iria Carballo" width="50" height="50" style="border-radius: 50%;"></kbd>
149+
</a>
147150
<a href="https://github.com/marcosgiannini">
148151
<kbd><img src="https://github.com/marcosgiannini.png" alt="Marcos Giannini" width="50" height="50" style="border-radius: 50%;"></kbd>
149152
</a>

src/core/local-disk/shapes-to-document.mapper.ts

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
createDefaultCanvasSize,
55
DocumentModel,
66
} from '../providers/canvas/canvas.model';
7-
import { QuickMockFileContract } from './local-disk.model';
7+
import { Page, QuickMockFileContract } from './local-disk.model';
88
import { APP_CONSTANTS } from '../providers/canvas/canvas.model';
99

1010
export const mapFromShapesArrayToQuickMockFileDocument = (
@@ -24,14 +24,56 @@ export const mapFromQuickMockFileDocumentToApplicationDocument = (
2424
): DocumentModel => {
2525
return {
2626
activePageIndex: 0,
27-
pages: fileDocument.pages,
27+
pages: AdaptMinor_0_2_Updates(fileDocument.pages),
2828
customColors:
2929
fileDocument.customColors ||
3030
new Array(APP_CONSTANTS.COLOR_SLOTS).fill(null),
3131
size: fileDocument.size ?? createDefaultCanvasSize(),
3232
};
3333
};
3434

35+
const AdaptMinor_0_2_Updates = (pages: Page[]): Page[] => {
36+
return pages.map(page => {
37+
return {
38+
...page,
39+
shapes: page.shapes.map(
40+
AddDefaultValuesForInputPropsPlaceHolderAndPassword
41+
),
42+
};
43+
});
44+
};
45+
46+
const AddDefaultValuesForInputPropsPlaceHolderAndPassword = (
47+
shape: ShapeModel
48+
) => {
49+
switch (shape.type) {
50+
case 'input':
51+
return {
52+
...shape,
53+
otherProps: {
54+
...shape.otherProps,
55+
isPlaceholder:
56+
// Small update no need to go for 0_3, but input placeHolder needs to have default value
57+
// if undefined
58+
shape.otherProps?.isPlaceholder !== undefined
59+
? shape.otherProps?.isPlaceholder
60+
: true,
61+
textColor:
62+
// Small update, no need to go for 0_3,
63+
// but input textColor needs to have default value
64+
// if undefined, and textColor was placeholder gray color
65+
// in this case change it to black
66+
shape.otherProps?.isPlaceholder === undefined &&
67+
shape.otherProps?.textColor === '#8c8c8c'
68+
? '#000000'
69+
: shape.otherProps?.textColor,
70+
},
71+
};
72+
default:
73+
return shape;
74+
}
75+
};
76+
3577
const mapTextElementFromV0_1ToV0_2 = (shape: ShapeModel): ShapeModel => {
3678
switch (shape.type) {
3779
case 'heading1':

0 commit comments

Comments
 (0)