Eric Schubert 2 years ago
parent 3233d7ba07
commit 9c34edc1a2
No known key found for this signature in database
GPG Key ID: 1D346C019BD4BAA2
  1. 3
      frontend/src/app/shared/components/file-links/file-link-list/file-link-list.component.ts
  2. 4
      modules/storages/app/services/storages/file_link_sync_service.rb

@ -132,8 +132,7 @@ export class FileLinkListComponent extends UntilDestroyedMixin implements OnInit
}); });
this.allowEditing$ = this.currentUserService this.allowEditing$ = this.currentUserService
.hasCapabilities$('file_links/manage', (this.resource.project as unknown&{ id:string }).id) .hasCapabilities$('file_links/manage', (this.resource.project as unknown&{ id:string }).id);
.pipe(this.untilDestroyed());
} }
public removeFileLink(fileLink:IFileLink):void { public removeFileLink(fileLink:IFileLink):void {

@ -142,9 +142,11 @@ class Storages::FileLinkSyncService
# "24" => { "status" => "Forbidden", "statuscode" => 403 } # "24" => { "status" => "Forbidden", "statuscode" => 403 }
# In case of completely deleted file or other errors we might also get: # In case of completely deleted file or other errors we might also get:
# "24" = { "status" => "Not Found", "statuscode" => 404 } # "24" = { "status" => "Not Found", "statuscode" => 404 }
# rubocop:disable Metrics/AbcSize
def sync_single_file(file_link, origin_file_info_hash) def sync_single_file(file_link, origin_file_info_hash)
file_link.origin_mime_type = origin_file_info_hash["mimetype"] file_link.origin_mime_type = origin_file_info_hash["mimetype"]
file_link.origin_created_by_name = origin_file_info_hash["owner_name"] file_link.origin_created_by_name = origin_file_info_hash["owner_name"]
file_link.origin_last_modified_by_name = origin_file_info_hash["modifier_name"]
file_link.origin_name = origin_file_info_hash["name"] file_link.origin_name = origin_file_info_hash["name"]
file_link.origin_created_at = Time.zone.at(origin_file_info_hash["ctime"]) file_link.origin_created_at = Time.zone.at(origin_file_info_hash["ctime"])
file_link.origin_updated_at = Time.zone.at(origin_file_info_hash["mtime"]) file_link.origin_updated_at = Time.zone.at(origin_file_info_hash["mtime"])
@ -152,6 +154,8 @@ class Storages::FileLinkSyncService
file_link file_link
end end
# rubocop:enable Metrics/AbcSize
def set_error_for_file_links(storage_file_links) def set_error_for_file_links(storage_file_links)
@service_result.result += storage_file_links.each { |file_link| file_link.origin_permission = :error } @service_result.result += storage_file_links.each { |file_link| file_link.origin_permission = :error }
@service_result.success = false @service_result.success = false

Loading…
Cancel
Save