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

WIP Fix #1431 As shop owner I can pause all payment collections #1432

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
86 changes: 0 additions & 86 deletions .envsubst.template

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -52,4 +52,4 @@ jobs:
# queries: ./path/to/local/query, your-org/your-repo/queries@main

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/demo-videos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart ${{ env.SUBDOMAIN }} EMAIL_QUEUE_FOLDER=${{ secrets.DOKKU_EMAIL_QUEUE_FOLDER }}"
# mount email-queue folder
ssh dokku@$DOKKU_HOST -C "dokku storage:mount ${{ env.SUBDOMAIN}} ${{ secrets.HOST_EMAIL_QUEUE_PATH }}:${{ secrets.DOKKU_EMAIL_QUEUE_FOLDER }} && dokku ps:restart ${{ env.SUBDOMAIN }} || true"
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Deploy branch ${{ github.event.repository.default_branch }} to dokku
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/git-auto-issue-branch-creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Get issue number and title
id: issue
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pr-demo-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
name: Deploy pr preview
on:
pull_request:
# (pull_request_target get fired on external contributer pull requests)
# (pull_request_target get fired on external contributor pull requests)
#pull_request_target
paths-ignore:
- '**/README.md'
Expand All @@ -26,7 +26,7 @@ jobs:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: |
echo $GITHUB_CONTEXT
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: psf/black@stable # Fail early if fails Black code style
Expand All @@ -46,7 +46,7 @@ jobs:
# Enforce max 60 chars, always end with alnum char
echo SUBDOMAIN=`echo "${{ github.head_ref }}" | tr '[:upper:]' '[:lower:]' | cut -c -60 | rev | sed 's/[^[:alnum:]]//1' | rev` >> $GITHUB_ENV
echo $GITHUB_ENV
- name: Create dokku app for pr branch if dosent already exist using dokku apps:create
- name: Create dokku app for pr branch if doesn't already exist using dokku apps:create
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
DOKKU_HOST: ${{ secrets.DOKKU_HOST }}
Expand All @@ -66,6 +66,7 @@ jobs:
ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart ${{ env.SUBDOMAIN }} STRIPE_CONNECT_ACCOUNT_ANNOUNCER_HOST=${{ secrets.STRIPE_CONNECT_ACCOUNT_ANNOUNCER_HOST }}"
ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart ${{ env.SUBDOMAIN }} FLASK_ENV=development"
ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart ${{ env.SUBDOMAIN }} EMAIL_QUEUE_FOLDER=${{ secrets.DOKKU_EMAIL_QUEUE_FOLDER }}"
ssh dokku@$DOKKU_HOST -C "dokku config:set --no-restart ${{ env.SUBDOMAIN }} SERVER_NAME=${{ env.SUBDOMAIN }}.pcpink.co.uk"
# mount email-queue folder
ssh dokku@$DOKKU_HOST -C "dokku storage:mount ${{ github.head_ref }} ${{ secrets.HOST_EMAIL_QUEUE_PATH }}:${{ secrets.DOKKU_EMAIL_QUEUE_FOLDER }} && dokku ps:restart ${{ github.head_ref }} || true"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod-test-onboarding-works.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
timeout-minutes: 15
environment: production
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/removing-inactive-pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-email-shopowner-704.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
timeout-minutes: 60
environment: production
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ tests/browser-automated-tests-playwright/index.spec.js-snapshots/*
tests/browser-automated-tests-playwright/worker*
tests/browser-automated-tests-playwright/e2e/*-snapshots
tests/browser-automated-tests-playwright/test-videos/*
tests/browser-automated-tests-playwright/graphviz_output*
subscribie/static/*
subscribie/custom_pages/*
playwright-report
Expand All @@ -54,3 +55,4 @@ playwright-report
emails
*.bk
email-queue
uploads/*
52 changes: 50 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
"test": "tests"
},
"dependencies": {
"dotenv": "^8.2.0"
"yaml": "^2.7.0"
},
"devDependencies": {
"@playwright/test": "^1.44.1"
"@playwright/test": "^1.44.1",
"@types/node": "^22.10.5"
},
"scripts": {
"test": "node tests/browser-automated-tests-playwright/index.js"
Expand Down
1 change: 1 addition & 0 deletions settings.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,6 @@ TELEGRAM_PYTHON_LOG_LEVEL: ERROR

# Environment Settings for tests
TEST_SHOP_OWNER_EMAIL_ISSUE_704: [email protected]
TEST_SUBSCRIBER_EMAIL_USER: [email protected]
TEST_SHOP_OWNER_LOGIN_URL: http://127.0.0.1:5000/auth/login

8 changes: 4 additions & 4 deletions subscribie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
subscribie.app
~~~~~~~~~
A microframework for buiding subsciption websites.
A microframework for building Subscription websites.
This module implements the central subscribie application.

:copyright: (c) 2018 by Karma Computing Ltd
Expand Down Expand Up @@ -216,9 +216,9 @@ def start_session():
# Note that PriceLists must also be assigned to plan(s) to be in effect.
price_lists = PriceList.query.all()
# If there are zero PriceLists this may mean shop is outdated and
# therefore needs its inital PriceLists created
# therefore needs its initial PriceLists created
if len(price_lists) == 0:
# Create defaul PriceList with zero rules for each suported currency
# Create default PriceList with zero rules for each supported currency
for currency in settings.get("SUPPORTED_CURRENCIES"):
log.debug(
f"Creating PriceList with zero rules for currency {currency}" # noqa: E501
Expand Down Expand Up @@ -386,7 +386,7 @@ def alert_subscriber_update_choices(subscriber: Person):
)
alert_subscriber_update_choices(person)

@app.route("/test-lanuage")
@app.route("/test-language")
def test_language():
return _("Hello")

Expand Down
Loading
Loading