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: support show all enable plugin list tab #2585

Merged
merged 13 commits into from
Aug 18, 2022

Conversation

Morakes
Copy link
Contributor

@Morakes Morakes commented Aug 12, 2022

Please answer these questions before submitting a pull request, or your PR will get closed.

Why submit this pull request?

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What changes will this PR take into?

Please update this section with detailed description.

Related issues

fix/resolve #2299

Checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@guoqqqi
Copy link
Member

guoqqqi commented Aug 14, 2022

Hello @Morakes Can you help by posting a before and after picture of the change so that we can easily help review 😄

@guoqqqi guoqqqi changed the title feat:global plugin add tab feat: support show all enable plugin list tab Aug 14, 2022
@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2022

Codecov Report

Merging #2585 (1d1c056) into master (80029c6) will decrease coverage by 7.99%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2585      +/-   ##
==========================================
- Coverage   76.00%   68.00%   -8.00%     
==========================================
  Files         136      136              
  Lines        3588     3601      +13     
  Branches      865      868       +3     
==========================================
- Hits         2727     2449     -278     
- Misses        861     1152     +291     
Flag Coverage Δ
frontend-e2e-test 68.00% <100.00%> (-8.00%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
web/src/components/Plugin/PluginPage.tsx 99.00% <100.00%> (+0.14%) ⬆️
web/src/components/LabelsfDrawer/LabelsDrawer.tsx 4.16% <0.00%> (-79.17%) ⬇️
...b/src/pages/Route/components/DataLoader/Import.tsx 4.91% <0.00%> (-78.69%) ⬇️
...es/Route/components/DataLoader/loader/OpenAPI3.tsx 33.33% <0.00%> (-66.67%) ⬇️
...pages/Route/components/Step1/MatchingRulesView.tsx 25.00% <0.00%> (-54.17%) ⬇️
web/src/pages/Route/transform.ts 52.91% <0.00%> (-27.52%) ⬇️
.../src/pages/Route/components/Step1/ProxyRewrite.tsx 70.68% <0.00%> (-24.14%) ⬇️
...b/src/components/Plugin/UI/referer-restriction.tsx 69.69% <0.00%> (-21.22%) ⬇️
web/src/pages/Route/components/Step1/MetaView.tsx 78.87% <0.00%> (-21.13%) ⬇️
web/src/pages/Route/List.tsx 58.49% <0.00%> (-18.24%) ⬇️
... and 9 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@guoqqqi
Copy link
Member

guoqqqi commented Aug 15, 2022

also need to resolve these conflicts
image

@Morakes
Copy link
Contributor Author

Morakes commented Aug 15, 2022

before
0f382affc8762307c1598287b3f1f9f

after
c6f9d8dde922a7edd81d96345ab3fd9
0ad59c335399ea9c3e8b0c83dab3c73

web/src/components/Plugin/PluginPage.tsx Outdated Show resolved Hide resolved
web/src/components/Plugin/PluginPage.tsx Outdated Show resolved Hide resolved
web/src/components/Plugin/PluginPage.tsx Outdated Show resolved Hide resolved
@guoqqqi
Copy link
Member

guoqqqi commented Aug 17, 2022

also cc @SkyeYoung PTAL

Comment on lines 132 to 136
if (val === 'enablePlugins') {
setShowEnablePlugin(true);
} else {
setShowEnablePlugin(false);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (val === 'enablePlugins') {
setShowEnablePlugin(true);
} else {
setShowEnablePlugin(false);
}
setShowEnablePlugin(val === 'enablePlugins');

Comment on lines 109 to 111
const openPluginList = pluginList.filter(
(item) => initialData[item.name] && !initialData[item.name].disable,
);
Copy link
Member

@SkyeYoung SkyeYoung Aug 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will improve it

Copy link
Contributor

@Baoyuantop Baoyuantop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue that needs to be verified and fixed:

  1. Go to the Plugin List page and add Enable
  2. Enable basic auth and key auth plugin
  3. Switch tabs and data are as expected
  4. Click the Plugin menu and go to the plugin list page
  5. Click Enable button and click Enable tab
  6. Delete the last plugin and find that deleted both

@Baoyuantop
Copy link
Contributor

There is an issue that needs to be verified and fixed:

  1. Go to the Plugin List page and add Enable
  2. Enable basic auth and key auth plugin
  3. Switch tabs and data are as expected
  4. Click the Plugin menu and go to the plugin list page
  5. Click Enable button and click Enable tab
  6. Delete the last plugin and find that deleted both

Oh sorry I find this issue in #2592, please ignore this comment

@guoqqqi guoqqqi merged commit 0c0d854 into apache:master Aug 18, 2022
@@ -66,6 +66,8 @@ const PluginPage: React.FC<Props> = ({
const { formatMessage } = useIntl();
const [form] = Form.useForm();
const [pluginList, setPluginList] = useState<PluginComponent.Meta[]>([]);
const [enablePluginsList, setEnablePluginsList] = useState<PluginComponent.Meta[]>([]);
const [showEnablePlugin, setShowEnablePlugin] = useState<boolean>(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const [showEnablePlugin, setShowEnablePlugin] = useState<boolean>(false);
const [showEnablePlugin, setShowEnablePlugin] = useState(false);

@@ -66,6 +66,8 @@ const PluginPage: React.FC<Props> = ({
const { formatMessage } = useIntl();
const [form] = Form.useForm();
const [pluginList, setPluginList] = useState<PluginComponent.Meta[]>([]);
const [enablePluginsList, setEnablePluginsList] = useState<PluginComponent.Meta[]>([]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enablePluginsList can be obtained from the pluginList after calculation, no need to define a new state.

hongbinhsu pushed a commit to fitphp/apix-dashboard that referenced this pull request Sep 10, 2022
* upstream/master: (23 commits)
  feat: Add config struct of OpenID-Connect Login (apache#2597)
  feat: set serverUrlMap with env, update cypress, update stylelint (apache#2583)
  chore: fix function name typo (apache#2599)
  fix: page refresh causes deletion exception (apache#2593)
  feat: support show all enable plugin list tab (apache#2585)
  fix: drawer components delete plugin not working (apache#2573)
  feat: add batch delete function for route (apache#2502)
  test: reduce fe ci time (apache#2557)
  doc(csp): add correct csp rule (apache#2548)
  doc: add a notice about the compatibility of Ingress and Dashboard (apache#2552)
  fix: add judgement for last_report_time (apache#2551)
  fix: cli test invalid etcd (apache#2544)
  feat: fix actions version to root version (apache#2521)
  fix: duplicate ID (apache#2501)
  fix: block arbitrary file index (apache#2497)
  docs: update deploy-with-docker.md (apache#2472)
  feat: translating Turkish for new features (apache#2487)
  docs: add new import and export docs to sidebar (apache#2485)
  docs: add data loader and new OpenAPI 3 loader (apache#2484)
  feat: support data loader in frontend (apache#2480)
  ...

# Conflicts:
#	api/internal/route.go
#	web/config/defaultSettings.ts
#	web/yarn.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants