Skip to content

Commit 52e2151

Browse files
authored
Merge pull request #702 from Lemoncode/dev
fix old version files placeholder default value and adding member about
2 parents 007cf45 + 86a2955 commit 52e2151

File tree

4 files changed

+57
-4
lines changed

4 files changed

+57
-4
lines changed

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>

public/assets/sergio-del-campo.jpg

147 KB
Loading

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':

src/pods/about/members.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,22 @@ export const memberList: Member[] = [
131131

132132
{
133133
id: '17',
134+
name: 'Sergio',
135+
surname: 'del Campo',
136+
urlLinkedin: 'https://www.linkedin.com/in/sergioelmoreno/',
137+
image: './assets/sergio-del-campo.jpg',
138+
},
139+
140+
{
141+
id: '18',
134142
name: 'Gabriel',
135143
surname: 'Ionut',
136144
urlLinkedin: 'https://www.linkedin.com/in/gabriel-ionut-birsan-b14816307/',
137145
image: './assets/gabriel-ionut.jpeg',
138146
},
139147

140148
{
141-
id: '18',
149+
id: '19',
142150
name: 'Antonio',
143151
surname: 'Contreras',
144152
urlLinkedin:
@@ -147,7 +155,7 @@ export const memberList: Member[] = [
147155
},
148156

149157
{
150-
id: '19',
158+
id: '20',
151159
name: 'Braulio',
152160
surname: 'Diez',
153161
urlLinkedin: 'https://www.linkedin.com/in/brauliodiez/',

0 commit comments

Comments
 (0)