Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v4.1.1 #501

Merged
merged 10 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'type: chore': ['chore/*', 'renovate/*', 'chore(deps):*']
'type: ci': ci/*
'type: perf': perf/*
'type: refator': refactor/*
'type: test': test/*
'type: docs': docs/*
'type: bugfix': ['fix/*', 'bug/*', 'hotfix-backport/*']
'type: feature': ['feature/*', 'feat/*']
'type: security': ['security/*', 'dependabot/*']
'type: hotfix': 'hotfix/*'
'type: devx': 'devx/*'
25 changes: 24 additions & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,33 @@ name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

template: |
## Changes

$CHANGES

change-template: '- $TITLE'
### Contributors

$CONTRIBUTORS

categories:
- title: '🚀 New Features'
labels:
- 'type: feature'
- title: '🐛 Bug Fixes'
labels:
- 'type: bugfix'
- 'type: hotfix'

exclude-labels:
- 'skip-changelog'
- 'type: chore'
- 'type: ci'
- 'type: refactor'
- 'type: test'
- 'type: docs'
- 'type: security'
- 'type: devx'
change-template: '- $TITLE (#$NUMBER)'
change-title-escapes: '\<*_&#@`'
version-resolver:
major:
Expand Down
5 changes: 0 additions & 5 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
"matchManagers": ["dockerfile", "docker-compose"],
"groupName": "docker updates"
},
{
"matchManagers": ["github-actions"],
"matchPackageNames": ["LoveToKnow/slackify-markdown-action"],
"enabled": false
},
{
"description": "PHP, composer and Prestashop versions in Dockerfiles must be freezed",
"matchManagers": ["dockerfile"],
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/backport-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ jobs:
title: Backport main to develop
branch: chore/backport-main-to-develop
base: develop
labels: skip-changelog
16 changes: 16 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: PR Labeler
on:
pull_request:
types: [opened]

jobs:
pr-labeler:
permissions:
contents: read
pull-requests: write

runs-on: ubuntu-22.04
steps:
- uses: TimonVS/pr-labeler-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 7 additions & 6 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ jobs:
- name: Publish Github release
uses: actions/github-script@v7
with:
# target_commitish is set to refs/heads/develop by release-drafter as we need to retrieve pull requests merged into develop
# We need to override it to refs/heads/main to point to the last commit of main branch instead of develop branch
script: |
const { owner, repo } = context.repo;
await github.rest.repos.updateRelease({
Expand All @@ -95,12 +97,12 @@ jobs:
release_id: "${{ steps.fetch-release-draft.outputs.id }}",
draft: false,
make_latest: true,
tag_name: "${{ steps.fetch-release-draft.outputs.name }}"
tag_name: "${{ steps.fetch-release-draft.outputs.name }}",
target_commitish: "refs/heads/main"
});

- name: Format release notes for Slack
# v1.0.2 cannot be used as it is not correctly handling the newlines
uses: LoveToKnow/[email protected]
uses: LoveToKnow/[email protected]
id: slack-markdown-release-notes
with:
text: |
Expand All @@ -109,13 +111,12 @@ jobs:
${{ steps.fetch-release-draft.outputs.body }}

:warning: This release will be available on PrestaShop marketplace in a few hours
cc <@france.berut> <@khadija.cherif>

- name: Send changelog to Slack
uses: slackapi/[email protected]
with:
# TODO: Replace with channel #alma_changelog (id: CR9C57YM6) once full testing is done
# Channel `#devx-experiments`
channel-id: C04MQ9VEWRF
channel-id: CR9C57YM6
slack-message: ${{ steps.slack-markdown-release-notes.outputs.text }}
payload: |
{
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/release-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ jobs:
- name: Create release draft
uses: release-drafter/release-drafter@v6
id: release-drafter
with:
# release-drafter should be based on develop to get the correct content as pull requests are merged into develop
# Note that the target commitish of the release should be updated to refs/heads/main when published
# (Otherwise the tag will point to the last commit on develop branch instead of the last commit of main branch)
commitish: refs/heads/develop
env:
commitish: develop
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update CHANGELOG.md
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## v4.1.1 - 2024-07-10

### Changes

- fix: add insurance from cart page with multiple execution (#499)

#### Contributors

@Benjamin-Freoua-Alma, @carine-bonnafous and @github-actions

## v4.1.0 - 2024-07-08

- feat: Link your store with PS Account
Expand Down
4 changes: 2 additions & 2 deletions alma/alma.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

class Alma extends PaymentModule
{
const VERSION = '4.1.0';
const VERSION = '4.1.1';

public $_path;
public $local_path;
Expand Down Expand Up @@ -83,7 +83,7 @@ public function __construct()
{
$this->name = 'alma';
$this->tab = 'payments_gateways';
$this->version = '4.1.0';
$this->version = '4.1.1';
$this->author = 'Alma';
$this->need_instance = false;
$this->bootstrap = true;
Expand Down
67 changes: 35 additions & 32 deletions alma/views/js/alma-cart-insurance.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,42 +184,45 @@ function onloadInsuranceClickEvents() {
});

window.addEventListener('message', (e) => {
if (e.data.type === 'getSelectedInsuranceData') {
let idIframeModal = $('#' + e.data.idIframeModal);

if (e.data.selectedInsuranceData !== null) {
$.ajax({
type: 'POST',
url: '/module/alma/insurance?action=addInsuranceProduct',
dataType: 'json',
data: {
ajax: true,
token: idIframeModal.attr('data-token'),
product_id: idIframeModal.attr('data-product-id'),
product_attribute_id: idIframeModal.attr('data-product-attribute-id'),
customization_id: idIframeModal.attr('data-product-customization-id'),
insurance_contract_id: e.data.selectedInsuranceData.insuranceContractId,
insurance_quantity: e.data.selectedInsuranceQuantity
},
handleAddInsuranceProductFromWidget(e);
});
}

function handleAddInsuranceProductFromWidget(e) {
if (e.data.type === 'getSelectedInsuranceData') {
let idIframeModal = $('#' + e.data.idIframeModal);

if (e.data.selectedInsuranceData !== null) {
$.ajax({
type: 'POST',
url: '/module/alma/insurance?action=addInsuranceProduct',
dataType: 'json',
data: {
ajax: true,
token: idIframeModal.attr('data-token'),
product_id: idIframeModal.attr('data-product-id'),
product_attribute_id: idIframeModal.attr('data-product-attribute-id'),
customization_id: idIframeModal.attr('data-product-customization-id'),
insurance_contract_id: e.data.selectedInsuranceData.insuranceContractId,
insurance_quantity: e.data.selectedInsuranceQuantity
},
})
.success(function () {
location.reload();
})
.success(function () {
location.reload();
})

.error(function (e) {
console.log(e)
//location.reload();
});
}

removeLoaderDot();
.error(function (e) {
console.log(e)
//location.reload();
});
}
if (e.data.type === 'almaEligibilityAnswer') {
if (e.data.eligibilityCallResult.length > 0) {
$('#' + e.data.iFrameIdForProductWidget).show();
}
}
if (e.data.type === 'almaEligibilityAnswer') {
if (e.data.eligibilityCallResult.length > 0) {
$('#' + e.data.iFrameIdForProductWidget).show();
}
});
}
window.removeEventListener('message', handleAddInsuranceProductFromWidget);
}

// ** Display extra info for insurance under the item product on cart **
Expand Down