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

Front/webhooks editview #4962

Merged
merged 59 commits into from
Jan 17, 2020
Merged

Front/webhooks editview #4962

merged 59 commits into from
Jan 17, 2020

Conversation

virginieky
Copy link
Contributor

Description of what you did:

Webhook feature

  • Retrieve and display all webhooks as a list
  • Delete one or several webhooks from a list view
  • Enable/disable webhook from the list
  • Create a webhook
  • Edit a webhook
  • Test a webhook trigger and display the result

My PR is a:

  • 💥 Breaking change
  • 🐛 Bug fix
  • 💅 Enhancement
  • 🚀 New feature

Main update on the:

  • Admin
  • Documentation
  • Framework
  • Plugin

Manual testing done on the following databases:

  • Not applicable
  • MongoDB
  • MySQL
  • Postgres
  • SQLite

@soupette soupette mentioned this pull request Jan 13, 2020
13 tasks
padding: 54px 30px 30px;
text-align: center;
background-color: white;
p,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you avoid global selectors? maybe you can create components instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I won't create a component just to set a line-height: normal attribute. I wish it's a problem we will never have again after setting the new design system: this attribute should be set to all elements in a reset file, it's the way the entire admin should work.

For the <p/> element, the selector :first-of-type makes it non global.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, you are right. Regarding the reset css do you thing that this is a task we should undertake soon?
I know that we have an import of sanitize.css in the entry point of the admin do you think that we should remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a task we should indeed undertake soon, but it may take some time to check it doesn't broke the grid :(
sanitize.css is great for some generic attributes but it seems we cannot custom it. Maybe we can replace it by our own reset rules (like button hasn't an outline, p doesn't have a margin-bottom by default, or all the ul has a list-styleattribute set tonone`, etc) based on the future design system so we're sure not to specify it each time.

packages/strapi-admin/admin/src/containers/Admin/index.js Outdated Show resolved Hide resolved
actions: headersActions,
};

const handleBlur = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you reorder your functions here as well?

@codecov
Copy link

codecov bot commented Jan 16, 2020

Codecov Report

❗ No coverage uploaded for pull request base (features/webhooks@cc82180). Click here to learn what that means.
The diff coverage is 3.64%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##             features/webhooks   #4962   +/-   ##
===================================================
  Coverage                     ?   9.87%           
===================================================
  Files                        ?     635           
  Lines                        ?    8634           
  Branches                     ?    1334           
===================================================
  Hits                         ?     853           
  Misses                       ?    6553           
  Partials                     ?    1228
Flag Coverage Δ
#front 7.51% <3.64%> (?)
#unit 38.42% <ø> (?)
Impacted Files Coverage Δ
.../admin/src/containers/Webhooks/EditView/Wrapper.js 100% <ø> (ø)
...ent-type-builder/admin/src/components/List/List.js 0% <ø> (ø)
...admin/admin/src/components/HeadersInput/Wrapper.js 100% <ø> (ø)
...pi-admin/admin/src/components/EmptyList/Wrapper.js 100% <ø> (ø)
...i-admin/admin/src/components/EventInput/Wrapper.js 100% <ø> (ø)
...min/admin/src/components/TriggerContainer/index.js 50% <ø> (ø)
...min/src/containers/Webhooks/EditView/utils/form.js 100% <ø> (ø)
...-admin/admin/src/components/EventInput/EventRow.js 30% <0%> (ø)
...nt-manager/admin/src/components/CustomTable/Row.js 0% <0%> (ø)
...i-admin/admin/src/components/HeadersInput/index.js 13.04% <0%> (ø)
... and 19 more

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 cc82180...af578e9. Read the comment docs.

});
}
} catch (err) {
if (isMounted.current) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure this is needed here but the setShowModal(false) should be inside the isMounted condition


const schema = yup.object().shape({
name: yup
.string(translatedErrors.string)
Copy link
Contributor

Choose a reason for hiding this comment

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

The string property does not exist in this object. Here's the corresponding file

method: 'GET',
});

if (isMounted.current) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not needed here

try {
await schema.validate(modifiedData, { abortEarly: false });

if (isMounted.current) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The isMounted logic here is not needed, we should use it when we are requesting the API

}
}
} catch (err) {
if (isMounted.current) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Signed-off-by: Virginie Ky <virginie.ky@gmail.com>
Signed-off-by: Virginie Ky <virginie.ky@gmail.com>
onChange({ target: { name: inputName, value: Array.from(set) } });
};

console.log('yoyo');
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove the console?

Signed-off-by: Virginie Ky <virginie.ky@gmail.com>
Copy link
Contributor

@soupette soupette left a comment

Choose a reason for hiding this comment

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

LGTM

@soupette soupette merged commit 7ccd012 into features/webhooks Jan 17, 2020
@soupette soupette deleted the front/webhooks-editview branch January 17, 2020 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants