Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(UI): reload button for each app #2077

Merged
merged 3 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,7 @@ Copyright freiheit.com*/
.service-lane__date {
padding-right: 2px;
}
.servicelane__reload {
font-size: xx-large;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
getAppDetails,
showSnackbarError,
showSnackbarWarn,
updateAppDetails,
useAppDetailsForApp,
useCurrentlyExistsAtGroup,
useMinorsForApp,
Expand All @@ -38,6 +39,7 @@ import { EnvSelectionDialog } from '../SelectionDialog/SelectionDialogs';
import { AuthHeader, useAzureAuthSub } from '../../utils/AzureAuthProvider';
import { SmallSpinner } from '../Spinner/Spinner';
import { FormattedDate } from '../FormattedDate/FormattedDate';
import { Button } from '../button';

// number of releases on home. based on design
// we could update this dynamically based on viewport width
Expand Down Expand Up @@ -279,6 +281,15 @@ export const ReadyServiceLane: React.FC<{
},
[application.name, envs]
);
const onReload = useCallback(() => {
const details = updateAppDetails.get();
details[application.name] = {
details: undefined,
appDetailState: AppDetailsState.NOTREQUESTED,
updatedAt: new Date(Date.now()),
};
updateAppDetails.set(details);
}, [application.name]);
const buttons: DotsMenuButton[] = [
{
label: 'View History',
Expand Down Expand Up @@ -316,6 +327,16 @@ export const ReadyServiceLane: React.FC<{
/>
);

const reloadButton = (
sven-urbanski-freiheit-com marked this conversation as resolved.
Show resolved Hide resolved
<Button
id={application.name + '-reloadButton'}
className="servicelane__reload mdc-button--unelevated"
label={'⟳'}
highlightEffect={false}
onClick={onReload}
/>
);

return (
<div className="service-lane">
{dialog}
Expand All @@ -332,6 +353,7 @@ export const ReadyServiceLane: React.FC<{
</div>
</div>
<div className="service-lane-wrapper">
<div>{reloadButton}</div>
{props.allAppData.updatedAt && (
<div className="service-lane__date">
<span>Updated </span>
Expand All @@ -340,6 +362,7 @@ export const ReadyServiceLane: React.FC<{
)}
<div className="service__actions__">{dotsMenu}</div>
</div>
{/*<div className="service__actions__">{dotsMenu}</div>*/}
</div>
<div className="service__warnings">
<WarningBoxes application={appDetails?.application} />
Expand Down
Loading