Skip to content

Commit

Permalink
Merge branch 'release/3.804.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vc-ci committed Mar 1, 2024
2 parents 78cf5e3 + 00cc207 commit f547a35
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 19 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/module-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# v3.800.2
# https://virtocommerce.atlassian.net/browse/VCST-349
# v3.800.3
# https://virtocommerce.atlassian.net/browse/VCST-570
name: Module CI

on:
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
run: vc-build Compress -skip Clean+Restore+Compile+Test

- name: Publish Nuget
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'workflow_dispatch' }}
if: ${{ github.ref == 'refs/heads/master' }}
uses: VirtoCommerce/vc-github-actions/publish-nuget@master

- name: Publish to Blob
Expand Down Expand Up @@ -192,13 +192,13 @@ jobs:
fi
- name: Setup Git Credentials
if: ${{ (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master') && github.event_name != 'workflow_dispatch' }}
if: ${{ (github.ref == 'refs/heads/dev' && github.event_name != 'workflow_dispatch') || github.ref == 'refs/heads/master' }}
uses: VirtoCommerce/vc-github-actions/setup-git-credentials-github@master
with:
githubToken: ${{ secrets.REPO_TOKEN }}

- name: Publish Manifest
if: ${{ (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master') && github.event_name != 'workflow_dispatch' }}
if: ${{ (github.ref == 'refs/heads/dev' && github.event_name != 'workflow_dispatch') || github.ref == 'refs/heads/master' }}
uses: VirtoCommerce/vc-github-actions/publish-manifest@master
with:
packageUrl: ${{ steps.artifactUrl.outputs.download_url }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/module-release-hotfix.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# v3.800.2
# https://virtocommerce.atlassian.net/browse/VCST-349
# v3.800.3
# https://virtocommerce.atlassian.net/browse/VCST-570
name: Release hotfix

on:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-nugets.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# v3.800.2
# https://virtocommerce.atlassian.net/browse/VCST-349
# v3.800.3
# https://virtocommerce.atlassian.net/browse/VCST-570
name: Publish nuget

on:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# v3.800.2
# https://virtocommerce.atlassian.net/browse/VCST-349
# v3.800.3
# https://virtocommerce.atlassian.net/browse/VCST-570
name: Release

on:
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<!-- These properties will be shared for all projects -->
<PropertyGroup>
<VersionPrefix>3.803.0</VersionPrefix>
<VersionPrefix>3.804.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -131,10 +132,10 @@ public async Task<ActionResult<BlobInfo[]>> UploadAssetAsync([FromQuery] string
if (url != null)
{
var fileName = name ?? HttpUtility.UrlDecode(Path.GetFileName(url));
var fileUrl = UrlHelpers.Combine(folderUrl ?? "", fileName);
var fileUrl = UrlHelpers.Combine(folderUrl ?? "", Uri.EscapeDataString(fileName));
using (var client = _httpClientFactory.CreateClient())
using (var blobStream = await _blobProvider.OpenWriteAsync(fileUrl))
using (var remoteStream = await client.GetStreamAsync(url))
using (var blobStream = await _blobProvider.OpenWriteAsync(fileUrl))
{
await remoteStream.CopyToAsync(blobStream);
var blobInfo = AbstractTypeFactory<BlobInfo>.TryCreateInstance();
Expand All @@ -157,7 +158,7 @@ public async Task<ActionResult<BlobInfo[]>> UploadAssetAsync([FromQuery] string
if (hasContentDispositionHeader && MultipartRequestHelper.HasFileContentDisposition(contentDisposition))
{
var fileName = contentDisposition.FileName.Value;
var targetFilePath = UrlHelpers.Combine(folderUrl ?? "", fileName);
var targetFilePath = UrlHelpers.Combine(folderUrl ?? "", Uri.EscapeDataString(fileName));

using (var targetStream = await _blobProvider.OpenWriteAsync(targetFilePath))
{
Expand All @@ -174,6 +175,10 @@ public async Task<ActionResult<BlobInfo[]>> UploadAssetAsync([FromQuery] string
}
}
}
catch (HttpRequestException ex)
{
return new ObjectResult(new { ex.Message }) { StatusCode = (int)ex.StatusCode };
}
catch (PlatformException exc)
{
return new ObjectResult(new { exc.Message }) { StatusCode = StatusCodes.Status405MethodNotAllowed };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ angular.module('virtoCommerce.assetsModule')
_.each(data.results, function (x) {
x.isImage = x.contentType && x.contentType.startsWith('image/');
if (x.isImage) {
x.noCacheUrl = `${x.url}?t=${x.modifiedDate}`;
const delimiter = x.url?.contains('?') ? '&' : '?';
x.noCacheUrl = `${x.url}${delimiter}t=${x.modifiedDate}`;
}
});
$scope.listEntries = data.results;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ angular.module('virtoCommerce.assetsModule')
blade.fileUploadOptions = {};
}
var folderUrl = blade.currentEntityId || "";
if (folderUrl.contains('?')) {
// Remove query string
folderUrl = folderUrl.substring(0, folderUrl.indexOf('?'));
}

function initialize() {
if (!$scope.uploader) {
Expand Down Expand Up @@ -50,7 +54,7 @@ angular.module('virtoCommerce.assetsModule')
}, function (error) {
bladeNavigationService.setError('Error ' + error.status, blade);
});

} else {
dialogService.showNotificationDialog({
id: "error",
Expand Down Expand Up @@ -99,7 +103,7 @@ angular.module('virtoCommerce.assetsModule')
$scope.addImageFromUrl = function () {
if (blade.newExternalImageUrl) {
blade.uploadCompleted = false;
if (folderUrl) {
if (folderUrl) {
assets.uploadFromUrl({ folderUrl: folderUrl, url: blade.newExternalImageUrl }, function (data) {
refreshParentBlade();
if (blade.onUploadComplete) {
Expand Down
2 changes: 1 addition & 1 deletion src/VirtoCommerce.AssetsModule.Web/module.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<id>VirtoCommerce.Assets</id>
<version>3.803.0</version>
<version>3.804.0</version>
<version-tag />
<platformVersion>3.800.0</platformVersion>
<dependencies />
Expand Down

0 comments on commit f547a35

Please sign in to comment.