Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
9ecc6ff
Minor changes
KrzysztofPajak Oct 13, 2021
981324b
validate login
Oct 13, 2021
8df013c
vee validate - password recovery
Oct 13, 2021
9257c0d
vee validate - change password
Oct 13, 2021
471cccb
vee validate - delete account
Oct 13, 2021
e8f2c32
vee validate - customer info
Oct 13, 2021
94c7592
vee validate - minor changes
Oct 13, 2021
97e564c
vee validate - register
Oct 14, 2021
7a46c5b
register - minor changes
Oct 14, 2021
4d9260a
customer attributes - minor changes
Oct 14, 2021
e04ded5
vee validate - blog
Oct 14, 2021
38592d2
vee validate - contact us
Oct 14, 2021
b5dde0c
vee validate - news
Oct 14, 2021
751d8d9
contact us - minor changes
Oct 14, 2021
5d54a83
vee validate - order note
Oct 14, 2021
dbc40f1
vee validate - minor changes
Oct 14, 2021
5d49d05
vee validate - ask question
Oct 14, 2021
ae411b9
vee validate - product review modal
Oct 14, 2021
0b11b2f
address attributes - minor changes
Oct 14, 2021
8f2748d
vee validate - create or update address
Oct 14, 2021
f525ffa
vee validate - product email a friend
Oct 14, 2021
e93a210
vee validate - create or update sub account
Oct 14, 2021
27dbdc4
vee validate - create or update vendor account
Oct 14, 2021
0c6e2bc
vee validate - vendor
Oct 14, 2021
e34476e
register - minor changes
Oct 14, 2021
70e7048
vee validate checkbox - apply vendor
Oct 14, 2021
23aa346
product reviews - minor changes
Oct 15, 2021
e660149
product reviews - removed unused view
Oct 15, 2021
74b89bb
vee validate - contact vendor
Oct 15, 2021
edd9765
vee validate - email wishlist
Oct 15, 2021
f163f43
Fix register
KrzysztofPajak Oct 15, 2021
3512a72
Fix register
KrzysztofPajak Oct 15, 2021
5828c1a
fix addresses
Oct 15, 2021
741e930
fix account info
Oct 15, 2021
0d08e84
checkout - minor changes
Oct 15, 2021
8035b41
Rename variable
KrzysztofPajak Oct 15, 2021
800e5fa
apply for vendor account - fix
Oct 15, 2021
5f2c3c5
checkout - minor changes
Oct 15, 2021
7c0f8f6
register - fix
Oct 15, 2021
a11a43b
Customer Info - fix
Oct 15, 2021
5973e94
contact us - fix
Oct 15, 2021
7286270
merchandise return - fix
Oct 15, 2021
bb045c6
ask question - fix
Oct 15, 2021
c4a501e
product email a friend - fix
Oct 15, 2021
36eee44
ask question on product - fix
Oct 15, 2021
01fdc7c
create or update address - fix
Oct 15, 2021
e2c8a7c
create or update sub account - fix
Oct 15, 2021
2188620
create or update vendor address -fix
Oct 15, 2021
796c491
apply vendor - fix
Oct 15, 2021
7e963e3
contact vendor - fix
Oct 15, 2021
32248d7
vendor info - fix
Oct 15, 2021
cbc181f
email wishlist - fix
Oct 15, 2021
b5b4208
ask question on product - fixed
Oct 15, 2021
558820f
vee validate - form submit
Oct 15, 2021
e17b7d3
b-navbar plugin - removed
Oct 15, 2021
82a95ec
state province - minor changes
Oct 15, 2021
2d4a818
vendor - minor changes
Oct 15, 2021
e56f54f
Add collapse
KrzysztofPajak Oct 15, 2021
35514b8
Merge branch 'issue-script-preload-2' of https://github.com/grandnode…
KrzysztofPajak Oct 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Web/Grand.Web/Validators/Customer/LoginValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ public LoginValidator(
{
if (!customerSettings.UsernamesEnabled)
{
//login by email
RuleFor(x => x.Email).NotEmpty().WithMessage(translationService.GetResource("Account.Login.Fields.Email.Required"));
RuleFor(x => x.Password).NotEmpty().WithMessage(translationService.GetResource("Account.Login.Fields.Password.Required"));
RuleFor(x => x.Email).EmailAddress().WithMessage(translationService.GetResource("Common.WrongEmail"));
}
else
{
RuleFor(x => x.Username).NotEmpty().WithMessage(translationService.GetResource("Account.Login.Fields.UserName.Required"));
RuleFor(x => x.Password).NotEmpty().WithMessage(translationService.GetResource("Account.Login.Fields.Password.Required"));
}
}
}
}
30 changes: 16 additions & 14 deletions src/Web/Grand.Web/Views/Account/AddressAdd.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@
@await Component.InvokeAsync("CustomerNavigation", new { selectedTabId = AccountNavigationEnum.Addresses })
}
<vc:widget widget-zone="customer-address-add-before" additional-data="@Model"></vc:widget>
<form asp-route="CustomerAddressAdd" method="post" v-on:submit.prevent="validateBeforeSubmit($event)">
<div class="page account-page address-edit-page pl-lg-3 mb-3 pt-lg-0 pt-3">
<h1 class="generalTitle h2">@Loc["Account.CustomerAddresses.AddNew"]</h1>
<div asp-validation-summary="All" class="message-error"></div>
@{
var dataDictAddress = new ViewDataDictionary(ViewData);
dataDictAddress.TemplateInfo.HtmlFieldPrefix = "Address";
<partial name="_CreateOrUpdateAddress" model="Model.Address" view-data="dataDictAddress" />
}
<vc:widget widget-zone="customer-address-add-form" additional-data="@Model"></vc:widget>
<div class="buttons generalMarginSupporter mt-1 mb-1">
<input type="submit" class="btn btn-info save-address-button" value="@Loc["Common.Save"]" />
<validation-observer v-slot="{ handleSubmit }">
<form asp-route="CustomerAddressAdd" method="post" ref="form" v-on:submit.prevent="handleSubmit(formSubmit)">
<div class="page account-page address-edit-page pl-lg-3 mb-3 pt-lg-0 pt-3">
<h1 class="generalTitle h2">@Loc["Account.CustomerAddresses.AddNew"]</h1>
<div asp-validation-summary="All" class="message-error"></div>
@{
var dataDictAddress = new ViewDataDictionary(ViewData);
dataDictAddress.TemplateInfo.HtmlFieldPrefix = "Address";
<partial name="_CreateOrUpdateAddress" model="Model.Address" view-data="dataDictAddress" />
}
<vc:widget widget-zone="customer-address-add-form" additional-data="@Model"></vc:widget>
<div class="buttons generalMarginSupporter mt-1 mb-1">
<input type="submit" class="btn btn-info save-address-button" value="@Loc["Common.Save"]" />
</div>
</div>
</div>
</form>
</form>
</validation-observer>
<vc:widget widget-zone="customer-address-add-after" additional-data="@Model"></vc:widget>
30 changes: 16 additions & 14 deletions src/Web/Grand.Web/Views/Account/AddressEdit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@
@await Component.InvokeAsync("CustomerNavigation", new { selectedTabId = AccountNavigationEnum.Addresses })
}
<vc:widget widget-zone="customer-address-edit-before" additional-data="@Model"></vc:widget>
<form asp-route="CustomerAddressEdit" method="post" v-on:submit.prevent="validateBeforeSubmit($event)">
<div class="page account-page address-edit-page pl-lg-3 mb-3 pt-lg-0 pt-3">
<h1 class="h2 generalTitle">@Loc["Account.CustomerAddresses.Edit"]</h1>
<div asp-validation-summary="All" class="message-error"></div>
@{
var dataDictAddress = new ViewDataDictionary(ViewData);
dataDictAddress.TemplateInfo.HtmlFieldPrefix = "Address";
<partial name="_CreateOrUpdateAddress" model="Model.Address" view-data="dataDictAddress" />
}
<vc:widget widget-zone="customer-address-edit-form" additional-data="@Model"></vc:widget>
<div class="buttons generalMarginSupporter">
<input type="submit" class="btn btn-info save-address-button" value="@Loc["Common.Save"]" />
<validation-observer v-slot="{ handleSubmit }">
<form asp-route="CustomerAddressEdit" method="post" ref="form" v-on:submit.prevent="handleSubmit(formSubmit)">
<div class="page account-page address-edit-page pl-lg-3 mb-3 pt-lg-0 pt-3">
<h1 class="h2 generalTitle">@Loc["Account.CustomerAddresses.Edit"]</h1>
<div asp-validation-summary="All" class="message-error"></div>
@{
var dataDictAddress = new ViewDataDictionary(ViewData);
dataDictAddress.TemplateInfo.HtmlFieldPrefix = "Address";
<partial name="_CreateOrUpdateAddress" model="Model.Address" view-data="dataDictAddress" />
}
<vc:widget widget-zone="customer-address-edit-form" additional-data="@Model"></vc:widget>
<div class="buttons generalMarginSupporter">
<input type="submit" class="btn btn-info save-address-button" value="@Loc["Common.Save"]" />
</div>
</div>
</div>
</form>
</form>
</validation-observer>
<vc:widget widget-zone="customer-address-edit-after" additional-data="@Model"></vc:widget>
89 changes: 53 additions & 36 deletions src/Web/Grand.Web/Views/Account/ChangePassword.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,58 @@
{
@await Component.InvokeAsync("CustomerNavigation", new { selectedTabId = AccountNavigationEnum.ChangePassword })
}
<form asp-route="CustomerChangePassword" method="post" v-on:submit.prevent="validateBeforeSubmit($event)">
<section class="page account-page change-password-page pl-lg-3 pt-3 pt-lg-0">
<h1 class="h2 generalTitle">@Loc["Account.ChangePassword"]</h1>
@if (!String.IsNullOrEmpty(Model.Result))
{
<section class="result alert alert-info">
@Model.Result
</section>
}
<div asp-validation-summary="ModelOnly" class="message-error"></div>
<validation-observer v-slot="{ handleSubmit }">
<form asp-route="CustomerChangePassword" method="post" ref="form" v-on:submit.prevent="handleSubmit(formSubmit)">
<section class="page account-page change-password-page pl-lg-3 pt-3 pt-lg-0">
<h1 class="h2 generalTitle">@Loc["Account.ChangePassword"]</h1>
@if (!String.IsNullOrEmpty(Model.Result))
{
<section class="result alert alert-info">
@Model.Result
</section>
}
<div asp-validation-summary="ModelOnly" class="message-error"></div>

