Skip to content

Commit

Permalink
Fix menu bug (#929) (#930)
Browse files Browse the repository at this point in the history
* Fix menu bug that adds features unto existing features
* Add missing top spacing for OSS Account view
* Update e-ref
  • Loading branch information
kimlisa committed Jun 28, 2022
1 parent c2033b8 commit 7c29efb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
*/

import React from 'react';
import { Text } from 'design';
import { Text, Box } from 'design';
import PasswordForm from 'shared/components/FormPassword';
import useChangePassword, { State } from './useChangePassword';

Expand All @@ -31,7 +31,7 @@ export function ChangePassword({
auth2faType,
}: State) {
return (
<>
<Box mt={3}>
<Text typography="h3" mb={3}>
Change Password
</Text>
Expand All @@ -41,6 +41,6 @@ export function ChangePassword({
onChangePass={changePassword}
onChangePassWithWebauthn={changePasswordWithWebauthn}
/>
</>
</Box>
);
}
4 changes: 2 additions & 2 deletions web/packages/teleport/src/stores/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import StoreNav from './storeNav';
import StoreNav, { defaultNavState } from './storeNav';
import StoreUserContext from './storeUserContext';
export { StoreNav, StoreUserContext };
export { StoreNav, StoreUserContext, defaultNavState };
6 changes: 3 additions & 3 deletions web/packages/teleport/src/stores/storeNav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ limitations under the License.
import { Store } from 'shared/libs/stores';
import { NavGroup } from 'teleport/types';

const defaultState = {
export const defaultNavState = {
sideNav: [] as NavItem[],
topNav: [] as NavItem[],
topMenu: [] as NavItem[],
};

export default class StoreNav extends Store<typeof defaultState> {
export default class StoreNav extends Store<typeof defaultNavState> {
state = {
...defaultState,
...defaultNavState,
};

addTopMenuItem(item: NavItem) {
Expand Down
4 changes: 3 additions & 1 deletion web/packages/teleport/src/teleportContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { StoreNav, StoreUserContext } from './stores';
import { StoreNav, StoreUserContext, defaultNavState } from './stores';
import cfg from 'teleport/config';
import * as types from './types';
import AuditService from './services/audit';
Expand Down Expand Up @@ -57,7 +57,9 @@ class TeleportContext implements types.Context {

init() {
return userService.fetchUserContext().then(user => {
this.storeNav.setState(defaultNavState);
this.storeUser.setState(user);
this.features = [];
});
}

Expand Down
2 changes: 1 addition & 1 deletion web/packages/webapps.e
Submodule webapps.e updated from 4d9573 to b0275d

0 comments on commit 7c29efb

Please sign in to comment.