Skip to content

Commit 074f8e2

Browse files
committed
bug #3273 Show Created By for files and links list in Assets Library 4
1 parent d16dd9b commit 074f8e2

File tree

5 files changed

+13
-51
lines changed

5 files changed

+13
-51
lines changed

src/components/AssetsLibrary/GridView.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,11 @@
134134

135135
.assets-gridview-container-active {
136136
position: relative;
137+
}
138+
139+
:global {
140+
.user-block .tooltip-container {
141+
text-align: left;
142+
line-height: 20px;
143+
}
137144
}

src/config/constants.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,6 @@ export const LOAD_MEMBERS_PENDING = 'LOAD_MEMBERS_PENDING'
328328
export const LOAD_MEMBERS_SUCCESS = 'LOAD_MEMBERS_SUCCESS'
329329
export const LOAD_MEMBERS_FAILURE = 'LOAD_MEMBERS_FAILURE'
330330

331-
export const LOAD_ASSETS_MEMBERS = 'LOAD_ASSETS_MEMBERS'
332-
export const LOAD_ASSETS_MEMBERS_PENDING = 'LOAD_ASSETS_MEMBERS_PENDING'
333-
export const LOAD_ASSETS_MEMBERS_SUCCESS = 'LOAD_ASSETS_MEMBERS_SUCCESS'
334-
export const LOAD_ASSETS_MEMBERS_FAILURE = 'LOAD_ASSETS_MEMBERS_FAILURE'
335-
336331
export const LOAD_MEMBER_SUGGESTIONS = 'LOAD_MEMBER_SUGGESTIONS'
337332
export const LOAD_MEMBER_SUGGESTIONS_PENDING = 'LOAD_MEMBER_SUGGESTIONS_PENDING'
338333
export const LOAD_MEMBER_SUGGESTIONS_SUCCESS = 'LOAD_MEMBER_SUGGESTIONS_SUCCESS'

