Skip to content

Commit 9e8c597

Browse files
committed
add header to push pop-up component
1 parent 2217503 commit 9e8c597

File tree

5 files changed

+70
-52
lines changed

5 files changed

+70
-52
lines changed

ui/src/Components/DashBoard/Repository/GitComponents/GitOperation/CommitComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default function CommitComponent(props) {
5757

5858
function commitHandler(commitMsg) {
5959
setLoadingCommit(true);
60-
commitMsg = commitMsg.replace(/"/gi, '\\"');
60+
commitMsg = commitMsg.replace(/"/gi, '"');
6161
if (commitMsg.split("\n") && commitMsg.split("\n").length > 0) {
6262
commitMsg = commitMsg.toString().split("\n").join("||");
6363
}

ui/src/Components/DashBoard/Repository/GitComponents/GitOperation/PushComponent.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ export default function PushComponent(props) {
188188
{!pushDone ? (
189189
<>
190190
<div className="git-ops--push">
191+
<div className="text-center font-sans font-semibold mx-auto w-full p-3 text-2xl border-b-2 border-dashed text-gray-800">
192+
Push To Remote
193+
</div>
191194
<div className="flex mx-auto justify-around items-center align-middle gap-4">
192195
<div className="w-2/3 font-sans text-xl font-semibold text-gray-600">
193196
Available remotes

ui/src/Components/DashBoard/Repository/RepoComponents/RepoDetails/FileExplorerComponent.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export default function FileExplorerComponent(props) {
134134
}
135135

136136
setCwd(directoryName);
137+
setIsLoading(true);
137138

138139
axios({
139140
url: globalAPIEndpoint,
@@ -154,6 +155,7 @@ export default function FileExplorerComponent(props) {
154155
},
155156
})
156157
.then((res) => {
158+
setIsLoading(false);
157159
if (res.data.data && !res.data.error) {
158160
const localFolderContent = res.data.data.gitFolderContent;
159161

@@ -188,12 +190,14 @@ export default function FileExplorerComponent(props) {
188190
}
189191
}
190192
} else {
193+
setIsLoading(false);
191194
console.log(
192195
"ERROR: Error occurred while fetching the folder content!"
193196
);
194197
}
195198
})
196199
.catch((err) => {
200+
setIsLoading(false);
197201
if (err) {
198202
console.log(
199203
"ERROR: Error occurred while fetching the folder content!",

ui/src/Components/DashBoard/Repository/RepoComponents/RepoDetails/RepoDetailBackdrop/FetchPullActionComponent.js

Lines changed: 61 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -179,71 +179,88 @@ export default function FetchFromRemoteComponent(props) {
179179

180180
return (
181181
<>
182-
<div className="repo-backdrop--fetchpull">
182+
<div className="repo-backdrop--fetchpull pt-4">
183183
{actionType === "fetch" ? (
184-
<div
185-
className="fetchpull--fetch-global xl:w-3/5 lg:w-3/4 md:w-3/4 sm:w-11/12"
186-
onClick={() => {
187-
actionHandler();
188-
}}
189-
>
190-
<div className="text-2xl text-indigo-800 mx-4">
191-
<FontAwesomeIcon
192-
icon={["fas", "exclamation-circle"]}
193-
></FontAwesomeIcon>
184+
<div>
185+
<div className="text-center font-sans font-semibold mx-auto w-full p-3 text-2xl border-b-2 border-dashed text-gray-800">
186+
Fetch from Remote
187+
</div>
188+
<div
189+
className="fetchpull--fetch-global xl:w-3/5 lg:w-3/4 md:w-3/4 sm:w-11/12"
190+
onClick={() => {
191+
actionHandler();
192+
}}
193+
>
194+
<div className="text-2xl text-indigo-800 mx-4">
195+
<FontAwesomeIcon
196+
icon={["fas", "exclamation-circle"]}
197+
></FontAwesomeIcon>
198+
</div>
199+
<div>Click to Fetch from default remote and branch</div>
194200
</div>
195-
<div>Click to Fetch without branch selection</div>
196201
</div>
197202
) : null}
198-
<div className="m-3 text-2xl font-sans text-gray-800">
199-
Available remote repos
200-
</div>
201-
<div>
202-
<select
203-
className="fetchpull--select"
204-
defaultValue="checked"
205-
disabled={remoteData ? false : true}
206-
onChange={() => {
207-
setIsRemoteSet(true);
208-
}}
209-
onClick={() => {
210-
setResult([]);
211-
}}
212-
ref={remoteRef}
213-
>
214-
<option disabled hidden value="checked">
215-
{remoteData
216-
? "Select the remote repo"
217-
: "Loading available remotes..."}
218-
</option>
219-
{remoteData ? remoteHostGenerator() : null}
220-
</select>
221-
</div>
222-
223-
{isRemoteSet ? (
224-
<div>
203+
{actionType === "pull" ? (
204+
<div className="text-center font-sans font-semibold mx-auto w-full p-3 text-2xl border-b-2 border-dashed text-gray-800">
205+
Pull from Remote
206+
</div>
207+
) : null}
208+
<div className="flex flex-wrap w-3/4 mx-auto my-4 justify-around items-center align-middle gap-4">
209+
<div className="w-full font-sans text-xl font-semibold text-gray-600">
210+
Available remotes
211+
</div>
212+
<div className="w-full mb-6">
225213
<select
226214
className="fetchpull--select"
227215
defaultValue="checked"
216+
disabled={remoteData ? false : true}
228217
onChange={() => {
229-
setIsBranchSet(true);
218+
setIsRemoteSet(true);
230219
}}
231220
onClick={() => {
232221
setResult([]);
233222
}}
234-
ref={branchRef}
223+
ref={remoteRef}
235224
>
236225
<option disabled hidden value="checked">
237-
Select upstream branch
226+
{remoteData
227+
? "Select the remote repo"
228+
: "Loading available remotes..."}
238229
</option>
239-
{remoteData ? branchListGenerator() : null}
230+
{remoteData ? remoteHostGenerator() : null}
240231
</select>
241232
</div>
233+
</div>
234+
235+
{isRemoteSet ? (
236+
<div className="flex flex-wrap w-3/4 mx-auto my-4 justify-around items-center align-middle gap-4">
237+
<div className="w-full font-sans text-xl font-semibold text-gray-600">
238+
Available Branches
239+
</div>
240+
<div className="w-full mb-6">
241+
<select
242+
className="fetchpull--select"
243+
defaultValue="checked"
244+
onChange={() => {
245+
setIsBranchSet(true);
246+
}}
247+
onClick={() => {
248+
setResult([]);
249+
}}
250+
ref={branchRef}
251+
>
252+
<option disabled hidden value="checked">
253+
Select upstream branch
254+
</option>
255+
{remoteData ? branchListGenerator() : null}
256+
</select>
257+
</div>
258+
</div>
242259
) : null}
243260

244261
{isRemoteSet && isBranchSet && !loading ? (
245262
<div
246-
className="fetchpull--btn"
263+
className="fetchpull--btn mt-10 rounded-b"
247264
onClick={(event) => {
248265
const remoteHost = remoteRef.current.value;
249266
const branchName = branchRef.current.value;

ui/src/Components/styles/RepositoryDetailsBackdrop.css

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,6 @@
774774
margin-right: auto;
775775
margin-top: auto;
776776
margin-bottom: auto;
777-
padding: 1.5rem;
778777
border-radius: 0.25rem;
779778
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
780779
--bg-opacity: 1;
@@ -821,28 +820,23 @@
821820
.fetchpull--select {
822821
border-width: 1px;
823822
padding: 0.75rem;
824-
margin-top: 1rem;
825-
margin-bottom: 1rem;
826823
font-size: 1.25rem;
827824
border-radius: 0.25rem;
828825
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
829826
}
830827

831828
.fetchpull--btn {
832-
margin-top: 1rem;
833-
margin-bottom: 1rem;
834829
text-align: center;
835830
--bg-opacity: 1;
836831
background-color: #7f9cf5;
837832
background-color: rgba(127, 156, 245, var(--bg-opacity));
838-
border-radius: 0.25rem;
839833
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
840834
--text-opacity: 1;
841835
color: #fff;
842836
color: rgba(255, 255, 255, var(--text-opacity));
843837
font-size: 1.25rem;
844838
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
845-
padding: 0.5rem;
839+
padding: 1rem;
846840
margin-left: auto;
847841
margin-right: auto;
848842
cursor: pointer;

0 commit comments

Comments
 (0)