forked from stackblitz/bolt.new
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from D-Byte/iAlsoWantGitLabTwo
Take2
- Loading branch information
Showing
14 changed files
with
689 additions
and
982 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Semantic Pull Request | ||
on: | ||
pull_request_target: | ||
types: [opened, reopened, edited, synchronize] | ||
permissions: | ||
pull-requests: read | ||
jobs: | ||
main: | ||
name: Validate PR Title | ||
runs-on: ubuntu-latest | ||
steps: | ||
# https://github.com/amannn/action-semantic-pull-request/releases/tag/v5.5.3 | ||
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
subjectPattern: ^(?![A-Z]).+$ | ||
subjectPatternError: | | ||
The subject "{subject}" found in the pull request title "{title}" | ||
didn't match the configured pattern. Please ensure that the subject | ||
doesn't start with an uppercase character. | ||
types: | | ||
fix | ||
feat | ||
chore | ||
build | ||
ci | ||
perf | ||
docs | ||
refactor | ||
revert | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "commit": "25b80ab267541b6ea290985dde09863f1a29c85c" , "version": "0.0.1" } | ||
{ "commit": "b9601b26d739f935eda935c61dea4c7c6b9c7220", "version": "0.0.2" } |
182 changes: 21 additions & 161 deletions
182
app/components/settings/connections/ConnectionsTab.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import React from 'react'; | ||
import type { GitProvider, ProviderCredentials } from '~/utils/gitProviders'; | ||
|
||
interface ProviderCardProps { | ||
provider: GitProvider; | ||
credentials: ProviderCredentials; | ||
isExpanded: boolean; | ||
onToggle: () => void; | ||
onUpdateCredentials: (updates: Partial<ProviderCredentials>) => void; | ||
onSave: () => void; | ||
onDisconnect: () => void; | ||
} | ||
|
||
export function ProviderCard({ | ||
provider, | ||
credentials, | ||
isExpanded, | ||
onToggle, | ||
onUpdateCredentials, | ||
onSave, | ||
onDisconnect, | ||
}: ProviderCardProps) { | ||
return ( | ||
<div className="p-4 border border-bolt-elements-borderColor rounded-lg bg-bolt-elements-background-depth-3"> | ||
<div className="flex items-center justify-between cursor-pointer" onClick={onToggle}> | ||
<div className="flex items-center"> | ||
<h3 className="text-lg font-medium text-bolt-elements-textPrimary">{provider.title} Connection</h3> | ||
{credentials.username && ( | ||
<span className="ml-2 text-sm text-bolt-elements-textSecondary">({credentials.username})</span> | ||
)} | ||
</div> | ||
<div className="flex items-center"> | ||
{credentials.isConnected && ( | ||
<div className="flex items-center mr-3"> | ||
<div className="w-2 h-2 rounded-full bg-green-500 mr-2" /> | ||
<span className="text-sm text-bolt-elements-textSecondary">Connected</span> | ||
</div> | ||
)} | ||
<div className={`transform transition-transform ${isExpanded ? 'rotate-180' : ''}`}> | ||
<div className="i-ph:caret-down text-bolt-elements-textSecondary" /> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{isExpanded && ( | ||
<div className="mt-4"> | ||
<div className="mb-4 p-3 bg-bolt-elements-background-depth-4 rounded border border-bolt-elements-borderColor"> | ||
<p className="text-sm text-bolt-elements-textSecondary mb-2">{provider.instructions}</p> | ||
<ul className="text-sm text-bolt-elements-textSecondary space-y-1"> | ||
{provider.tokenSetupSteps.map((step, index) => ( | ||
<li key={index}>{step}</li> | ||
))} | ||
</ul> | ||
</div> | ||
|
||
<div className="flex mb-4"> | ||
<div className="flex-1 mr-2"> | ||
<label className="block text-sm text-bolt-elements-textSecondary mb-1">{provider.title} Username:</label> | ||
<input | ||
type="text" | ||
value={credentials.username} | ||
onChange={(e) => onUpdateCredentials({ username: e.target.value })} | ||
disabled={credentials.isVerifying} | ||
className="w-full bg-white dark:bg-bolt-elements-background-depth-4 relative px-2 py-1.5 rounded-md focus:outline-none placeholder-bolt-elements-textTertiary text-bolt-elements-textPrimary dark:text-bolt-elements-textPrimary border border-bolt-elements-borderColor" | ||
/> | ||
</div> | ||
<div className="flex-1"> | ||
<label className="block text-sm text-bolt-elements-textSecondary mb-1">Personal Access Token:</label> | ||
<input | ||
type="password" | ||
value={credentials.token} | ||
onChange={(e) => onUpdateCredentials({ token: e.target.value })} | ||
disabled={credentials.isVerifying} | ||
className="w-full bg-white dark:bg-bolt-elements-background-depth-4 relative px-2 py-1.5 rounded-md focus:outline-none placeholder-bolt-elements-textTertiary text-bolt-elements-textPrimary dark:text-bolt-elements-textPrimary border border-bolt-elements-borderColor" | ||
/> | ||
</div> | ||
</div> | ||
|
||
<div className="flex"> | ||
{!credentials.isConnected ? ( | ||
<button | ||
onClick={onSave} | ||
disabled={credentials.isVerifying || !credentials.username || !credentials.token} | ||
className="bg-bolt-elements-button-primary-background rounded-lg px-4 py-2 mr-2 transition-colors duration-200 hover:bg-bolt-elements-button-primary-backgroundHover text-bolt-elements-button-primary-text" | ||
> | ||
{credentials.isVerifying ? ( | ||
<> | ||
<div className="i-ph:spinner animate-spin mr-2" /> | ||
Verifying... | ||
</> | ||
) : ( | ||
'Connect' | ||
)} | ||
</button> | ||
) : ( | ||
<button | ||
onClick={onDisconnect} | ||
className="bg-red-500 text-white rounded-lg px-4 py-2 mr-2 transition-colors duration-200 hover:bg-red-600" | ||
> | ||
Disconnect | ||
</button> | ||
)} | ||
</div> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.