src/projects/actions/project.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
import {
2222
createTimeline,
2323
} from '../../api/timelines'
24-
import { getMembersById } from '../../api/projectMembers'
2524
// import { loadProductTimelineWithMilestones } from './productsTimelines'
2625
import {
2726
LOAD_PROJECT,
@@ -45,7 +44,6 @@ import {
4544
PHASE_STATUS_ACTIVE,
4645
PHASE_DIRTY,
4746
PHASE_DIRTY_UNDO,
48-
LOAD_ASSETS_MEMBERS,
4947
PROJECT_STATUS_IN_REVIEW,
5048
PHASE_STATUS_REVIEWED,
5149
PROJECT_STATUS_REVIEWED,
@@ -333,25 +331,6 @@ export function updateProject(projectId, updatedProps, updateExisting = false) {
333331
}
334332
}
335333

336-
export function loadAssetsMembers(userIds) {
337-
return (dispatch, getState) => {
338-
// check if we need to request data from server
339-
const assetsMembers = getState().projectState.assetsMembers
340-
// this returns ids from userIds that are not in store (members)
341-
const missingUsers = _.difference(userIds, _.keys(assetsMembers))
342-
// dispatch request to load members if we are missing data
343-
if (missingUsers.length) {
344-
return dispatch({
345-
type: LOAD_ASSETS_MEMBERS,
346-
payload: getMembersById(userIds)
347-
})
348-
} else {
349-
// returns empty resolved promise to avoid error when we call then on this action
350-
return Promise.resolve()
351-
}
352-
}
353-
}
354-
355334
export function createScopeChangeRequest(projectId, request) {
356335
const flatNewScope = flatten(request.newScope, { safe: true })
357336
const emptyKeys = _.keys(flatNewScope).filter(key => {

src/projects/detail/containers/AssetsInfoContainer.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import moment from 'moment'
99
import LinksGridView from '../../../components/AssetsLibrary/LinksGridView'
1010
import FilesGridView from '../../../components/AssetsLibrary/FilesGridView'
1111
import AssetsStatistics from '../../../components/AssetsLibrary/AssetsStatistics'
12-
import { updateProject, deleteProject, loadAssetsMembers } from '../../actions/project'
12+
import { updateProject, deleteProject } from '../../actions/project'
13+
import { loadMembers } from '../../../actions/members'
1314
import { loadDashboardFeeds, loadProjectMessages } from '../../actions/projectTopics'
1415
import { loadTopic } from '../../../actions/topics'
1516
import { loadProjectPlan } from '../../actions/projectPlan'
@@ -397,7 +398,7 @@ class AssetsInfoContainer extends React.Component {
397398
const { project, currentMemberRole, isSuperUser, phases, feeds,
398399
isManageUser, phasesTopics, projectTemplates, hideLinks,
399400
attachmentsAwaitingPermission, addProjectAttachment, discardAttachments, attachmentPermissions,
400-
changeAttachmentPermission, projectMembers, loggedInUser, isSharingAttachment, canAccessPrivatePosts, loadAssetsMembers, assetsMembers } = this.props
401+
changeAttachmentPermission, projectMembers, loggedInUser, isSharingAttachment, canAccessPrivatePosts, loadMembers, assetsMembers } = this.props
401402
const { ifModalOpen } = this.state
402403

403404
const canManageLinks = !!currentMemberRole || isSuperUser
@@ -503,7 +504,7 @@ class AssetsInfoContainer extends React.Component {
503504
userIds = _.union(userIds, [_.parseInt(userId)])
504505
})
505506
_.remove(userIds, i => !i)
506-
loadAssetsMembers(userIds)
507+
loadMembers(userIds)
507508

508509
const assetsData = []
509510
enableFileUpload && assetsData.push({name: 'Files', total: _.toString(attachments.length)})
@@ -673,13 +674,13 @@ const mapStateToProps = ({ templates, projectState, members, loadUser }) => {
673674
attachmentPermissions: projectState.attachmentPermissions,
674675
isSharingAttachment: projectState.processingAttachments,
675676
projectMembers: _.keyBy(projectMembers, 'userId'),
676-
assetsMembers: _.keyBy(projectState.assetsMembers, 'userId'),
677+
assetsMembers: _.keyBy(members.members, 'userId'),
677678
loggedInUser: loadUser.user,
678679
canAccessPrivatePosts
679680
})
680681
}
681682

682-
const mapDispatchToProps = { updateProject, deleteProject, loadAssetsMembers, addProjectAttachment, updateProjectAttachment,
683+
const mapDispatchToProps = { updateProject, deleteProject, loadMembers, addProjectAttachment, updateProjectAttachment,
683684
loadProjectMessages, discardAttachments, uploadProjectAttachments, loadDashboardFeeds, loadTopic, changeAttachmentPermission,
684685
removeProjectAttachment, loadProjectPlan, saveFeedComment }
685686

src/projects/reducers/project.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
ACCEPT_OR_REFUSE_INVITE_SUCCESS, ACCEPT_OR_REFUSE_INVITE_FAILURE, ACCEPT_OR_REFUSE_INVITE_PENDING, RELOAD_PROJECT_MEMBERS_SUCCESS,
2424
UPLOAD_PROJECT_ATTACHMENT_FILES, DISCARD_PROJECT_ATTACHMENT, CHANGE_ATTACHMENT_PERMISSION,
2525
CREATE_SCOPE_CHANGE_REQUEST_SUCCESS, APPROVE_SCOPE_CHANGE_SUCCESS, REJECT_SCOPE_CHANGE_SUCCESS, CANCEL_SCOPE_CHANGE_SUCCESS, ACTIVATE_SCOPE_CHANGE_SUCCESS,
26-
LOAD_ASSETS_MEMBERS_SUCCESS, LOAD_ASSETS_MEMBERS_PENDING, LOAD_ASSETS_MEMBERS_FAILURE, CONNECT_USER, CONNECT_USER_HANDLE
2726
} from '../../config/constants'
2827
import _ from 'lodash'
2928
import update from 'react-addons-update'
@@ -441,25 +440,6 @@ export const projectState = function (state=initialState, action) {
441440
})
442441
}
443442

444-
case LOAD_ASSETS_MEMBERS_SUCCESS: {
445-
const _members = _.map(_.filter(action.payload, m => m.userId), m => {
446-
if (m.handle) {
447-
return m
448-
}
449-
return { userId: m.userId, ...CONNECT_USER, handle: CONNECT_USER_HANDLE }
450-
})
451-
const userMap = _.keyBy(_members, 'userId')
452-
// merge the 2 data sets
453-
return Object.assign({}, state, {
454-
processing: false,
455-
assetsMembers: update(state.assetsMembers, {$merge: userMap}),
456-
})
457-
}
458-
459-
case LOAD_ASSETS_MEMBERS_PENDING:
460-
case LOAD_ASSETS_MEMBERS_FAILURE:
461-
return state
462-
463443
case DELETE_PROJECT_PHASE_SUCCESS: {
464444
const { phaseId } = action.payload
465445

0 commit comments

Comments
 (0)