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

Oi#663 Create dropdown payType #1408

Merged
merged 18 commits into from
Jul 7, 2022
Merged

Oi#663 Create dropdown payType #1408

merged 18 commits into from
Jul 7, 2022

Conversation

Illya97
Copy link
Contributor

@Illya97 Illya97 commented Jul 4, 2022

@Illya97 Illya97 requested a review from litvinets July 4, 2022 08:02
Copy link
Contributor

@litvinets litvinets left a comment

Choose a reason for hiding this comment

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

let's restyle so we will have some space between dropdown and footer
image

@litvinets
Copy link
Contributor

add here a value
image

@litvinets
Copy link
Contributor

can you additionally fix the allocation of the price? display it in the center please
image
image
(don't break contacts-card, the one that is below)

@@ -7,7 +7,7 @@ export enum ProviderType {
Other,
}

export enum ProviderTypeUkr {
export enum ProviderTypeUkr {
Copy link
Contributor

Choose a reason for hiding this comment

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

revert this change

Comment on lines 73 to 80
export enum PayRateTypeUkr {
Classes = 'Заняття',
Month = 'Місяць',
Day = 'День',
Year = 'Рік',
Hour = 'Година',
Course = 'Курс',
AllPeriod = 'Увесь період'
Copy link
Contributor

Choose a reason for hiding this comment

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

move this enum to the ukr folder (we store all Ukrainians values in the separate folder)

Comment on lines 63 to 80
export enum PayRateType {
Classes,
Month,
Day,
Year,
Hour,
Course,
AllPeriod
}

export enum PayRateTypeUkr {
Classes = 'Заняття',
Month = 'Місяць',
Day = 'День',
Year = 'Рік',
Hour = 'Година',
Course = 'Курс',
AllPeriod = 'Увесь період'
Copy link
Contributor

Choose a reason for hiding this comment

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

move out from provider.ts because the payment does not relate to the provider, create a separate enum

@@ -23,6 +24,7 @@ import { AppState } from 'src/app/shared/store/app.state';
})
export class ActionsComponent implements OnInit, OnDestroy {
readonly Role: typeof Role = Role;
readonly PayRateTypeUkr = PayRateTypeUkr;
Copy link
Contributor

Choose a reason for hiding this comment

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

add empty row below

[max]="validationConstants.MAX_PRICE">
</mat-radio-button>
<p class="step-text">грн за</p>
<div fxLayout='row' fxLayoutAlign="space-between center" >
Copy link
Contributor

Choose a reason for hiding this comment

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

use double quotes in the html (it is a good practice for the future, the single quotes usually are used only in ts file, double - in HTML). if you see such problems in other places (even if it is not your code) - please fix it

Comment on lines 63 to 71
export enum PayRateType {
Classes,
Month,
Day,
Year,
Hour,
Course,
AllPeriod
}
Copy link
Contributor

Choose a reason for hiding this comment

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

image

@@ -13,6 +14,7 @@ import { Workshop } from 'src/app/shared/models/workshop.model';
export class WorkshopAboutComponent {
readonly workingDays = WorkingDays;
readonly workingDaysReverse = WorkingDaysReverse;
readonly PayRateTypeUkr = PayRateTypeUkr;
Copy link
Contributor

Choose a reason for hiding this comment

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

add empty row below

}else{
this.setPriceControlValue();
this.AboutFormGroup.get('payRate').reset();
this.AboutFormGroup.get('payRate')['disable']({emitEvent : true});
Copy link
Contributor

Choose a reason for hiding this comment

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

save please the previous logic, revret this change. Your functionality is handled by setPriceControlValue function

@Illya97 Illya97 requested a review from litvinets July 7, 2022 08:28
@@ -107,7 +107,7 @@ export class WorkshopSectionItem extends SectionItem {
export interface WorkshopCard {
address: Address;
directionId: number;
isPerMonth: boolean;
payRate: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

payRate: PayRateType

Comment on lines 140 to 142



Copy link
Contributor

Choose a reason for hiding this comment

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

remove empty lines

Comment on lines 135 to 138
<app-validation-hint
[validationFormControl]="AboutFormGroup.get('payRate')"
[isTouched]="AboutFormGroup.get('payRate').touched">
</app-validation-hint>
Copy link
Contributor

Choose a reason for hiding this comment

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

aligment

@@ -3,7 +3,15 @@
@import "src/app/shared/styles/dropdown.scss";
@import "src/app/shared/styles/toggle-button.scss";

.pay-type{
flex-grow: 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

woring spacing

@@ -113,6 +129,7 @@ export class CreateAboutFormComponent implements OnInit, OnDestroy {
if(this.workshop.price){
this.priceRadioBtn.setValue(true, { emitEvent: false });
this.setPriceControlValue(this.workshop.price, 'enable', false);
this.AboutFormGroup.get('payRate').setValue(this.workshop.payRate, {emitEvent : false});
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 redundant

@@ -77,7 +80,7 @@ export class CreateAboutFormComponent implements OnInit, OnDestroy {
/**
* This method makes input enable if radiobutton value is true and sets the value to teh formgroup
*/
private onPriceCtrlInit(): void {
private onPriceCtrlInit(): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this space

Comment on lines 136 to 137
[validationFormControl]="AboutFormGroup.get('payRate')"
[isTouched]="AboutFormGroup.get('payRate').touched">
Copy link
Contributor

Choose a reason for hiding this comment

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

add one space please

<div fxLayout='row' fxLayoutAlign='start center'>
<div fxLayout="row" fxLayoutAlign="start">
<div fxLayout="column" fxLayoutAlign="start start">
<div fxLayout="row "fxLayoutAlign="start center">
Copy link
Contributor

Choose a reason for hiding this comment

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

remove pelase one space

</div>
</form>

Copy link
Contributor

Choose a reason for hiding this comment

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

remove this line please

@Illya97 Illya97 merged commit c8aca6a into develop Jul 7, 2022
@Illya97 Illya97 deleted the OI#663 branch July 7, 2022 14:17
@Illya97
Copy link
Contributor Author

Illya97 commented Jul 7, 2022

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants