Skip to content

Commit

Permalink
Merge pull request #51 from aha-app/DEVELOP-768--internal-secure-stor…
Browse files Browse the repository at this point in the history
…age-extension-secrets

DEVELOP-768 Update create contribution script to allow secret extension settings
  • Loading branch information
jemmyw authored Feb 19, 2025
2 parents e0dc46b + 05ca9c7 commit d6754c9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/utils/questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function getContributionFromQuestions() {
recordTypes: answers.recordTypes,
handles: answers.handles,
description: answers.description,
default: answers.default,
default: answers.type === 'secret' ? null : answers.default,
type: answers.type,
scope: answers.scope,
},
Expand Down Expand Up @@ -169,7 +169,7 @@ export const contributionQuestions = [
type: 'list',
name: 'type',
message: 'Enter the type for your setting:',
choices: ['boolean', 'color', 'string', 'number'],
choices: ['boolean', 'color', 'string', 'number', 'secret'],
default: 'color',
when: (answers: StringAnswers) => answers.contributionType === 'settings',
},
Expand All @@ -187,6 +187,8 @@ export const contributionQuestions = [
return 'Description';
case 'number':
return 'Choose a number';
case 'secret':
return 'Authentication token';
}
},
when: (answers: StringAnswers) => answers.contributionType === 'settings',
Expand All @@ -207,7 +209,8 @@ export const contributionQuestions = [
return '42';
}
},
when: (answers: StringAnswers) => answers.contributionType === 'settings',
when: (answers: StringAnswers) =>
answers.contributionType === 'settings' && answers.type !== 'secret',
},
{
type: 'checkbox',
Expand Down

0 comments on commit d6754c9

Please sign in to comment.