<fieldset>
<div class="form-fields">
<fieldset class="form-group">
<label asp-for="OldPassword" class="col-form-label">@Loc["Account.ChangePassword.Fields.OldPassword"]:</label>
<input asp-for="OldPassword" class="form-control" v-validate="'required'" />
<span class="field-validation-error">{{veeErrors.first('OldPassword')}}</span>
<span asp-validation-for="OldPassword"></span>
</fieldset>
<fieldset class="form-group">
<label asp-for="NewPassword" class="col-form-label">@Loc["Account.ChangePassword.Fields.NewPassword"]:</label>
<input asp-for="NewPassword" class="form-control" v-validate="'required|min:NewPassword'" ref="newpassword" />
<span class="field-validation-error">{{veeErrors.first('NewPassword')}}</span>
<span asp-validation-for="NewPassword"></span>
</fieldset>
<fieldset class="form-group">
<label asp-for="ConfirmNewPassword" class="col-form-label">@Loc["Account.ChangePassword.Fields.ConfirmNewPassword"]:</label>
<input asp-for="ConfirmNewPassword" class="form-control" v-validate="'required|confirmed:newpassword'" />
<span class="field-validation-error">{{veeErrors.first('ConfirmNewPassword')}}</span>
<span asp-validation-for="ConfirmNewPassword"></span>
</fieldset>
<fieldset>
<div class="form-fields">
<fieldset class="form-group">
<validation-provider tag="div" rules="required" name="OldPassword" v-slot="{ errors }">
<label asp-for="OldPassword" class="col-form-label">@Loc["Account.ChangePassword.Fields.OldPassword"]:</label>
<input asp-for="OldPassword" v-model="changepassword.OldPassword" class="form-control username" autofocus="autofocus" />
<span class="field-validation-error">{{ errors[0] }}</span>
<span asp-validation-for="OldPassword"></span>
</validation-provider>
</fieldset>
<fieldset class="form-group">
<validation-provider tag="div" vid="changepassword.NewPassword" rules="required" v-slot="{ errors }">
<label asp-for="NewPassword" class="col-form-label">@Loc["Account.ChangePassword.Fields.NewPassword"]:</label>
<input asp-for="NewPassword" v-model="changepassword.NewPassword" class="form-control username" autofocus="autofocus" />
<span class="field-validation-error">{{ errors[0] }}</span>
<span asp-validation-for="NewPassword"></span>
</validation-provider>
</fieldset>
<fieldset class="form-group">
<validation-provider tag="div" vid="changepassword.ConfirmNewPassword" rules="required|confirmed:@@changepassword.NewPassword" v-slot="{ errors }">
<label asp-for="ConfirmNewPassword" class="col-form-label">@Loc["Account.ChangePassword.Fields.ConfirmNewPassword"]:</label>
<input asp-for="ConfirmNewPassword" v-model="changepassword.ConfirmNewPassword" class="form-control username" autofocus="autofocus" />
<span class="field-validation-error">{{ errors[0] }}</span>
<span asp-validation-for="ConfirmNewPassword"></span>
</validation-provider>
</fieldset>
</div>
</fieldset>
<div class="text-xs-center">
<input type="submit" class="btn btn-info change-password-button" value="@Loc["Account.ChangePassword.Button"]" />
</div>
</fieldset>
<div class="text-xs-center">
<input type="submit" class="btn btn-info change-password-button" value="@Loc["Account.ChangePassword.Button"]" />
</div>
</section>
</form>
</section>
</form>
</validation-observer>
<script asp-location="Footer" asp-order="300">
var changepassword = new Vue({
data: () => ({
OldPassword: '',
NewPassword: '',
ConfirmNewPassword: '',
})
});
</script>
53 changes: 32 additions & 21 deletions src/Web/Grand.Web/Views/Account/DeleteAccount.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,36 @@
{
@await Component.InvokeAsync("CustomerNavigation", new { selectedTabId = AccountNavigationEnum.DeleteAccount })
}
<form asp-route="CustomerDeleteAccount" method="post" autocomplete="off" v-on:submit.prevent="validateBeforeSubmit($event)">
<section class="page account-page change-password-page pl-lg-3 pt-3 pt-lg-0">
<h1 class="h2 generalTitle">@Loc["Account.DeleteAccount"]</h1>
<div asp-validation-summary="ModelOnly" class="message-error"></div>
<div class="alert alert-danger" role="alert">
@Loc["Account.DeleteAccount.DangerAlert"]
</div>
<fieldset>
<div class="form-fields">
<fieldset class="form-group">
<label asp-for="Password" class="col-form-label">@Loc["Account.DeleteAccount.Fields.Password"]:</label>
<input asp-for="Password" class="form-control" v-validate="'required'" />
<span class="field-validation-error">{{veeErrors.first('Password')}}</span>
<span asp-validation-for="Password"></span>
</fieldset>
<validation-observer v-slot="{ handleSubmit }">
<form asp-route="CustomerDeleteAccount" method="post" autocomplete="off" ref="form" v-on:submit.prevent="handleSubmit(formSubmit)">
<section class="page account-page change-password-page pl-lg-3 pt-3 pt-lg-0">
<h1 class="h2 generalTitle">@Loc["Account.DeleteAccount"]</h1>
<div asp-validation-summary="ModelOnly" class="message-error"></div>
<div class="alert alert-danger" role="alert">
@Loc["Account.DeleteAccount.DangerAlert"]
</div>
</fieldset>
<div class="text-xs-center">
<input type="submit" class="btn btn-danger change-password-button" value="@Loc["Account.DeleteAccount.Button"]" onclick="return confirm('@Loc["Admin.Common.AreYouSure"]'); " />
</div>
</section>
</form>
<fieldset>
<div class="form-fields">
<fieldset class="form-group">
<validation-provider tag="div" rules="required" name="Password" v-slot="{ errors }">
<label asp-for="Password" class="col-form-label">@Loc["Account.DeleteAccount.Fields.Password"]:</label>
<input asp-for="Password" v-model="deleteaccount.Password" class="form-control username" autofocus="autofocus" />
<span class="field-validation-error">{{ errors[0] }}</span>
<span asp-validation-for="Password"></span>
</validation-provider>
</fieldset>
</div>
</fieldset>
<div class="text-xs-center">
<input type="submit" class="btn btn-danger change-password-button" value="@Loc["Account.DeleteAccount.Button"]" onclick="return confirm('@Loc["Admin.Common.AreYouSure"]'); " />
</div>
</section>
</form>
</validation-observer>
<script asp-location="Footer" asp-order="300">
var deleteaccount = new Vue({
data: () => ({
Password: '',
})
});
</script>
Loading