Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

Add Admin button in Home Page #828

Merged
merged 6 commits into from
Jun 4, 2020
Merged

Add Admin button in Home Page #828

merged 6 commits into from
Jun 4, 2020

Conversation

rohithbalaji123
Copy link
Member

@rohithbalaji123 rohithbalaji123 commented Jun 3, 2020

Part of #612

New Behavior

Description

Add Admin button in home page to navigate to admin panel for authorized users.

Few design thought processes:

  1. Included history prop in the HomePage:
    To be able to navigate to admin panel on clicking admin button.
  2. Decide admin button render based on shouldShowAdminButton state instead of feature toggle:
    When using featureToggle hoc, the button component will not be mounted again when user logs out. It will be visible when an admin user logs out.
  3. isUserAdmin in ShortHTTPApi instead of AuthService:
    Adding isUserAdmin to AuthService will add a dependency for AuthService on ShortHTTPApi, but ShortHTTPApi already needs injection of AuthService.
    => Removed this and using includeAdminPanel feature toggle instead.

Screenshots

image

@rohithbalaji123 rohithbalaji123 added the enhancement New feature or request label Jun 3, 2020
@rohithbalaji123 rohithbalaji123 self-assigned this Jun 3, 2020
@codecov
Copy link

codecov bot commented Jun 3, 2020

Codecov Report

Merging #828 into master will decrease coverage by 0.15%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #828      +/-   ##
==========================================
- Coverage   50.03%   49.88%   -0.16%     
==========================================
  Files         123      123              
  Lines        2650     2658       +8     
  Branches      147      149       +2     
==========================================
  Hits         1326     1326              
- Misses       1274     1282       +8     
  Partials       50       50              
Flag Coverage Δ
#golang 70.50% <ø> (ø)
#typescript 23.49% <0.00%> (-0.17%) ⬇️
Impacted Files Coverage Δ
frontend/src/component/App.tsx 0.00% <0.00%> (ø)
frontend/src/component/UIFactory.tsx 0.00% <0.00%> (ø)
frontend/src/component/pages/HomePage.tsx 0.00% <0.00%> (ø)
frontend/src/component/pages/shared/Header.tsx 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e0beea...95bbabc. Read the comment docs.

frontend/src/component/pages/HomePage.tsx Outdated Show resolved Hide resolved
frontend/src/component/pages/HomePage.tsx Outdated Show resolved Hide resolved
frontend/src/component/pages/HomePage.tsx Outdated Show resolved Hide resolved
frontend/src/component/pages/HomePage.tsx Outdated Show resolved Hide resolved
frontend/src/component/pages/HomePage.tsx Outdated Show resolved Hide resolved
frontend/src/component/pages/HomePage.tsx Outdated Show resolved Hide resolved
frontend/src/component/pages/HomePage.tsx Outdated Show resolved Hide resolved
frontend/src/component/UIFactory.tsx Outdated Show resolved Hide resolved
frontend/src/component/UIFactory.tsx Outdated Show resolved Hide resolved
frontend/src/component/UIFactory.tsx Outdated Show resolved Hide resolved
frontend/src/component/UIFactory.tsx Outdated Show resolved Hide resolved
frontend/src/dep.ts Outdated Show resolved Hide resolved
@pull-request-size pull-request-size bot added size/M and removed size/L labels Jun 4, 2020
@magicoder10 magicoder10 merged commit 5bb07ec into master Jun 4, 2020
@magicoder10 magicoder10 deleted the admin-button branch June 4, 2020 07:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants