Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
lmmrssa committed Jun 12, 2021
1 parent 248accc commit f10b1e1
Show file tree
Hide file tree
Showing 23 changed files with 29 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const getControllerUser = (req, res) => {
})
.catch((err) => res.json({ err }).status(400))
}

// @desc Add individual collection user
const addCollectionUser = async (req, res) => {
const { userId, collectionId } = req.body
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion api/src/helpers/filehelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const upload = multer({
}
})

const multipleUpload = upload.fields([{ name: 'file' }, { name: 'attachment' }])
const multipleUpload = upload.fields([{ name: 'file' }, { name: 'attachment' }, { name: 'avatar' }])

const uploadArray = multer({ storage }).array('files')

Expand Down
1 change: 0 additions & 1 deletion api/src/models/collectionModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const Collection = db.define(

Collection.associate = function (models) {
Collection.hasMany(models.CollectionUser, {
as: 'collectionInfo',
foreignKey: 'collectionId'
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ const CollectionUser = db.define('collection_user',

CollectionUser.associate = (models) => {
CollectionUser.belongsTo(models.User, {
as: 'userfollower',
foreignKey: 'userId'
})
CollectionUser.belongsTo(models.Collection, {
as: 'collectionInfo',
foreignKey: 'collectionId'
})
}
Expand Down
2 changes: 0 additions & 2 deletions api/src/models/resourceModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ const Resources = db.define('resources',

Resources.associate = function (models) {
Resources.hasMany(models.ResourceUser, {
as: 'resourceInfo',
foreignKey: 'resourceId'

})
}

Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions api/src/models/userModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ const User = db.define('users', {

User.associate = function (models) {
User.hasMany(models.CollectionUser, {
as: 'userfollower',
foreignKey: 'userId'
})
}
User.associate = function (models) {
User.hasMany(models.ResourceUser, {
as: 'userfollower',
foreignKey: 'userId'
})
}
Expand Down
File renamed without changes.
File renamed without changes.
21 changes: 2 additions & 19 deletions src/Components/CollectionModal/CollectionModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,30 +71,13 @@ const CollectionModal = ({ setActive, openAddCollection, name }) => {
</>
: <>
<div className='collection-input-container'>
<input className='default-input-variation' placeholder='Collection title' /> <br />
<input className='default-input-variation' error={collectionTitleError} onChange={(e) => collectionTitleChange(e)} placeholder='Collection title' /> <br />
<SimpleFilter data={collectionFilterData} />
</div>
<div className='add-collection' onClick={() => openAddCollection()}><img src='/img/plus.svg' alt='Add Files' /><button>{name || 'Add files'}</button></div>
<button className='default-btn btn-size' onClick={() => openAddCollection()}>Create new collection</button>
<button className='default-btn btn-size' onClick={handleAddCollection}>Create new collection</button>
</>}
</div>
<DragDrop onChange={setFiles} />
{pathname === '/library'
? <>
<div className='collection-input-container'>
<input className='default-input-variation' error={resourceTitleError} onChange={(e) => resourceTitleChange(e)} placeholder='Resource title' /><br />
<input className='default-input-variation text-area-variation' error={resourceDescriptionError} onChange={(e) => resourceDescriptionChange(e)} placeholder='Resource description' /><br />
</div>
<button className='default-btn btn-size' onClick={handleAddResource}>Submit</button>
</>
: <>
<div className='collection-input-container'>
<input className='default-input-variation' error={collectionTitleError} onChange={(e) => collectionTitleChange(e)} placeholder='Collection title' /> <br />
<SimpleFilter data={collectionFilterData} />
</div>
<div className='add-collection' onClick={() => openAddCollection()}><img src='/img/plus.svg' alt='Add Files' /><button>{name || 'Add files'}</button></div>
<button className='default-btn btn-size' onClick={handleAddCollection}>Create new collection</button>
</>}
</div>
</div>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
}

.collection-modal-container > div {
/* width: 100%; */
height: 80%;
width: 100%;
height: 100%;
position: relative;
overflow-y: scroll;
margin-bottom: 100px;
Expand Down Expand Up @@ -58,7 +58,7 @@

.drag-drop-container {
width: 100%;
height: 30%;
height: 100%;
position: relative;
margin-bottom: 40px;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Components/GroupUsers/GroupUsers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ const GroupUsers = ({ data }) => {
<>
{

data && data.map(d => (
data && data.map(user => (
<div className='group-user-container'>
<div>
<div className='img-wrapper'>
<img src='/img/avatar-msg.svg' alt='users' />
<img src={user.image} alt='users' />
</div>
<h4>{d.name && d.name}</h4>
<h4>{user.name && user.name}</h4>
</div>
<Radiobox />
</div>
Expand Down
5 changes: 2 additions & 3 deletions src/Components/libraryCard/LibraryCard.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect } from 'react'
import './library-card.css'
import './LibraryCard.css'
import { listResourceUser } from '../../actions/resourceUserAction'
import { useSelector, useDispatch } from 'react-redux'

Expand All @@ -12,13 +12,12 @@ const LibraryCard = ({ data }) => {
return (
<div
key={item.id} className='libraryCard-inner-container' style={{
backgroundImage: 'url(/img/man-cap.svg)',
backgroundImage: `url(${item.img})`,
backgroundPosition: 'center',
backgroundSize: 'cover',
backgroundRepeat: 'no-repeat'
}}
>

<button className='trasnsparent-btn positioning'><img src='/img/trash-outline.svg' alt='trash-icon' /> <span>Remove from library</span></button>
<div className='libraryCard-content'>
<h6>{item.category}</h6>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/listView/ListView.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react'
import './listview.css'
import './ListView.css'
import { useParams } from 'react-router-dom'
import { useDispatch, useSelector } from 'react-redux'
import { createResourceUser } from '../../actions/resourceUserAction'
Expand Down
14 changes: 7 additions & 7 deletions src/Screens/Library/collection/Collection.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { useState, useEffect } from 'react'
import CollectionModal from '../../../Components/CollectionModal/CollectionModal'
import GroupModal from '../../../Components/GroupModal/GroupModal'
import LibraryCard from '../../../Components/LibraryCard/LibraryCard'
import LibraryHeader from '../../../Components/LibraryHeader/LibraryHeader'
import LibraryCard from '../../../Components/libraryCard/LibraryCard'
import LibraryHeader from '../../../Components/libraryHeader/LibraryHeader'
import SimpleModal from '../../../Components/SimpleModal/SimpleModal'
import DashboardLayout from '../../../Layout/DashboardLayout/DashboardLayout'
import { groupCollection, collections } from '../CollectionData'
import { groupCollection, collections, library } from '../CollectionData'
import { useSelector, useDispatch } from 'react-redux'
import { listResourceUser } from '../../../actions/resourceUserAction'
import Pagination from '../../../Components/Paginations/Paginations'
import Pagination from '../../../Components/pagination/Pagination'
import { listResources } from '../../../actions/resourceActions'

import './collection.css'
import './Collection.css'

const Collection = () => {
const [newCollection, setNewCollection] = useState(false)
Expand Down Expand Up @@ -63,13 +63,13 @@ const Collection = () => {
<div className='library-collection'>
<h4>My library (files)</h4>

<LibraryCard />
<LibraryCard data={library} />

{/* <Pagination pageNumber={pageNumber} setPageNumber={setPageNumber} resourceList={resourceList} /> */}
</div>
<div className='library-collection'>
<h4>My Collections</h4>
<LibraryCard />
<LibraryCard data={collections}/>
</div>
</DashboardLayout>
</>
Expand Down
10 changes: 5 additions & 5 deletions src/Screens/Library/savedCollection/SavedCollection.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useState, useEffect } from 'react'
import CollectionModal from '../../../Components/CollectionModal/CollectionModal'
import GroupModal from '../../../Components/GroupModal/GroupModal'
import LibraryCard from '../../../Components/LibraryCard/LibraryCard'
import LibraryHeader from '../../../Components/LibraryHeader/LibraryHeader'
import LibraryCard from '../../../Components/libraryCard/LibraryCard'
import LibraryHeader from '../../../Components/libraryHeader/LibraryHeader'
import DashboardLayout from '../../../Layout/DashboardLayout/DashboardLayout'
import './saved-collection.css'
import './SavedCollection.css'
import { groupCollection, collections, library } from '../CollectionData'
import SimpleModal from '../../../Components/SimpleModal/SimpleModal'
import { useSelector, useDispatch } from 'react-redux'
Expand Down Expand Up @@ -47,11 +47,11 @@ const SavedCollection = () => {
</div>
<div className='library-collection'>
<h4>Farming Collections</h4>
<LibraryCard />
<LibraryCard data={library} />
</div>
<div className='library-collection'>
<h4>Branding Collections</h4>
<LibraryCard />
<LibraryCard data={collections} />
</div>
</DashboardLayout>
</>
Expand Down
8 changes: 4 additions & 4 deletions src/Screens/Library/userCollection/UserCollection.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState, useEffect } from 'react'
import './user-collection.css'
import './UserCollection.css'

import LibraryHeader from '../../../Components/LibraryHeader/LibraryHeader'
import LibraryHeader from '../../../Components/libraryHeader/LibraryHeader'
import DashboardLayout from '../../../Layout/DashboardLayout/DashboardLayout'
import CollectionModal from '../../../Components/CollectionModal/CollectionModal'
import SimpleModal from '../../../Components/SimpleModal/SimpleModal'
Expand All @@ -10,7 +10,7 @@ import GroupModal from '../../../Components/GroupModal/GroupModal'
import { useSelector, useDispatch } from 'react-redux'
import { listCollections, updateCollection } from '../../../actions/collectionActions'
import { createCollectionUser } from '../../../actions/collectionUserActions'
import Pagination from '../../../Components/Paginations/Paginations'
import Pagination from '../../../Components/pagination/Pagination'

const UserCollection = () => {
const [active, setActive] = useState(true)
Expand Down Expand Up @@ -71,7 +71,7 @@ const UserCollection = () => {
{
data && data.map(item => {
return (
<div key={item.id} className='farming-inner-container' style={{ backgroundImage: 'url(/img/farming.svg)' }}>
<div key={item.id} className='farming-inner-container' style={{ backgroundImage: `url(${item.img})` }}>
<button className='trasnsparent-btn btn-positioning'>
<b>{item.users}</b> <span>users saved</span>
</button>
Expand Down

0 comments on commit f10b1e1

Please sign in to comment.