Skip to content

Sample State

Wayne Su edited this page Apr 27, 2020 · 6 revisions
{
    entities: {
        users: {
            1: {
                id: 1,
                username: 'wayne',
                email: 'wayne@gmail.com',
                designs: [1, 2],
                folders: [1],
                uploadedImages: [1],
            },
            2: {
                id: 2,
                username: 'mike',
                email: 'mike@gmail.com',
                designs: [3],
                folders: [2],
                uploadedImages: [2, 3],
            },
        },
        designs: {
            1: {
                id: 1,
                userId: 1,
                creatorId: 1,
                folderId: 1,
                title: 'Graduation Poster Design Ver1.0',
                description: 'A draft for the app/Academy SF Feb Cohort graduation poster',
                public: true,
                width: 3150,
                height: 4200,
                bgableId: 1,
                bgableType: 'Image',
                elements: [1, 2],
                tags: [1, 4],
            },
            2: {
                id: 2,
                userId: 1,
                creatorId: 1,
                folderId: 1,
                title: 'Business Card',
                description: 'My business card design idea',
                public: false,
                width: 1050,
                height: 600,
                bgableId: 1,
                bgableType: 'Shape',
                elements: [],
                tags: [2],
            },
            3: {
                id: 3,
                userId: 2,
                creatorId: 2,
                folderId: 2,
                title: 'Facebook cover photo',
                description: 'idea for Facebook stuff',
                public: true,
                width: 820,
                height: 312,
                bgableId: 2,
                bgableType: 'Image',
                elements: [],
                tags: [3],
            }
        },
        elements: {
            1: {
                id: 1,
                designId: 1,
                elementableId: 1,
                elementableType: 'Shape',
                posX: 575,
                posY: 1100,
                zIndex: 1,
                transparency: 1,
            },
            2: {
                id: 2,
                designId: 1,
                elementableId: 1,
                elementableType: 'Text',
                posX: 800,
                posY: 1800,
                zIndex: 2,
                transparency: 1,
            },
            3: {
                id: 3,
                designId: 1,
                elementableId: 1,
                elementableType: 'Image',
                posX: 0,
                posY: 0,
                zIndex: 3,
                transparency: 0.5,
            },
        },
        shapes: {
            1: {
                id: 1,
                templateId: 1,
                width: 2000,
                height: 2000,
                color: '#c7d0d8',
            }
        },
        shapeTemplates: {
            1: {
                id: 1,
                type: 'Circle',
            },
            2: {
                id: 2,
                type: 'Rectangle',
            },
        },
        text: {
            1: {
                id: 1,
                fontFamily: 'Helvetica',
                fontSize: 300,
                fontWeight: 700,
                text: 'HAPPY\nGRADUATION!',
                color: '#000000',
            },
        },
        images: {
            1: {
                id: 1,
                imageableId: 1,
                imageableType: 'Stockphoto',
                width: 480,
                height: 480,
                cropX: -160,
                cropY: 0,
            },
        },
        stockphotos: {
            1: {
                id: 1,
                title: 'Graduation Hat Throw',
                description: 'Classic hat throw scene after graduation',
                thumbUrl: 'https://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/Hats_in_the_air_-_geograph.org.uk_-_1402099.jpg/120px-Hats_in_the_air_-_geograph.org.uk_-_1402099.jpg',
                Url: 'https://upload.wikimedia.org/wikipedia/commons/f/fd/Hats_in_the_air_-_geograph.org.uk_-_1402099.jpg',
                width: 640,
                height: 480,
            }
        },
        uploadedImages: {
            1: {
                id: 1,
                title: 'IMG_0829.JPG',
                uploaderId: 1,
                width: 800,
                height: 600,
            },
        },
        folders: {
            1: {
                id: 1,
                ownerId: 1,
                name: 'myDrafts',
            },
            2: {
                id: 2,
                ownerId: 2,
                name: 'Facebook stuff',
            }
        },
        tags: {
            1: {
                id: 1,
                name: 'Poster',
            },
            2: {
                id: 2,
                name: 'Business Card',
            },
            3: {
                id: 3,
                name: 'Facebook Cover',
            },
            4: {
                id: 4,
                name: 'Graduation Poster',
            },
        },
        designTags: {
            1: {
                designId: 1,
                tagId: 1,
            },
            2: {
                designId: 1,
                tagId: 4,
            },
            3: {
                designId: 2,
                tagId: 2,
            },
            4: {
                designId: 3,
                tagId: 3,
            },
        },
        likes: {
            1: {
                id: 1,
                userId: 2,
                likeableId: 1,
                likeableType: 'Design',
            },
            2: {
                id: 2,
                userId: 1,
                likeableId: 1,
                likeableType: 'Stockphoto',
            },
        },
    },
    session: {
        currentUser: 1,
    },
    ui: {
        UILoading: false,
    },
    errors: {
        userErrors: [],
        sessionErrors: ["Incorrect email or password, please try again"],
        postErrors: [],
    }
}

Do I want to simulate a single user's state when logged in ?

Clone this wiki locally