Skip to content

Commit

Permalink
Add "Gitlab Project" Auth Type on exportUrl UI
Browse files Browse the repository at this point in the history
  • Loading branch information
tatashidayat committed Jun 5, 2024
1 parent 82f3bb2 commit 50f7496
Show file tree
Hide file tree
Showing 6 changed files with 110,652 additions and 1,158 deletions.
3,783 changes: 3,782 additions & 1 deletion dist/plugin.js

Large diffs are not rendered by default.

53,999 changes: 53,421 additions & 578 deletions dist/ui.html

Large diffs are not rendered by default.

53,999 changes: 53,421 additions & 578 deletions dist/ui.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,8 @@
},
"dependencies": {
"react-dev-utils": "^12.0.1"
},
"volta": {
"node": "18.20.3"
}
}
1 change: 1 addition & 0 deletions src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default {
authType: {
token: 'token',
gitlabToken: 'gitlab_token',
gitlabCommit: 'gitlab_commit',
basic: 'Basic',
bearer: 'Bearer'
}
Expand Down
25 changes: 24 additions & 1 deletion src/ui/components/UrlExportSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const UrlExportSettings = () => {
type='text'
required
pattern='^https://.*'
placeholder='https://api.github.com/repos/:username/:repo/dispatches'
placeholder= {(settings.authType === config.key.authType.gitlabCommit && 'https://gitlab.com/api/v4/projects/:projectId')|| 'https://api.github.com/repos/:username/:repo/dispatches'}
value={settings.serverUrl}
onChange={value => updateSettings(draft => { draft.serverUrl = value })}
/>
Expand Down Expand Up @@ -156,6 +156,10 @@ export const UrlExportSettings = () => {
label: '(Gitlab) token',
value: config.key.authType.gitlabToken
},
{
label: '(Gitlab) Project Token',
value: config.key.authType.gitlabCommit
},
{
label: 'Basic authentication',
value: config.key.authType.basic
Expand Down Expand Up @@ -198,6 +202,25 @@ export const UrlExportSettings = () => {
</Row>
</>}

{config.key.authType.gitlabCommit === settings.authType &&
<>
<h3>Branch<Info
width={150}
label='The branch where the file will be committed. Only used when Gitlab Project selected for "Auth type"'
/>
</h3>
<Row fill>
<Input
type='text'
required
pattern='\S+'
placeholder='main'
value={settings.reference}
onChange={value => updateSettings(draft => { draft.reference = value })}
/>
</Row>
</>}

<Separator />
<Title size='xlarge' weight='bold'>About This Export</Title>
<h3>Commit Message<Info width={200} label='Typically this will be a "commit message" for Git. Your organization may require a specific convention for these messages.' /></h3>
Expand Down

0 comments on commit 50f7496

Please sign in to comment.