Record the source project display name, to render with the file

This commit is contained in:
Shane Kilkelly 2018-05-16 13:44:21 +01:00
parent f533674dbd
commit 9624e2a290
2 changed files with 9 additions and 7 deletions

View file

@ -52,9 +52,9 @@ div.binary-file.full-size(
i.fa.fa-fw.fa-external-link-square.fa-rotate-180.linked-file-icon
| Imported from
|
a(ng-href='/project/{{openFile.linkedFileData.source_project_id}}')
| {{ displayUrl(openFile.linkedFileData.source_project_id) }}
|  / {{ openFile.linkedFileData.source_entity_path.slice(1) }},
a(ng-href='/project/{{openFile.linkedFileData.source_project_id}}' target="_blank")
| {{ openFile.linkedFileData.source_project_display_name }}
|  {{ openFile.linkedFileData.source_entity_path.slice(1) }},
|
| at {{ openFile.created | formatDate:'h:mm a' }} {{ openFile.created | relativeDate }}

View file

@ -302,17 +302,19 @@ define [
$timeout($scope.init, 100)
$scope.create = () ->
project = $scope.data.selectedProjectId
projectId = $scope.data.selectedProjectId
projectDisplayName = _.find($scope.data.projects, (p) -> p._id == projectId).name
path = $scope.data.selectedProjectEntity
name = $scope.data.name
if !name || !path || !project
if !name || !path || !projectId || !projectDisplayName
$scope._reset(err: true)
return
$scope._setInFlight('create')
ide.fileTreeManager
.createLinkedFile(name, parent_folder, 'project_file', {
source_project_id: project,
source_entity_path: path
source_project_id: projectId,
source_entity_path: path,
source_project_display_name: projectDisplayName
})
.then () ->
$scope._reset(err: false)