Skip to content

Commit

Permalink
Merge pull request #628 from codex-team/master
Browse files Browse the repository at this point in the history
Update prod
  • Loading branch information
neSpecc authored Jan 11, 2025
2 parents 3a4cbbd + a553c13 commit 418b146
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-and-push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
envkey_VUE_APP_AMPLITUDE_TOKEN: ${{ secrets.AMPLITUDE_TOKEN_PROD }}
envkey_VUE_APP_CLOUDPAYMENTS_PUBLIC_ID: ${{ secrets.CP_PUBLIC_ID_STAGE }}
envkey_VUE_APP_API_ENDPOINT: "https://api.hawk.so"
envkey_VUE_APP_FREE_PLAN_ID: ${{ secrets.FREE_PLAN_ID }}
# envkey_VUE_APP_HAWK_TOKEN: ${{ secrets.HAWK_TOKEN_STAGE }}
# envkey_VUE_APP_AMPLITUDE_TOKEN: ${{ secrets.AMPLITUDE_TOKEN_STAGE }}
# envkey_VUE_APP_CLOUDPAYMENTS_PUBLIC_ID: ${{ secrets.CP_PUBLIC_ID_STAGE }}
Expand All @@ -33,6 +34,7 @@ jobs:
envkey_VUE_APP_AMPLITUDE_TOKEN: ${{ secrets.AMPLITUDE_TOKEN_PROD }}
envkey_VUE_APP_CLOUDPAYMENTS_PUBLIC_ID: ${{ secrets.CP_PUBLIC_ID_PROD }}
envkey_VUE_APP_API_ENDPOINT: "https://api.hawk.so"
envkey_VUE_APP_FREE_PLAN_ID: ${{ secrets.FREE_PLAN_ID }}

- name: Make prod envfile
if: endsWith(github.ref, '/prod-ru')
Expand All @@ -42,6 +44,7 @@ jobs:
envkey_VUE_APP_AMPLITUDE_TOKEN: ${{ secrets.AMPLITUDE_TOKEN_PROD }}
envkey_VUE_APP_CLOUDPAYMENTS_PUBLIC_ID: ${{ secrets.CP_PUBLIC_ID_PROD }}
envkey_VUE_APP_API_ENDPOINT: "https://api.hawk-tracker.ru"
envkey_VUE_APP_FREE_PLAN_ID: ${{ secrets.FREE_PLAN_ID }}

- name: Build and push docker image
uses: docker/build-push-action@v1
Expand Down
3 changes: 3 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,9 @@ type Workspace {
"""
subscriptionId: String

"""True if workspace is used for debugging"""
isDebug: Boolean

"""Workspace projects array"""
projects(
"""Project(s) id(s)"""
Expand Down
1 change: 1 addition & 0 deletions src/api/workspaces/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const QUERY_ALL_WORKSPACES_WITH_PROJECTS = `
billingPeriodEventsCount
subscriptionId
lastChargeDate
isDebug
inviteHash
...WorkspaceWithTeam
...WorkspacePlan
Expand Down
14 changes: 11 additions & 3 deletions src/components/modals/PaymentDetailsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,11 @@ export default Vue.extend({
* Otherwise, we will debit money when the tariff plan expires
*/
if (this.isTariffPlanExpired) {
date.setMonth(date.getMonth() + 1);
if (this.workspace.isDebug) {
date.setDate(date.getDate() + 1);
} else {
date.setMonth(date.getMonth() + 1);
}
return date.toDateString();
}
Expand Down Expand Up @@ -567,10 +571,12 @@ export default Vue.extend({
checksum: data.checksum,
};
const interval = this.workspace.isDebug ? 'Day' : 'Month';
if (this.isRecurrent) {
paymentData.cloudPayments = {
recurrent: {
interval: 'Month',
interval,
period: 1,
},
};
Expand All @@ -587,7 +593,9 @@ export default Vue.extend({
amount = AMOUNT_FOR_CARD_VALIDATION;
}
widget.pay('charge',
const method = this.isOnlyCardValidationNeeded ? 'auth' : 'charge'
widget.pay(method,
{
publicId: process.env.VUE_APP_CLOUDPAYMENTS_PUBLIC_ID,
description: this.$t('billing.cloudPaymentsWidget.description', {
Expand Down
3 changes: 3 additions & 0 deletions src/types/workspaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export interface Workspace {
* Returns from CloudPayments
*/
subscriptionId?: string;

/** True if workspace is used for debugging */
isDebug?: boolean;
}

/**
Expand Down

0 comments on commit 418b146

Please sign in to comment.