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 i.fa.fa-fw.fa-external-link-square.fa-rotate-180.linked-file-icon
| Imported from | Imported from
| |
a(ng-href='/project/{{openFile.linkedFileData.source_project_id}}') a(ng-href='/project/{{openFile.linkedFileData.source_project_id}}' target="_blank")
| {{ displayUrl(openFile.linkedFileData.source_project_id) }} | {{ openFile.linkedFileData.source_project_display_name }}
|  / {{ openFile.linkedFileData.source_entity_path.slice(1) }}, |  {{ openFile.linkedFileData.source_entity_path.slice(1) }},
| |
| at {{ openFile.created | formatDate:'h:mm a' }} {{ openFile.created | relativeDate }} | at {{ openFile.created | formatDate:'h:mm a' }} {{ openFile.created | relativeDate }}

View file

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