From d5a18012ff120c7a589bc78b8fba243d45536317 Mon Sep 17 00:00:00 2001 From: Andrei Kolchanov Date: Thu, 1 Apr 2021 19:35:22 +0500 Subject: [PATCH 01/15] 3.12.0 --- Directory.Build.props | 2 +- src/VirtoCommerce.SubscriptionModule.Web/module.manifest | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 5102c38..6ad8e9e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.11.0 + 3.12.0 $(VersionSuffix)-$(BuildNumber) diff --git a/src/VirtoCommerce.SubscriptionModule.Web/module.manifest b/src/VirtoCommerce.SubscriptionModule.Web/module.manifest index 0e566ad..cef8835 100644 --- a/src/VirtoCommerce.SubscriptionModule.Web/module.manifest +++ b/src/VirtoCommerce.SubscriptionModule.Web/module.manifest @@ -1,7 +1,7 @@  VirtoCommerce.Subscription - 3.11.0 + 3.12.0 3.47.0 Subscription module From d734393bf097cb9db454bf2564470784f84b29d6 Mon Sep 17 00:00:00 2001 From: Alexandr Morogov <42555001+krankenbro@users.noreply.github.com> Date: Thu, 8 Apr 2021 10:59:11 +0200 Subject: [PATCH 02/15] PT-670: Fix filter icon (#54) --- .../Scripts/blades/filter-detail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VirtoCommerce.SubscriptionModule.Web/Scripts/blades/filter-detail.js b/src/VirtoCommerce.SubscriptionModule.Web/Scripts/blades/filter-detail.js index 874c2de..1c0541c 100644 --- a/src/VirtoCommerce.SubscriptionModule.Web/Scripts/blades/filter-detail.js +++ b/src/VirtoCommerce.SubscriptionModule.Web/Scripts/blades/filter-detail.js @@ -64,7 +64,7 @@ angular.module('virtoCommerce.subscriptionModule') return !angular.equals(blade.currentEntity, blade.origEntity); }; - blade.headIcon = 'fa-filter'; + blade.headIcon = 'fa fa-filter'; blade.toolbarCommands = [ { From 1a5a8eb18b90d46fdba409ae73be7159d90d1959 Mon Sep 17 00:00:00 2001 From: Andrei Kolchanov Date: Mon, 12 Apr 2021 10:40:00 +0500 Subject: [PATCH 03/15] PT-1022: Remove obsolete PolymorphicSubscriptionJsonConverter (#55) --- ...rtoCommerce.SubscriptionModule.Core.csproj | 2 +- ...rtoCommerce.SubscriptionModule.Data.csproj | 4 +- .../PolymorphicSubscriptionJsonConverter.cs | 41 ------------------- .../Module.cs | 7 ---- .../module.manifest | 2 +- 5 files changed, 4 insertions(+), 52 deletions(-) delete mode 100644 src/VirtoCommerce.SubscriptionModule.Web/JsonConverters/PolymorphicSubscriptionJsonConverter.cs diff --git a/src/VirtoCommerce.SubscriptionModule.Core/VirtoCommerce.SubscriptionModule.Core.csproj b/src/VirtoCommerce.SubscriptionModule.Core/VirtoCommerce.SubscriptionModule.Core.csproj index 813f1b1..b242811 100644 --- a/src/VirtoCommerce.SubscriptionModule.Core/VirtoCommerce.SubscriptionModule.Core.csproj +++ b/src/VirtoCommerce.SubscriptionModule.Core/VirtoCommerce.SubscriptionModule.Core.csproj @@ -8,6 +8,6 @@ - + \ No newline at end of file diff --git a/src/VirtoCommerce.SubscriptionModule.Data/VirtoCommerce.SubscriptionModule.Data.csproj b/src/VirtoCommerce.SubscriptionModule.Data/VirtoCommerce.SubscriptionModule.Data.csproj index b7426ba..cc89c70 100644 --- a/src/VirtoCommerce.SubscriptionModule.Data/VirtoCommerce.SubscriptionModule.Data.csproj +++ b/src/VirtoCommerce.SubscriptionModule.Data/VirtoCommerce.SubscriptionModule.Data.csproj @@ -13,7 +13,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/src/VirtoCommerce.SubscriptionModule.Web/JsonConverters/PolymorphicSubscriptionJsonConverter.cs b/src/VirtoCommerce.SubscriptionModule.Web/JsonConverters/PolymorphicSubscriptionJsonConverter.cs deleted file mode 100644 index 65d0136..0000000 --- a/src/VirtoCommerce.SubscriptionModule.Web/JsonConverters/PolymorphicSubscriptionJsonConverter.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Linq; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using VirtoCommerce.Platform.Core.Common; -using VirtoCommerce.SubscriptionModule.Core.Model; -using VirtoCommerce.SubscriptionModule.Core.Model.Search; - -namespace VirtoCommerce.SubscriptionModule.Web.JsonConverters -{ - public class PolymorphicSubscriptionJsonConverter : JsonConverter - { - private static Type[] _knowTypes = { typeof(Subscription), typeof(PaymentPlan), typeof(SubscriptionSearchCriteria) }; - - public override bool CanWrite => false; - public override bool CanRead => true; - - public override bool CanConvert(Type objectType) - { - return _knowTypes.Any(x => x.IsAssignableFrom(objectType)); - } - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - var obj = JObject.Load(reader); - - var tryCreateInstance = typeof(AbstractTypeFactory<>).MakeGenericType(objectType) - .GetMethods() - .FirstOrDefault(x => x.Name.EqualsInvariant("TryCreateInstance") && x.GetParameters().Length == 0); - var retVal = tryCreateInstance?.Invoke(null, null); - - serializer.Populate(obj.CreateReader(), retVal); - return retVal; - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/VirtoCommerce.SubscriptionModule.Web/Module.cs b/src/VirtoCommerce.SubscriptionModule.Web/Module.cs index 9408c8e..ec2e9a7 100644 --- a/src/VirtoCommerce.SubscriptionModule.Web/Module.cs +++ b/src/VirtoCommerce.SubscriptionModule.Web/Module.cs @@ -3,11 +3,9 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; using VirtoCommerce.NotificationsModule.Core.Services; using VirtoCommerce.NotificationsModule.TemplateLoader.FileSystem; using VirtoCommerce.OrdersModule.Core.Events; @@ -29,7 +27,6 @@ using VirtoCommerce.SubscriptionModule.Data.Notifications; using VirtoCommerce.SubscriptionModule.Data.Repositories; using VirtoCommerce.SubscriptionModule.Data.Services; -using VirtoCommerce.SubscriptionModule.Web.JsonConverters; namespace VirtoCommerce.SubscriptionModule.Web { @@ -107,10 +104,6 @@ public void PostInitialize(IApplicationBuilder appBuilder) notificationRegistrar.RegisterNotification().WithTemplatesFromPath(defaultTemplatesDirectory); notificationRegistrar.RegisterNotification().WithTemplatesFromPath(defaultTemplatesDirectory); - //Next lines allow to use polymorph types in API controller methods - var mvcJsonOptions = appBuilder.ApplicationServices.GetService>(); - mvcJsonOptions.Value.SerializerSettings.Converters.Add(new PolymorphicSubscriptionJsonConverter()); - using (var serviceScope = appBuilder.ApplicationServices.CreateScope()) { var subscriptionDbContext = serviceScope.ServiceProvider.GetRequiredService(); diff --git a/src/VirtoCommerce.SubscriptionModule.Web/module.manifest b/src/VirtoCommerce.SubscriptionModule.Web/module.manifest index cef8835..75a6369 100644 --- a/src/VirtoCommerce.SubscriptionModule.Web/module.manifest +++ b/src/VirtoCommerce.SubscriptionModule.Web/module.manifest @@ -3,7 +3,7 @@ VirtoCommerce.Subscription 3.12.0 - 3.47.0 + 3.51.0 Subscription module Represent recurrent subscriptions functionality From c5644d6f304a3bf58638499ef4e8511b962e13cf Mon Sep 17 00:00:00 2001 From: Egidijus Mazeika Date: Tue, 13 Apr 2021 18:45:13 +0300 Subject: [PATCH 04/15] PT-207: Enable Source link support --- ...rtoCommerce.SubscriptionModule.Core.csproj | 27 ++++--- ...rtoCommerce.SubscriptionModule.Data.csproj | 71 ++++++++++--------- .../module.manifest | 6 +- 3 files changed, 57 insertions(+), 47 deletions(-) diff --git a/src/VirtoCommerce.SubscriptionModule.Core/VirtoCommerce.SubscriptionModule.Core.csproj b/src/VirtoCommerce.SubscriptionModule.Core/VirtoCommerce.SubscriptionModule.Core.csproj index b242811..679f403 100644 --- a/src/VirtoCommerce.SubscriptionModule.Core/VirtoCommerce.SubscriptionModule.Core.csproj +++ b/src/VirtoCommerce.SubscriptionModule.Core/VirtoCommerce.SubscriptionModule.Core.csproj @@ -1,13 +1,18 @@ - - netcoreapp3.1 - true - 1591 - True - - - - - - + + netcoreapp3.1 + true + 1591 + True + true + true + true + snupkg + + + + + + + \ No newline at end of file diff --git a/src/VirtoCommerce.SubscriptionModule.Data/VirtoCommerce.SubscriptionModule.Data.csproj b/src/VirtoCommerce.SubscriptionModule.Data/VirtoCommerce.SubscriptionModule.Data.csproj index cc89c70..484bcd3 100644 --- a/src/VirtoCommerce.SubscriptionModule.Data/VirtoCommerce.SubscriptionModule.Data.csproj +++ b/src/VirtoCommerce.SubscriptionModule.Data/VirtoCommerce.SubscriptionModule.Data.csproj @@ -1,35 +1,40 @@ - - netcoreapp3.1 - true - 1591 - latest - True - - - 1701;1702;1705;1591 - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - + + netcoreapp3.1 + true + 1591 + latest + True + true + true + true + snupkg + + + 1701;1702;1705;1591 + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + \ No newline at end of file diff --git a/src/VirtoCommerce.SubscriptionModule.Web/module.manifest b/src/VirtoCommerce.SubscriptionModule.Web/module.manifest index 75a6369..2cde986 100644 --- a/src/VirtoCommerce.SubscriptionModule.Web/module.manifest +++ b/src/VirtoCommerce.SubscriptionModule.Web/module.manifest @@ -1,4 +1,4 @@ - + VirtoCommerce.Subscription 3.12.0 @@ -16,7 +16,7 @@ https://virtocommerce.com/apps/extensions/subscriptions-module Modules/$(VirtoCommerce.Subscription)/Content/logo.png false - Copyright © 2020 Virto Commerce. All rights reserved + Copyright © 2020-2021 Virto Commerce. All rights reserved subscriptions system VirtoCommerce.SubscriptionModule.Web.dll VirtoCommerce.SubscriptionModule.Web.Module, VirtoCommerce.SubscriptionModule.Web @@ -31,4 +31,4 @@ commerce false - \ No newline at end of file + From 23b20753ac81f15bac655b538be1f812e54f256a Mon Sep 17 00:00:00 2001 From: Andrei Kolchanov Date: Wed, 14 Apr 2021 16:28:56 +0500 Subject: [PATCH 05/15] PT-1162: Remove redundant "Subscription ends after number of Orders" and "Grace Period" fields (#56) --- .../Localizations/de.VirtoCommerce.Subscription.json | 4 +--- .../Localizations/en.VirtoCommerce.Subscription.json | 4 +--- .../Localizations/ru.VirtoCommerce.Subscription.json | 4 +--- .../Scripts/blades/schedule-detail.tpl.html | 12 ------------ 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/VirtoCommerce.SubscriptionModule.Web/Localizations/de.VirtoCommerce.Subscription.json b/src/VirtoCommerce.SubscriptionModule.Web/Localizations/de.VirtoCommerce.Subscription.json index fef4366..0ced6a2 100644 --- a/src/VirtoCommerce.SubscriptionModule.Web/Localizations/de.VirtoCommerce.Subscription.json +++ b/src/VirtoCommerce.SubscriptionModule.Web/Localizations/de.VirtoCommerce.Subscription.json @@ -54,9 +54,7 @@ "subtitle-new": "Neue automatische Erstellung Auftragsablaufplan", "labels": { "charge-every": "Bestellen jede", - "trial-period": "Zeitraum (Tage)", - "charge-count": "Abonnement endet nach Anzahl der Bestellungen", - "grace-period": "Frist (in Tagen)" + "trial-period": "Zeitraum (Tage)" }, "placeholders": { "select": "Wählen Sie aus..." diff --git a/src/VirtoCommerce.SubscriptionModule.Web/Localizations/en.VirtoCommerce.Subscription.json b/src/VirtoCommerce.SubscriptionModule.Web/Localizations/en.VirtoCommerce.Subscription.json index 4825109..aff52a5 100644 --- a/src/VirtoCommerce.SubscriptionModule.Web/Localizations/en.VirtoCommerce.Subscription.json +++ b/src/VirtoCommerce.SubscriptionModule.Web/Localizations/en.VirtoCommerce.Subscription.json @@ -55,9 +55,7 @@ "subtitle-new": "Create new auto-order schedule", "labels": { "charge-every": "Order every", - "trial-period": "Trial period (days)", - "charge-count": "Subscription ends after number of Orders", - "grace-period": "Grace period (days)" + "trial-period": "Trial period (days)" }, "placeholders": { "select": "Select..." diff --git a/src/VirtoCommerce.SubscriptionModule.Web/Localizations/ru.VirtoCommerce.Subscription.json b/src/VirtoCommerce.SubscriptionModule.Web/Localizations/ru.VirtoCommerce.Subscription.json index c9984f8..f41ae6a 100644 --- a/src/VirtoCommerce.SubscriptionModule.Web/Localizations/ru.VirtoCommerce.Subscription.json +++ b/src/VirtoCommerce.SubscriptionModule.Web/Localizations/ru.VirtoCommerce.Subscription.json @@ -55,9 +55,7 @@ "subtitle-new": "Создать новое расписание", "labels": { "charge-every": "Заказ каждые", - "trial-period": "Пробный период (дней)", - "charge-count": "Подписка заканчивается после количества Заказов", - "grace-period": "Льготный период (дней)" + "trial-period": "Пробный период (дней)" }, "placeholders": { "select": "Выбрать..." diff --git a/src/VirtoCommerce.SubscriptionModule.Web/Scripts/blades/schedule-detail.tpl.html b/src/VirtoCommerce.SubscriptionModule.Web/Scripts/blades/schedule-detail.tpl.html index 993b5fa..cc1aca4 100644 --- a/src/VirtoCommerce.SubscriptionModule.Web/Scripts/blades/schedule-detail.tpl.html +++ b/src/VirtoCommerce.SubscriptionModule.Web/Scripts/blades/schedule-detail.tpl.html @@ -34,18 +34,6 @@ -
- -
- -
-
-
- -
- -
-
From 7b026abd8f2ef8b31a458ddfb37622b080da43ea Mon Sep 17 00:00:00 2001 From: vc-ci Date: Wed, 9 Jun 2021 15:37:20 +0000 Subject: [PATCH 06/15] Updating Github Action workflows. --- .github/workflows/deploy-pr.yml | 42 ++++++++++++++++++ .github/workflows/deploy.yml | 78 +++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 14 ++++-- 3 files changed, 130 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/deploy-pr.yml create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy-pr.yml b/.github/workflows/deploy-pr.yml new file mode 100644 index 0000000..28e5628 --- /dev/null +++ b/.github/workflows/deploy-pr.yml @@ -0,0 +1,42 @@ +# v1.0 + +name: Deploy to environments +on: + pull_request: + paths-ignore: + - '.github/**' + - 'docs/**' + - 'build/**' + - 'README.md' + - 'LICENSE' + branches: [dev] + types: [labeled, closed] + +jobs: + deploy: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} + + steps: + + - name: Read deployment config + if: contains(github.event.pull_request.labels.*.name, 'deploy-dev') + uses: VirtoCommerce/vc-github-actions/get-deploy-param@master + id: deployConfig + + - name: Gets artifact link + if: contains(github.event.pull_request.labels.*.name, 'deploy-dev') + uses: VirtoCommerce/vc-github-actions/get-artifact-link@master + id: artifactLink + + - name: Create deploy PR in DEV + if: github.event.action != 'closed' && contains(github.event.pull_request.labels.*.name, 'deploy-dev') + uses: VirtoCommerce/vc-github-actions/create-deploy-pr@master + with: + deployRepo: ${{ steps.deployConfig.outputs.deployRepo }} + deployBranch: ${{ fromJSON(steps.deployConfig.outputs.deployConfig).dev.deployBranch }} + artifactKey: ${{ steps.deployConfig.outputs.artifactKey }} + artifactUrl: ${{ steps.artifactLink.outputs.artifactUrl }} + taskNumber: ${{ steps.artifactLink.outputs.qaTaskNumber }} + cmPath: ${{ steps.deployConfig.outputs.cmPath }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..0cf6499 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,78 @@ +# v1.0 + +name: VC deployment +on: + workflow_dispatch: + inputs: + artifactUrl: + description: 'Full link to artifact docker image or artifact download url' + required: true + deployBranch: + description: 'ArgoCd branch name' + required: true + default: 'dev' + +jobs: + cd: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} + + steps: + + - name: Read deployment config + uses: VirtoCommerce/vc-github-actions/get-deploy-param@master + id: deployConfig + with: + envName: ${{ github.event.inputs.deployBranch }} + + - name: Start deployment + uses: bobheadxi/deployments@master + id: deployment + with: + step: start + token: ${{ secrets.GITHUB_TOKEN }} + env: Development + no_override: false + + - name: Update deployment-cm + uses: VirtoCommerce/vc-github-actions/create-deploy-pr@master + with: + deployRepo: ${{ steps.deployConfig.outputs.deployRepo }} + deployBranch: ${{ steps.deployConfig.outputs.deployBranch }} + artifactKey: ${{ steps.deployConfig.outputs.artifactKey }} + artifactUrl: ${{ github.event.inputs.artifactUrl }} + taskNumber: "undefined" + forceCommit: "true" + cmPath: ${{ steps.deployConfig.outputs.cmPath }} + + - name: Wait for environment is up + shell: pwsh + timeout-minutes: 15 + run: | + do { + Start-Sleep -s 15 + $statusBage = (Invoke-WebRequest -Uri "https://argo.govirto.com/api/badge?name=${{ steps.deployConfig.outputs.deployAppName }}").Content + + $syncedAndHealthy = $statusBage.Contains('>Healthy<') -and $statusBage.Contains('>Synced<') + if (-not $syncedAndHealthy) { + Write-Host "Sync pending..." + } + } + while (-not $syncedAndHealthy) + - name: BUILD_STATE::successful + if: success() + run: echo "BUILD_STATE=successful" >> $GITHUB_ENV + + - name: BUILD_STATE::failed + if: failure() + run: echo "BUILD_STATE=failed" >> $GITHUB_ENV + + - name: Update GitHub deployment status + uses: bobheadxi/deployments@master + if: always() + with: + step: finish + token: ${{ secrets.GITHUB_TOKEN }} + status: ${{ job.status }} + deployment_id: ${{ steps.deployment.outputs.deployment_id }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5d28d5..d6b8235 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -# v1.1.3 +# v1.1.4 name: Module CI on: @@ -68,7 +68,6 @@ jobs: else echo "VERSION_SUFFIX=${{ steps.image.outputs.suffix }}" >> $GITHUB_ENV fi; - - name: Add version suffix if: ${{ github.ref != 'refs/heads/master' }} uses: VirtoCommerce/vc-github-actions/add-version-suffix@master @@ -100,7 +99,6 @@ jobs: uses: VirtoCommerce/vc-github-actions/publish-nuget@master - name: Publish to Blob - if: ${{ github.ref == 'refs/heads/dev' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master') }} id: blobRelease uses: VirtoCommerce/vc-github-actions/publish-blob-release@master with: @@ -134,4 +132,12 @@ jobs: moduleId: ${{ steps.image.outputs.moduleId }} moduleDescription: ${{ steps.image.outputs.moduleDescription }} projectUrl: ${{ steps.image.outputs.projectUrl }} - iconUrl: ${{ steps.image.outputs.iconUrl }} \ No newline at end of file + iconUrl: ${{ steps.image.outputs.iconUrl }} + + - name: Invoke Module deployment workflow + if: ${{ github.ref == 'refs/heads/master' }} + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: VC deployment + token: ${{ secrets.REPO_TOKEN }} + inputs: '{ "artifactUrl": "${{ steps.blobRelease.outputs.packageUrl }}", "deployBranch": "dev" }' From 678884bc470cc81ba674ed44f15a6f644b48bad8 Mon Sep 17 00:00:00 2001 From: vc-ci Date: Tue, 15 Jun 2021 07:25:17 +0000 Subject: [PATCH 07/15] Updating Github Action workflows. --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d6b8235..b174019 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -99,6 +99,7 @@ jobs: uses: VirtoCommerce/vc-github-actions/publish-nuget@master - name: Publish to Blob + if: ${{ github.ref == 'refs/heads/dev' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master') }} id: blobRelease uses: VirtoCommerce/vc-github-actions/publish-blob-release@master with: @@ -140,4 +141,4 @@ jobs: with: workflow: VC deployment token: ${{ secrets.REPO_TOKEN }} - inputs: '{ "artifactUrl": "${{ steps.blobRelease.outputs.packageUrl }}", "deployBranch": "dev" }' + inputs: '{ "artifactUrl": "https://github.com/${{ env.GITHUB_REPOSITORY }}/releases/download/${{ steps.image.outputs.shortVersion }}/${{ steps.image.outputs.moduleId }}_${{ steps.image.outputs.shortVersion }}.zip", "deployBranch": "dev" }' From 053158f91f498ef8d9a0ae827b8dd635e5daac02 Mon Sep 17 00:00:00 2001 From: vc-ci Date: Tue, 15 Jun 2021 08:21:22 +0000 Subject: [PATCH 08/15] Updating Github Action workflows. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b174019..c7e70ee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -141,4 +141,4 @@ jobs: with: workflow: VC deployment token: ${{ secrets.REPO_TOKEN }} - inputs: '{ "artifactUrl": "https://github.com/${{ env.GITHUB_REPOSITORY }}/releases/download/${{ steps.image.outputs.shortVersion }}/${{ steps.image.outputs.moduleId }}_${{ steps.image.outputs.shortVersion }}.zip", "deployBranch": "dev" }' + inputs: '{ "artifactUrl": "https://github.com/${{ github.repository }}/releases/download/${{ steps.image.outputs.shortVersion }}/${{ steps.image.outputs.moduleId }}_${{ steps.image.outputs.shortVersion }}.zip", "deployBranch": "dev" }' From 9dc9e5c642af5a4f5ee77c019e077ffcf317fa59 Mon Sep 17 00:00:00 2001 From: Konstantin Savosteev Date: Thu, 1 Jul 2021 12:42:05 +0200 Subject: [PATCH 09/15] PT-2765 Search orders by SubscriptionId on Refresh in Subscription's Orders blade (#59) * PT-2765 Search orders by subscriptionId on Refresh * PT-2765 fix smell * PT-2765 bump Order module dependency version --- .../widgets/subscription-orders-widget.js | 41 ++++++++++++------- .../module.manifest | 2 +- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/VirtoCommerce.SubscriptionModule.Web/Scripts/widgets/subscription-orders-widget.js b/src/VirtoCommerce.SubscriptionModule.Web/Scripts/widgets/subscription-orders-widget.js index 3a81327..5d90da9 100644 --- a/src/VirtoCommerce.SubscriptionModule.Web/Scripts/widgets/subscription-orders-widget.js +++ b/src/VirtoCommerce.SubscriptionModule.Web/Scripts/widgets/subscription-orders-widget.js @@ -1,19 +1,30 @@ angular.module('virtoCommerce.subscriptionModule') -.controller('virtoCommerce.subscriptionModule.subscriptionOrdersWidgetController', ['$scope', 'platformWebApp.bladeNavigationService', function ($scope, bladeNavigationService) { - var blade = $scope.blade; + .controller('virtoCommerce.subscriptionModule.subscriptionOrdersWidgetController', ['$scope', 'platformWebApp.bladeNavigationService', 'virtoCommerce.orderModule.order_res_customerOrders', + function ($scope, bladeNavigationService, orders) { + var blade = $scope.blade; - $scope.openBlade = function () { - if (!blade.isLoading) { - var newBlade = { - id: 'subscriptionOrders', - preloadedOrders: blade.currentEntity.customerOrders, - title: 'subscription.blades.subscriptionOrder-list.title', - controller: 'virtoCommerce.orderModule.customerOrderListController', - template: 'Modules/$(VirtoCommerce.Orders)/Scripts/blades/customerOrder-list.tpl.html', - hideDelete: true + $scope.openBlade = function () { + if (!blade.isLoading) { + var newBlade = { + id: 'subscriptionOrders', + title: 'subscription.blades.subscriptionOrder-list.title', + controller: 'virtoCommerce.orderModule.customerOrderListController', + template: 'Modules/$(VirtoCommerce.Orders)/Scripts/blades/customerOrder-list.tpl.html', + hideDelete: true + }; + + if (blade.currentEntity.id) { + newBlade.refreshCallback = function () { + var criteria = { + subscriptionIds: [blade.currentEntity.id] + }; + + return orders.search(criteria); + } + } + + bladeNavigationService.showBlade(newBlade, blade); + } }; - bladeNavigationService.showBlade(newBlade, blade); - } - }; -}]); + }]); diff --git a/src/VirtoCommerce.SubscriptionModule.Web/module.manifest b/src/VirtoCommerce.SubscriptionModule.Web/module.manifest index 2cde986..6317e64 100644 --- a/src/VirtoCommerce.SubscriptionModule.Web/module.manifest +++ b/src/VirtoCommerce.SubscriptionModule.Web/module.manifest @@ -22,7 +22,7 @@ VirtoCommerce.SubscriptionModule.Web.Module, VirtoCommerce.SubscriptionModule.Web - + From 3c9d4931451fa70126a89d0e9851d0c8c0bdfe14 Mon Sep 17 00:00:00 2001 From: vc-ci Date: Fri, 9 Jul 2021 16:59:14 +0000 Subject: [PATCH 10/15] Updating Github Action workflows. --- .github/workflows/msteams.yml | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/msteams.yml diff --git a/.github/workflows/msteams.yml b/.github/workflows/msteams.yml new file mode 100644 index 0000000..953c9fc --- /dev/null +++ b/.github/workflows/msteams.yml @@ -0,0 +1,54 @@ +name: Send message to Teams (regression PR) + +on: + pull_request: + branches: + [regression] + +jobs: + notify: + runs-on: ubuntu-latest + steps: + + - name: Send a message to Microsoft Teams + uses: VirtoCommerce/vc-github-actions/msteams-send-message@master + with: + body: '{ + "@type": "MessageCard", + "@context": "http://schema.org/extensions", + "themeColor": "0076D7", + "summary": "On ${{github.repository}} repository", + "sections": [ + { + "activityTitle": "Regression PR created/updated", + "activitySubtitle": "By [${{ github.event.pull_request.user.login }}](${{ github.event.pull_request.user.url }}) on **[${{github.repository}}](${{github.server_url}}/${{github.repository}})** repository", + "activityImage":"${{ github.event.pull_request.user.avatar_url }}", + "facts": [ + { + "name": "Repository", + "value": "[${{github.repository}}](${{github.server_url}}/${{github.repository}})" + }, + { + "name": "Pull request", + "value": "[${{ github.event.pull_request.number }}](${{ github.event.pull_request._links.html.href }})" + }, + { + "name": "Pull request title", + "value": "${{ github.event.pull_request.title }}" + } + + ], + "markdown": true + } + ], + "potentialAction": [ { + "@type": "OpenUri", + "name": "View Pull Request", + "targets": [{ + "os": "default", + "uri": "${{ github.event.pull_request._links.html.href }}" + }] + }] + +}' # the body of the message + webhook_uri: ${{ secrets.PLATFORM_TEAMS_URI }} From b1111ffe461e9edf37449f8478d63b6f69f4ec22 Mon Sep 17 00:00:00 2001 From: vc-ci Date: Thu, 15 Jul 2021 08:17:40 +0000 Subject: [PATCH 11/15] Updating Github Action workflows. --- .github/pull_request_template.md | 6 ++++++ .github/workflows/deploy-pr.yml | 12 ++++++------ .github/workflows/main.yml | 11 +++++++++-- 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..bc91331 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,6 @@ +## Description + +## References +### QA-test: +### Jira-link: +### Artifact URL: diff --git a/.github/workflows/deploy-pr.yml b/.github/workflows/deploy-pr.yml index 28e5628..9128571 100644 --- a/.github/workflows/deploy-pr.yml +++ b/.github/workflows/deploy-pr.yml @@ -20,22 +20,22 @@ jobs: steps: - - name: Read deployment config - if: contains(github.event.pull_request.labels.*.name, 'deploy-dev') + - name: Read deployment config + if: contains(github.event.pull_request.labels.*.name, 'deploy-qa') uses: VirtoCommerce/vc-github-actions/get-deploy-param@master id: deployConfig - name: Gets artifact link - if: contains(github.event.pull_request.labels.*.name, 'deploy-dev') + if: contains(github.event.pull_request.labels.*.name, 'deploy-qa') uses: VirtoCommerce/vc-github-actions/get-artifact-link@master id: artifactLink - - name: Create deploy PR in DEV - if: github.event.action != 'closed' && contains(github.event.pull_request.labels.*.name, 'deploy-dev') + - name: Create deploy PR in QA + if: github.event.action != 'closed' && contains(github.event.pull_request.labels.*.name, 'deploy-qa') uses: VirtoCommerce/vc-github-actions/create-deploy-pr@master with: deployRepo: ${{ steps.deployConfig.outputs.deployRepo }} - deployBranch: ${{ fromJSON(steps.deployConfig.outputs.deployConfig).dev.deployBranch }} + deployBranch: ${{ fromJSON(steps.deployConfig.outputs.deployConfig).qa.deployBranch }} artifactKey: ${{ steps.deployConfig.outputs.artifactKey }} artifactUrl: ${{ steps.artifactLink.outputs.artifactUrl }} taskNumber: ${{ steps.artifactLink.outputs.qaTaskNumber }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c7e70ee..036cdef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -99,12 +99,19 @@ jobs: uses: VirtoCommerce/vc-github-actions/publish-nuget@master - name: Publish to Blob - if: ${{ github.ref == 'refs/heads/dev' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master') }} + if: ${{ github.ref == 'refs/heads/dev' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master') }} id: blobRelease uses: VirtoCommerce/vc-github-actions/publish-blob-release@master with: blobSAS: ${{ secrets.BLOB_TOKEN }} - + + - name: Add link to PR + if: ${{ github.event_name == 'pull_request' }} + uses: VirtoCommerce/vc-github-actions/publish-artifact-link@master + with: + artifactUrl: ${{ steps.blobRelease.outputs.packageUrl }} + downloadComment: 'Artifact URL:' + - name: Publish Github Release if: ${{ github.ref == 'refs/heads/master' }} with: From 7991d51a3c4115ea7037cf68b4eb585f106dca7a Mon Sep 17 00:00:00 2001 From: vc-ci Date: Thu, 15 Jul 2021 10:58:37 +0000 Subject: [PATCH 12/15] Updating Github Action workflows. --- .github/workflows/deploy-pr.yml | 37 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/deploy-pr.yml b/.github/workflows/deploy-pr.yml index 9128571..0f1059a 100644 --- a/.github/workflows/deploy-pr.yml +++ b/.github/workflows/deploy-pr.yml @@ -19,24 +19,23 @@ jobs: GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} steps: + - name: Read deployment config + if: contains(github.event.pull_request.labels.*.name, 'deploy-qa') + uses: VirtoCommerce/vc-github-actions/get-deploy-param@master + id: deployConfig - - name: Read deployment config - if: contains(github.event.pull_request.labels.*.name, 'deploy-qa') - uses: VirtoCommerce/vc-github-actions/get-deploy-param@master - id: deployConfig + - name: Gets artifact link + if: contains(github.event.pull_request.labels.*.name, 'deploy-qa') + uses: VirtoCommerce/vc-github-actions/get-artifact-link@master + id: artifactLink - - name: Gets artifact link - if: contains(github.event.pull_request.labels.*.name, 'deploy-qa') - uses: VirtoCommerce/vc-github-actions/get-artifact-link@master - id: artifactLink - - - name: Create deploy PR in QA - if: github.event.action != 'closed' && contains(github.event.pull_request.labels.*.name, 'deploy-qa') - uses: VirtoCommerce/vc-github-actions/create-deploy-pr@master - with: - deployRepo: ${{ steps.deployConfig.outputs.deployRepo }} - deployBranch: ${{ fromJSON(steps.deployConfig.outputs.deployConfig).qa.deployBranch }} - artifactKey: ${{ steps.deployConfig.outputs.artifactKey }} - artifactUrl: ${{ steps.artifactLink.outputs.artifactUrl }} - taskNumber: ${{ steps.artifactLink.outputs.qaTaskNumber }} - cmPath: ${{ steps.deployConfig.outputs.cmPath }} + - name: Create deploy PR in QA + if: github.event.action != 'closed' && contains(github.event.pull_request.labels.*.name, 'deploy-qa') + uses: VirtoCommerce/vc-github-actions/create-deploy-pr@master + with: + deployRepo: ${{ steps.deployConfig.outputs.deployRepo }} + deployBranch: ${{ fromJSON(steps.deployConfig.outputs.deployConfig).qa.deployBranch }} + artifactKey: ${{ steps.deployConfig.outputs.artifactKey }} + artifactUrl: ${{ steps.artifactLink.outputs.artifactUrl }} + taskNumber: ${{ steps.artifactLink.outputs.qaTaskNumber }} + cmPath: ${{ steps.deployConfig.outputs.cmPath }} From 28a6a1afc9117fd16ba193a1c3dbfedbd81dd4fd Mon Sep 17 00:00:00 2001 From: vc-ci Date: Thu, 15 Jul 2021 11:16:40 +0000 Subject: [PATCH 13/15] Updating Github Action workflows. --- .github/workflows/deploy-pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-pr.yml b/.github/workflows/deploy-pr.yml index 0f1059a..c7dac12 100644 --- a/.github/workflows/deploy-pr.yml +++ b/.github/workflows/deploy-pr.yml @@ -20,9 +20,9 @@ jobs: steps: - name: Read deployment config - if: contains(github.event.pull_request.labels.*.name, 'deploy-qa') - uses: VirtoCommerce/vc-github-actions/get-deploy-param@master - id: deployConfig + if: contains(github.event.pull_request.labels.*.name, 'deploy-qa') + uses: VirtoCommerce/vc-github-actions/get-deploy-param@master + id: deployConfig - name: Gets artifact link if: contains(github.event.pull_request.labels.*.name, 'deploy-qa') From 9bafc4bebb89bc00d465d4100c8f4cd1e2d8c60a Mon Sep 17 00:00:00 2001 From: vc-ci Date: Thu, 15 Jul 2021 15:40:18 +0000 Subject: [PATCH 14/15] Updating Github Action workflows. --- .github/workflows/deploy-pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-pr.yml b/.github/workflows/deploy-pr.yml index c7dac12..f3c3d26 100644 --- a/.github/workflows/deploy-pr.yml +++ b/.github/workflows/deploy-pr.yml @@ -28,6 +28,8 @@ jobs: if: contains(github.event.pull_request.labels.*.name, 'deploy-qa') uses: VirtoCommerce/vc-github-actions/get-artifact-link@master id: artifactLink + with: + downloadComment: 'Artifact URL:' - name: Create deploy PR in QA if: github.event.action != 'closed' && contains(github.event.pull_request.labels.*.name, 'deploy-qa') From c0b11a5776d364a599ab3b11e2d7e8f567dd9809 Mon Sep 17 00:00:00 2001 From: Adam Hanlin <11306076+adamhanlin@users.noreply.github.com> Date: Tue, 3 Aug 2021 03:55:30 -0400 Subject: [PATCH 15/15] Save mutated Subscriptions in CreateRecurrentOrdersJob (#61) Co-authored-by: Adam Hanlin --- .../BackgroundJobs/CreateRecurrentOrdersJob.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/VirtoCommerce.SubscriptionModule.Data/BackgroundJobs/CreateRecurrentOrdersJob.cs b/src/VirtoCommerce.SubscriptionModule.Data/BackgroundJobs/CreateRecurrentOrdersJob.cs index 8906e99..deda975 100644 --- a/src/VirtoCommerce.SubscriptionModule.Data/BackgroundJobs/CreateRecurrentOrdersJob.cs +++ b/src/VirtoCommerce.SubscriptionModule.Data/BackgroundJobs/CreateRecurrentOrdersJob.cs @@ -56,6 +56,7 @@ public async Task Process() await _customerOrderService.SaveChangesAsync(new[] { newOrder }); } } + await _subscriptionService.SaveSubscriptionsAsync(subscriptions); } } }