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

EPMRPP-78035 || Launch and Test item description validation update #3188

Merged
merged 8 commits into from
Jul 25, 2022

Conversation

tr1ble
Copy link
Contributor

@tr1ble tr1ble commented Jul 22, 2022

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2022

Codecov Report

Merging #3188 (8a60d54) into develop (4c2811d) will decrease coverage by 0.02%.
The diff coverage is 50.00%.

@@             Coverage Diff             @@
##           develop    #3188      +/-   ##
===========================================
- Coverage    59.70%   59.67%   -0.03%     
===========================================
  Files           75       75              
  Lines          804      806       +2     
  Branches       118      118              
===========================================
+ Hits           480      481       +1     
- Misses         296      297       +1     
  Partials        28       28              
Impacted Files Coverage Δ
...pp/src/common/utils/validation/commonValidators.js 0.00% <0.00%> (ø)
app/src/common/utils/validation/validate.js 96.77% <100.00%> (+0.05%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.

Copy link
Contributor

@chivekrodis chivekrodis left a comment

Choose a reason for hiding this comment

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

Solution doesn't work
error is not appear after entering more than 2048 symbols
info hint not appears after entering 1000 symbols(comment to the task)

Comment on lines +235 to +238
descriptionHint: {
id: 'EditItemModal.descriptionHint',
defaultMessage: "Description should have size from '0' to '2048' symbols",
},
Copy link
Contributor

Choose a reason for hiding this comment

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

According to the task there is should be a hint for each level like(launch, suite, test, step)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we use the same modal for launch, suite and so on, I've asked to use one message for all levels

Copy link
Contributor

Choose a reason for hiding this comment

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

As I know we have selector to detect level
Also in case of any changes of the task you should ask to update it to avoid misunderstanding between owner and reviewers, qa team

@@ -269,3 +272,23 @@
}
}
}

@mixin additional-text($color) {
position: relative;
Copy link
Contributor

Choose a reason for hiding this comment

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

What the reason using position here? Why not margin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it doesn't work in another case

Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -23,6 +23,9 @@
&.focused {
border-color: $COLOR--topaz;
}
&.invalid {
border-color: $COLOR--orange-red;
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't match design

active: PropTypes.bool,
touched: PropTypes.bool,
error: PropTypes.string,
hint: PropTypes.string,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add hint here? Yoг don't provide this props anywhere. But task have comment about it check it

}

.error {
@include additional-text($COLOR--red-failed-2);
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't match design
but maybe border color and error color should have the same color

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think so too

Comment on lines 65 to 67
&.color-orange {
color: $COLOR--black-1;
}
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 confusing. color orange but actually black

@@ -182,6 +184,7 @@ export class ModalLayout extends Component {
const {
title,
warningMessage,
warningColor,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe better provide warning type or appearance and rely on it f.e we have warningType = info, so he is responsible for making the icon orange and the text black

Comment on lines 65 to 67
&.color-orange {
color: $COLOR--black-1;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This confuses. color orange but actually black
Maybe better provide warning type or appearance and rely on it f.e we have warningType = warn, so he is responsible for making the icon orange and the text black
error make them both red
and so on

Copy link
Contributor Author

@tr1ble tr1ble Jul 22, 2022

Choose a reason for hiding this comment

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

Yeah, I agree, I've though about it too, but in this case we have to update all used footers

Copy link
Member

Choose a reason for hiding this comment

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

I think its Ok to update all warning appearance as they are rendered by same modal layout.

@@ -515,6 +515,7 @@
"EditItemModal.attributesLabel": "Атрыбуты",
"EditItemModal.contentTitle": "Апісанне {type}а",
"EditItemModal.descriptionPlaceholder": "Увядзіце апісанне {type}а",
"EditItemModal.descriptionHint": "Апісанне павінна мець памер ад '0' да '2048' сімвалаў",
Copy link
Member

Choose a reason for hiding this comment

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

Please use the same quotes everywhere.

Comment on lines 65 to 67
&.color-orange {
color: $COLOR--black-1;
}
Copy link
Member

Choose a reason for hiding this comment

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

I think its Ok to update all warning appearance as they are rendered by same modal layout.

Copy link
Contributor

@chivekrodis chivekrodis left a comment

Choose a reason for hiding this comment

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

Are you sure that error is appear?

Comment on lines 310 to 311
this.simpleMDE &&
condition(this.simpleMDE.value()) && <div className={cx('hint')}>{text}</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

As I see MarkdownEditor has value props maybe we can use it instead of
this.simpleMDE && condition(this.simpleMDE.value())
Also as MarkdownEditor is kind of common component if I want provide hint somewhere else I should always provide condition function even if I don't needed it(bcs without it it's leads to error) so maybe default hint should looks like

hint: { hintText: '', hintConditionFn: () => true }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I saw the error.
value doesn't work. I've tried it first.

@@ -138,10 +138,10 @@ export class ModalFooter extends Component {
)}
{warningMessage && (
<div className={cx('warning-block')}>
<i className={cx('warning-icon', { [`color-${warningColor}`]: warningColor })}>
<i className={cx('warning-icon', { [warningType]: warningType })}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe type-${warningType} and &.warning-type-info in scss to have more vision in the scss

@@ -85,7 +85,7 @@ export class ModalLayout extends Component {
title: '',
children: null,
warningMessage: '',
warningColor: '',
warningType: '',
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't have any default state?

@@ -105,6 +105,10 @@ const messages = defineMessages({
id: 'TestItemDetailsModal.parametersLabel',
defaultMessage: 'Parameters:',
},
descriptionHint: {
id: 'EditItemModal.descriptionAdviceHint',
defaultMessage: 'You used 1000 of 2048 symbols',
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 static text, so the user can enter 2048 characters but still see that text, maybe the idea was to dynamically count?

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'll ask UX.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

UX said that thought about static text, but if possible we can improve it to dynamic

@tr1ble tr1ble requested a review from chivekrodis July 22, 2022 12:43
@AmsterGet AmsterGet merged commit 8094249 into develop Jul 25, 2022
@AmsterGet AmsterGet deleted the EPMRPP-78035_Description_validation branch July 25, 2022 10:58
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.

4 participants