Skip to content

Commit ed90960

Browse files
committed
moved refresh button
1 parent 82884e2 commit ed90960

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

packages/compass-connections-navigation/src/connections-navigation-tree.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const ConnectionsNavigationTree: React.FunctionComponent<
114114

115115
const getCollapseAfterForConnectedItem = useCallback(
116116
(actions: NavigationItemActions) => {
117-
const [firstAction, secondAction] = actions;
117+
const [firstAction, secondAction, thirdAction] = actions;
118118

119119
const actionCanBeShownInline = (
120120
action: NavigationItemActions[number]
@@ -123,31 +123,31 @@ const ConnectionsNavigationTree: React.FunctionComponent<
123123
return false;
124124
}
125125

126-
return ['create-database', 'open-shell'].includes(
126+
return ['refresh-databases', 'create-database', 'open-shell'].includes(
127127
(action as ItemAction<Actions>).action
128128
);
129129
};
130130

131131
// this is the normal case for a connection that is writable and when we
132132
// also have shell enabled
133133
if (
134-
actionCanBeShownInline(firstAction) &&
135-
actionCanBeShownInline(secondAction)
134+
actionCanBeShownInline(secondAction) &&
135+
actionCanBeShownInline(thirdAction)
136136
) {
137-
return 2;
137+
return 3;
138138
}
139139

140140
// this will happen when the either the connection is not writable or the
141141
// preference is readonly, or shell is not enabled in which case we either
142142
// do not show create-database action or open-shell action
143143
if (
144-
actionCanBeShownInline(firstAction) ||
145-
actionCanBeShownInline(secondAction)
144+
actionCanBeShownInline(secondAction) ||
145+
actionCanBeShownInline(thirdAction)
146146
) {
147-
return 1;
147+
return 2;
148148
}
149149

150-
return 0;
150+
return 1;
151151
},
152152
[]
153153
);

packages/compass-connections-navigation/src/item-actions.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ export const connectedConnectionItemActions = ({
9393
connectionInfo,
9494
});
9595
return stripNullActions([
96+
{
97+
action: 'refresh-databases',
98+
label: 'Refresh databases',
99+
icon: 'Refresh',
100+
},
96101
hasWriteActionsDisabled
97102
? null
98103
: {
@@ -123,11 +128,6 @@ export const connectedConnectionItemActions = ({
123128
icon: 'InfoWithCircle',
124129
label: 'Show connection info',
125130
},
126-
{
127-
action: 'refresh-databases',
128-
label: 'Refresh databases',
129-
icon: 'Refresh',
130-
},
131131
{
132132
action: 'connection-disconnect',
133133
icon: 'Disconnect',

0 commit comments

Comments
 (0)