freemium-survey-components 2.0.474 → 2.0.476

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,13 +21,24 @@ permissions:
21
21
  pull-requests: write
22
22
  packages: write
23
23
 
24
+ # Bump this when you change the workflow file
25
+ env:
26
+ WORKFLOW_VERSION: '1.0.1'
27
+
24
28
  jobs:
25
29
  create-version-pr:
26
30
  name: Create Version Bump PR
27
31
  runs-on: fw-shared
28
32
  if: github.event_name == 'workflow_dispatch'
33
+ permissions:
34
+ contents: write
35
+ pull-requests: write
29
36
 
30
37
  steps:
38
+ - name: Log workflow version
39
+ run: |
40
+ echo "Workflow file version: ${{ env.WORKFLOW_VERSION }}"
41
+
31
42
  - name: Checkout code
32
43
  uses: actions/checkout@v4
33
44
  with:
@@ -101,8 +112,11 @@ jobs:
101
112
  run: git push origin ${{ steps.branch.outputs.branch_name }}
102
113
 
103
114
  - name: Create Pull Request
115
+ id: create_pr
104
116
  run: |
105
- PR_URL=$(gh pr create \
117
+ BRANCH="${{ steps.branch.outputs.branch_name }}"
118
+ PR_URL=""
119
+ if PR_URL=$(gh pr create \
106
120
  --title "chore(release): bump version to ${{ steps.version_bump.outputs.new_version }}" \
107
121
  --body "## Automated Version Bump: ${{ steps.version_bump.outputs.new_version }}
108
122
 
@@ -123,11 +137,24 @@ jobs:
123
137
  - GitHub release created
124
138
 
125
139
  **Merge this PR to trigger automated publishing!**" \
126
- --head ${{ steps.branch.outputs.branch_name }} \
127
- --base main)
128
-
129
- echo "Pull request created: $PR_URL"
130
- echo "Review and merge to complete: $PR_URL"
140
+ --head "$BRANCH" \
141
+ --base main 2>/dev/null); then
142
+ echo "PR created via gh pr create"
143
+ fi
144
+ if [ -z "$PR_URL" ]; then
145
+ PR_URL=$(gh pr list --head "$BRANCH" --json url --limit 1 -q '.[0].url' 2>/dev/null || true)
146
+ if [ -n "$PR_URL" ]; then
147
+ echo "PR already exists for branch; retrieved URL"
148
+ fi
149
+ fi
150
+ if [ -n "$PR_URL" ]; then
151
+ echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
152
+ echo "Pull request created: $PR_URL"
153
+ echo "Review and merge to complete: $PR_URL"
154
+ else
155
+ echo "::error::gh pr create failed and no PR found for branch $BRANCH. Enable GITHUB_TOKEN write access: Settings → Actions → General → Workflow permissions → Read and write permissions"
156
+ exit 1
157
+ fi
131
158
  env:
132
159
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133
160
 
@@ -137,6 +164,10 @@ jobs:
137
164
  if: github.event_name == 'push' && github.ref == 'refs/heads/main'
138
165
 
139
166
  steps:
167
+ - name: Log workflow version
168
+ run: |
169
+ echo "Workflow file version: ${{ env.WORKFLOW_VERSION }}"
170
+
140
171
  - name: Checkout code
141
172
  uses: actions/checkout@v4
142
173
  with:
@@ -281,11 +312,16 @@ jobs:
281
312
 
282
313
  - name: Notify Slack channel
283
314
  if: steps.check_version.outputs.is_version_bump == 'true'
315
+ continue-on-error: true
284
316
  run: |
317
+ if [ -z "$SLACK_WEBHOOK_URL" ]; then
318
+ echo "SLACK_WEBHOOK_URL secret not set; skipping Slack notification."
319
+ exit 0
320
+ fi
285
321
  RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/${{ steps.check_version.outputs.version }}"
286
322
  PACKAGE_NAME=$(node -p "require('./package.json').name")
287
323
  MESSAGE=":tada: *New Release Published!* \nPackage: *${PACKAGE_NAME}* \nVersion: *${{ steps.check_version.outputs.version }}* \nReleased by: @${{ github.actor }} \n<${RELEASE_URL}|View Release Notes>"
288
- curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$MESSAGE\"}" "${{ secrets.SLACK_WEBHOOK_URL }}"
324
+ curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$MESSAGE\"}" "$SLACK_WEBHOOK_URL"
289
325
  echo "Slack notification sent!"
290
326
  env:
291
327
  SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
@@ -164,6 +164,7 @@ export type SurveyQuestionTypeInfo = {
164
164
  file_field?: FileFieldTypes | null;
165
165
  text_field?: TextFieldType | null;
166
166
  contact_form?: ContactFormQuestionType | null;
167
+ risk_settings?: QuestionRiskSettings | null;
167
168
  };
168
169
  export type ContactFormQuestionType = {
169
170
  layout?: 'VERTICAL' | 'HORIZONTAL';
@@ -306,13 +307,21 @@ export type FooterAlignmentType = Extract<AlignmentType, 'left' | 'center' | 'ri
306
307
  export type MobileContentLayoutType = Extract<ContentLayoutType, 'FULL' | 'TOP' | 'NO'>;
307
308
  export type DesktopContentLayoutType = Extract<ContentLayoutType, 'FULL' | 'TOP' | 'LEFT' | 'RIGHT'>;
308
309
  export type ContentAlignmentType = Extract<AlignmentType, 'left' | 'center' | 'right'>;
309
- export type RiskSettings = {
310
+ export interface SurveyRiskSettings {
310
311
  associated_policy_ids?: string[];
311
- scoring: {
312
- distribute_weights_enabled: boolean;
313
- question_weightage: Record<string, number>;
312
+ weight_distribution?: {
313
+ is_enabled?: boolean;
314
+ max_total_weight?: number | null;
314
315
  };
315
- };
316
+ }
317
+ export interface RiskScoreRule {
318
+ choice_id: string | null;
319
+ score: number;
320
+ }
321
+ export interface QuestionRiskSettings {
322
+ weight?: number | null;
323
+ score_rules?: RiskScoreRule[];
324
+ }
316
325
  export type SurveyMetaType = {
317
326
  is_default?: boolean | null;
318
327
  branch_separate_page?: boolean | null;
@@ -339,7 +348,6 @@ export type SurveyMetaType = {
339
348
  };
340
349
  is_reordered?: boolean;
341
350
  unsupported_channels?: PreviewChannelType[];
342
- risk_settings?: RiskSettings;
343
351
  };
344
352
  export type SurveyBlockCategoryType = {
345
353
  id?: string | null;
@@ -497,6 +505,7 @@ export type SurveyType = {
497
505
  survey_version_id?: string | null;
498
506
  created_by?: string | null;
499
507
  updated_by?: string | null;
508
+ risk_settings?: SurveyRiskSettings | null;
500
509
  /**
501
510
  * @deprecated
502
511
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-survey-components",
3
- "version": "2.0.474",
3
+ "version": "2.0.476",
4
4
  "description": "React Survey Ui Components",
5
5
  "main": "lib/index.cjs.js",
6
6
  "module": "lib/index.esm.js",