Skip to content

Commit

Permalink
Merge pull request #187 from Tauffer-Consulting/chore/install-reposit…
Browse files Browse the repository at this point in the history
…ories-on-editor

Chore/Install repositories on editor improvments
  • Loading branch information
vinicvaz authored Nov 27, 2023
2 parents ba0cd24 + 374dd4b commit 9a4c44e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import { Modal, type ModalRef } from "components/Modal";
import { useWorkspaces, usesPieces } from "context/workspaces";
import { type Differences } from "features/workflowEditor/utils/importWorkflow";
import theme from "providers/theme.config";
import React, { forwardRef, useCallback, useMemo, useState } from "react";
import { Link } from "react-router-dom";
import { toast } from "react-toastify";
Expand Down Expand Up @@ -162,6 +163,14 @@ export const DifferencesModal = forwardRef<ModalRef, Props>(
variant="outlined"
onClick={handleInstallMissingRepositories}
disabled={installState !== 0}
style={
installState === 2
? {
borderColor: theme.palette.success.main,
color: theme.palette.success.main,
}
: {}
}
>
{installState === 1 && (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,26 @@ export const RepositoriesCard: FC = () => {
})
.then((data) => {
if (data) {
setAvailableVersions(data?.splice(0, 10));
const devVersion = data.find(
(item) =>
item.version === "dev" || item.version === "development",
);
const versionsOnly = data
.filter(
(item) =>
item.version !== "dev" && item.version !== "development",
)
.splice(0, 10);

const sortedVersions = versionsOnly.sort(
(a, b) => parseFloat(b.version) - parseFloat(a.version),
);

const sortedData = devVersion
? [...sortedVersions, devVersion]
: sortedVersions;

setAvailableVersions(sortedData);
}
setStep("SELECT_VERSION");
})
Expand Down

0 comments on commit 9a4c44e

Please sign in to comment.