-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show available updates in Dashboard (#4828)
- Loading branch information
Showing
3 changed files
with
241 additions
and
86 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
54 changes: 54 additions & 0 deletions
54
web/src/features/Dashboard/components/AvailableUpdateCard.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
import { AvailableUpdate } from "@types"; | ||
import { AvailableUpdateRow } from "@components/apps/AvailableUpdatesComponent"; | ||
|
||
const AvailableUpdateCard = ({ | ||
updates, | ||
showReleaseNotes, | ||
appSlug, | ||
}: { | ||
updates: AvailableUpdate[]; | ||
showReleaseNotes: (releaseNotes: string) => void; | ||
appSlug: string; | ||
}) => { | ||
const navigate = useNavigate(); | ||
const update = updates[0]; | ||
return ( | ||
<div className="tw-mt-4"> | ||
<div className="flex alignItems--center u-marginBottom--15"> | ||
<p className="u-fontSize--normal u-fontWeight--medium card-title"> | ||
Latest Available Update | ||
</p> | ||
<p className="u-fontSize--normal"> | ||
<span className="u-fontSize--small u-fontWeight--medium u-textColor--bodyCopy tw-ml-2"> | ||
({updates.length} available) | ||
</span> | ||
</p> | ||
</div> | ||
<div className="tw-flex tw-flex-col tw-gap-2 tw-max-h-[275px] tw-overflow-auto"> | ||
<AvailableUpdateRow | ||
update={update} | ||
showReleaseNotes={showReleaseNotes} | ||
index={1} | ||
> | ||
<button | ||
className={"btn tw-ml-2 primary blue"} | ||
onClick={() => navigate(`/app/${appSlug}/version-history`)} | ||
> | ||
<span | ||
key={update.nonDeployableCause} | ||
data-tip-disable={update.isDeployable} | ||
data-tip={update.nonDeployableCause} | ||
data-for="disable-deployment-tooltip" | ||
> | ||
Go to Version history | ||
</span> | ||
</button> | ||
</AvailableUpdateRow> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AvailableUpdateCard; |
Oops, something went wrong.