Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit da09a9d

Browse files
authored
Merge pull request #100 from docker/bugfix/fix-notifications
Remove custom styles from notifications
2 parents 140661c + 52dd174 commit da09a9d

File tree

5 files changed

+14
-32
lines changed

5 files changed

+14
-32
lines changed

Dockerfile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,7 @@ LABEL org.opencontainers.image.title="Volumes Backup & Share" \
9292
]" \
9393
com.docker.desktop.extension.icon="https://raw.githubusercontent.com/docker/volumes-backup-extension/main/icon.svg" \
9494
com.docker.extension.changelog="<ul>\
95-
<li>Improved volume list performance.</li> \
96-
<li>Added support to import backups from any .tar.gz.</li> \
97-
<li>Changed the clone operation to copy the volume labels as well.</li> \
98-
<li>Fixed a bug where the clone operation will not validate whether the destination volume already existed.</li> \
99-
<li>Added error tracking to detect issues before users report them.</li> \
100-
<li>Fixed new vulnerabilities detected in the Dockerfile.</li> \
95+
<li>Fixed an issue with notifications and the new Design System.</li> \
10196
</ul>" \
10297
com.docker.extension.categories="volumes"
10398

ui/src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ export function App() {
439439
return;
440440
}
441441
calculateVolumeSize(recalculateVolumeSize);
442+
// eslint-disable-next-line react-hooks/exhaustive-deps
442443
}, [recalculateVolumeSize]);
443444

444445
const handleTransferDialogClose = () => {

ui/src/NotificationContext.tsx

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export const NotificationProvider: FC = ({ children }) => {
5959
{actions.map((action) => (
6060
<Button
6161
key={action.name}
62+
variant="text"
6263
onClick={() => {
6364
if (action.onClick) action.onClick();
6465
setOpen(false);
@@ -85,32 +86,16 @@ export const NotificationProvider: FC = ({ children }) => {
8586
message={values.message}
8687
action={buildActions(values.actions || [DEFAULT_ACTION])}
8788
sx={{
88-
"& .MuiButton-root": {
89-
color: useLightTheme
90-
? (theme) => theme.palette.docker.blue[500]
91-
: "white",
92-
"&:hover": {
93-
backgroundColor: (theme) => {
94-
if (values.type === "error") {
95-
return useLightTheme
96-
? theme.palette.docker.red[200]
97-
: theme.palette.docker.red[100];
98-
}
99-
100-
return useLightTheme
101-
? "white"
102-
: theme.palette.docker.grey[200];
103-
},
104-
},
105-
},
10689
backgroundColor: (theme) => {
10790
if (values.type === "error") {
10891
return useLightTheme
10992
? theme.palette.docker.red[100] // red-100 should be "#FDEAEA" but it's not 🤷‍♂️
11093
: theme.palette.docker.red[200];
11194
}
11295

113-
return useLightTheme ? "white" : theme.palette.docker.grey[200];
96+
return useLightTheme
97+
? theme.palette.common.white
98+
: theme.palette.docker.grey[200];
11499
},
115100
color: (theme) => theme.palette.text.primary,
116101
borderRadius: "4px !important",

vm/internal/handler/pull_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,16 @@ func TestPullVolume(t *testing.T) {
141141
t.Log(string(response))
142142

143143
if strings.Contains(string(response), "error") {
144-
return err
144+
return fmt.Errorf("error pushing image %s", string(response))
145145
}
146146

147+
t.Log("image pushed successfully")
147148
return nil
148149
})
149150
if err != nil {
150151
t.Fatal(err)
151152
}
152153

153-
// The sleep is to ensure the image is present in the registry after the `ImagePush` operation.
154-
time.Sleep(3 * time.Second)
155-
156154
_, err = cli.ImageRemove(context.Background(), imageID, types.ImageRemoveOptions{
157155
Force: true,
158156
})
@@ -169,8 +167,11 @@ func TestPullVolume(t *testing.T) {
169167
t.Fatal(err)
170168
}
171169

172-
// Pull volume from registry
173-
err = h.PullVolume(c)
170+
// Ths is to ensure the image is present in the registry after the `ImagePush` operation, might take a bit of time.
171+
err = retry(10, 1*time.Second, func() error {
172+
// Pull volume from registry
173+
return h.PullVolume(c)
174+
})
174175

175176
require.NoError(t, err)
176177
require.Equal(t, http.StatusCreated, rec.Code)

vm/internal/handler/save_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@ func TestSaveVolume(t *testing.T) {
105105
require.Len(t, summary, 1)
106106
require.Equal(t, imageID, summary[0].RepoTags[0])
107107
t.Logf("Image size after saving volume into it: %d", summary[0].Size)
108-
require.Regexp(t, `124\d{4}`, strconv.FormatInt(summary[0].Size, 10), "the image size should be around 1.24MB")
108+
require.Regexp(t, `\d{7}`, strconv.FormatInt(summary[0].Size, 10), "the image size should be between 1 and 10 MB")
109109
}

0 commit comments

Comments
 (0)