diff --git a/libs/remix-ui/git/src/components/buttons/sourcecontrolbuttons.tsx b/libs/remix-ui/git/src/components/buttons/sourcecontrolbuttons.tsx index ce70ae3170..02c6c960af 100644 --- a/libs/remix-ui/git/src/components/buttons/sourcecontrolbuttons.tsx +++ b/libs/remix-ui/git/src/components/buttons/sourcecontrolbuttons.tsx @@ -33,7 +33,8 @@ export const SourceControlButtons = () => { } const push = async () => { - await actions.pull(getRemoteName(), branch ? branch.name : context.currentBranch.name) + await actions.push(getRemoteName(), branch ? branch.name : context.currentBranch.name) + await actions.fetch(getRemoteName(), branch ? branch.name : context.currentBranch.name, null, null, true) } const sync = async () => { diff --git a/libs/remix-ui/git/src/components/panels/commands/pushpull.tsx b/libs/remix-ui/git/src/components/panels/commands/pushpull.tsx index e4a531ec0a..89975bb9a5 100644 --- a/libs/remix-ui/git/src/components/panels/commands/pushpull.tsx +++ b/libs/remix-ui/git/src/components/panels/commands/pushpull.tsx @@ -47,7 +47,8 @@ export const PushPull = () => { const push = async () => { console.log('PUSH', context.upstream, localBranch, remoteBranch, force) - actions.push(context.upstream.remote, localBranch, remoteBranch, force) + await actions.push(context.upstream.remote, localBranch, remoteBranch, force) + await actions.fetch(context.upstream.remote, localBranch, remoteBranch, 1, true) } const pull = async () => { diff --git a/libs/remix-ui/git/src/components/panels/commits/commitsummary.tsx b/libs/remix-ui/git/src/components/panels/commits/commitsummary.tsx index f19b15b7a9..271b345d42 100644 --- a/libs/remix-ui/git/src/components/panels/commits/commitsummary.tsx +++ b/libs/remix-ui/git/src/components/panels/commits/commitsummary.tsx @@ -1,6 +1,11 @@ import { ReadCommitResult } from "isomorphic-git" import { default as dateFormat } from "dateformat"; import React from "react"; +import { faGlobe } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { remote } from "@remix-ui/git"; +import GitUIButton from "../../buttons/gituibutton"; +import { gitPluginContext } from "../../gitui"; export interface CommitSummaryProps { commit: ReadCommitResult; @@ -9,6 +14,7 @@ export interface CommitSummaryProps { export const CommitSummary = (props: CommitSummaryProps) => { const { commit, checkout } = props; + const context = React.useContext(gitPluginContext) const getDate = (commit: ReadCommitResult) => { const timestamp = commit.commit.author.timestamp; @@ -38,6 +44,15 @@ export const CommitSummary = (props: CommitSummaryProps) => { return ""; }; + const getRemote = (): remote | null => { + return context.upstream ? context.upstream : context.defaultRemote ? context.defaultRemote : null + } + + const openRemote = () => { + if(getRemote()) + window.open(`${getRemote().url}/commit/${commit.oid}`, '_blank'); + } + return ( <>
@@ -45,7 +60,7 @@ export const CommitSummary = (props: CommitSummaryProps) => {
{commit.commit.author.name || ""} {getDate(commit)} - + {getRemote() && getRemote()?.url && openRemote()}>} ) } \ No newline at end of file diff --git a/libs/remix-ui/git/src/lib/gitactions.ts b/libs/remix-ui/git/src/lib/gitactions.ts index 19aa35f624..07fd8833fb 100644 --- a/libs/remix-ui/git/src/lib/gitactions.ts +++ b/libs/remix-ui/git/src/lib/gitactions.ts @@ -384,7 +384,6 @@ export const clone = async (url: string, branch: string, depth: number, singleBr export const fetch = async (remote?: string, ref?: string, remoteRef?: string, depth?: number, singleBranch?: boolean, relative?: boolean, quiet?: boolean) => { dispatch(setLoading(true)) await disableCallBacks() - await plugin.call('notification', 'toast', `Fetching ${remote || ''} ${ref || ''} ${remoteRef || ''}`) try { await plugin.call('dGitProvider' as any, 'fetch', { remote, ref, remoteRef, depth, singleBranch, relative }); if (!quiet) {