Skip to content

Commit 1220f04

Browse files
author
kadir.avci
committed
Added new client side js libraries. Added bundleconfig. Added validation. Did some code fixes and applied best practices.
1 parent e4bbaf7 commit 1220f04

File tree

217 files changed

+178977
-1139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+178977
-1139
lines changed
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
-640 KB
Binary file not shown.

Model/ViewModels/ProductActivityVM.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Microsoft.AspNetCore.Mvc.Rendering;
22
using Model.Models;
3+
using System;
34
using System.Collections.Generic;
45
using System.ComponentModel.DataAnnotations;
56

@@ -18,18 +19,25 @@ public class ProductActivityVM
1819

1920
public class ProductActivityForJson : BaseModel
2021
{
22+
[Required]
2123
[Display(Name = "Activity Type")]
2224
public int? ActivityTypeId { get; set; }
2325

2426
public string ActivityType { get; set; }
2527

28+
[Required]
2629
[Display(Name = "WareHouse")]
2730
public int? WareHouseId { get; set; }
2831

2932
public string WareHouse { get; set; }
3033

34+
[Required]
3135
[Display(Name = "Invoice No.")]
3236
public string InvoiceNumber { get; set; }
37+
38+
[Required]
39+
[Display(Name = "Activity Date")]
40+
public DateTime ActivityDate { get; set; }
3341
}
3442

3543
public class ProductJson : BaseModel

VueJsTutorial/BundleConfig.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[
2+
{
3+
"outputFileName": "wwwroot/release/site.css",
4+
"inputFiles": [
5+
"wwwroot/lib/bootstrap/css/bootstrap.css",
6+
"wwwroot/lib/noty/noty.css",
7+
"wwwroot/lib/flatpickr/flatpickr.css",
8+
"wwwroot/lib/flatpickr/ie.css",
9+
"wwwroot/css/site.css"
10+
],
11+
"minify": {
12+
"enabled": true,
13+
"renameLocals": true
14+
}
15+
},
16+
{
17+
"outputFileName": "wwwroot/release/library-bundle.js",
18+
"inputFiles": [
19+
"wwwroot/lib/axios.js",
20+
"wwwroot/lib/flatpickr/flatpickr.js",
21+
"wwwroot/lib/lodash/lodash.js",
22+
"wwwroot/lib/noty/noty.js"
23+
],
24+
"minify": {
25+
"enabled": false,
26+
"renameLocals": true
27+
}
28+
},
29+
{
30+
"outputFileName": "wwwroot/release/vue-bundle.js",
31+
"inputFiles": [
32+
"wwwroot/lib/vuejs/vue.js",
33+
//"wwwroot/lib/vuelidate-error-extractor/dist/vuelidate-error-extractor.js",
34+
//"wwwroot/lib/vuelidate/dist/validators.min.js",
35+
//"wwwroot/lib/vuelidate/dist/vuelidate.min.js"
36+
37+
],
38+
"minify": {
39+
"enabled": false,
40+
"renameLocals": true
41+
}
42+
},
43+
{
44+
"outputFileName": "wwwroot/release/site.js",
45+
"inputFiles": [
46+
"wwwroot/js/site.js"
47+
],
48+
"minify": {
49+
"enabled": false,
50+
"renameLocals": true
51+
}
52+
}
53+
]

VueJsTutorial/Views/ProductActivity/Form.cshtml

Lines changed: 61 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -8,69 +8,70 @@
88
<div id="formApp">
99
<h5>Product Master</h5>
1010
<br />
11-
<div class="row product_master">
12-
<div class="col-6">
13-
<otextboxfor asp-for="Product.Heading" v-model-name="result.product.heading" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
14-
<otextboxfor asp-for="Product.Description" v-model-name="result.product.description" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
15-
<otextboxfor asp-for="Product.Barcode" v-model-name="result.product.barcode" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
16-
</div>
17-
<div class="col-6">
18-
<otextboxfor asp-for="Product.Email" v-model-name="result.product.email" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
19-
<otextboxfor asp-for="Product.Price" v-model-name="result.product.price" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
20-
<otextboxfor asp-for="Product.ProductionYear" v-model-name="result.product.productionYear" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
21-
</div>
22-
</div>
23-
<hr />
24-
<h5>Product Activity</h5>
25-
<br />
26-
<div class="row product_activities">
27-
<div class="col-6">
28-
<odropdownfor v-model-name="result.productActivityForJson.ActivityTypeId" v-get-text="true" asp-for="@Model.ProductActivityForJson.ActivityTypeId" asp-items="@Model.ActivityTypes" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></odropdownfor>
29-
</div>
30-
<div class="col-6">
31-
<odropdownfor v-model-name="result.productActivityForJson.WareHouseId" v-get-text="true" asp-for="@Model.ProductActivityForJson.WareHouseId" asp-items="@Model.WareHouses" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></odropdownfor>
32-
</div>
33-
<div class="col-6">
34-
<otextboxfor v-model-name="result.productActivityForJson.InvoiceNumber" asp-for="@Model.ProductActivityForJson.InvoiceNumber" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
11+
<form>
12+
<div class="row product_master">
13+
<div class="col-6">
14+
<otextboxfor asp-for="Product.Heading" v-model-name="result.product.heading" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
15+
<otextboxfor asp-for="Product.Description" v-model-name="result.product.description" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
16+
<otextboxfor asp-for="Product.Barcode" v-model-name="result.product.barcode" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
17+
</div>
18+
<div class="col-6">
19+
<otextboxfor asp-for="Product.Email" v-model-name="result.product.email" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
20+
<otextboxfor asp-for="Product.Price" v-model-name="result.product.price" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
21+
<otextboxfor asp-for="Product.ProductionYear" v-model-name="result.product.productionYear" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
22+
</div>
3523
</div>
36-
<div class="col-6">
37-
<div class="form-group row">
38-
<label class="control-label col-4">Date</label>
39-
<input type="text" class="form-control date-control col-8" />
24+
<hr />
25+
<h5>Product Activity</h5>
26+
<br />
27+
<div class="row product_activities">
28+
<div class="col-6">
29+
<odropdownfor v-model-name="result.productActivityForJson.ActivityTypeId" v-get-text="true" asp-for="@Model.ProductActivityForJson.ActivityTypeId" asp-items="@Model.ActivityTypes" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></odropdownfor>
30+
</div>
31+
<div class="col-6">
32+
<odropdownfor v-model-name="result.productActivityForJson.WareHouseId" v-get-text="true" asp-for="@Model.ProductActivityForJson.WareHouseId" asp-items="@Model.WareHouses" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></odropdownfor>
33+
</div>
34+
<div class="col-6">
35+
<otextboxfor v-model-name="result.productActivityForJson.InvoiceNumber" asp-for="@Model.ProductActivityForJson.InvoiceNumber" input-css="form-control col-8" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
4036
</div>
37+
<div class="col-6">
38+
<otextboxfor v-model-name="result.productActivityForJson.ActivityDate" asp-for="@Model.ProductActivityForJson.ActivityDate" input-css="form-control col-8 date-control" has-parent="true" parent-css="form-group row" has-label="true" label-css="control-label col-4" required-css="text-red"></otextboxfor>
39+
</div>
40+
</div>
41+
<p>
42+
<button v-on:click.prevent="handleSubmit" class="btn btn-primary pull-right">Add Product Detail</button>
43+
</p>
44+
<br /><br />
45+
<div class="table-responsive" v-if="result.productActivities.length > 0">
46+
<h6>Product Activity Details</h6>
47+
<table class="table sub_list">
48+
<thead>
49+
<tr>
50+
<td colspan="100%">
51+
<a v-on:click.prevent="handleEdit" href="javascript:void(0);" class="edit-list-item"><i class="fa fa-pencil"></i> Edit</a>
52+
<a href="javascript:void(0);" class="delete-list-item"><i class="fa fa-trash"></i> Delete</a>
53+
</td>
54+
</tr>
55+
<tr>
56+
<td></td>
57+
<td>Activity</td>
58+
<td>Warehouse</td>
59+
<td>Invoice No</td>
60+
<td>Activity Date</td>
61+
</tr>
62+
</thead>
63+
<tbody>
64+
<tr v-for="activity in result.productActivities" v-if="activity.Show">
65+
<td><input type="checkbox" class="" value="activity.RowId" @@change="handleSelection(activity)" /></td>
66+
<td>{{activity.ActivityType}}</td>
67+
<td>{{activity.WareHouse}}</td>
68+
<td>{{activity.InvoiceNumber}}</td>
69+
<td>{{activity.ActivityDate}}</td>
70+
</tr>
71+
</tbody>
72+
</table>
4173
</div>
42-
</div>
43-
<p>
44-
<button v-on:click.prevent="submit" class="btn btn-primary pull-right">Add Product Detail</button>
45-
</p>
46-
<br /><br />
47-
<div class="table-responsive" v-if="result.productActivities.length > 0">
48-
<h6>Product Activity Details</h6>
49-
<table class="table sub_list">
50-
<thead>
51-
<tr>
52-
<td colspan="100%">
53-
<a v-on:click.prevent="handleEdit" href="javascript:void(0);" class="edit-list-item"><i class="fa fa-pencil"></i> Edit</a>
54-
<a href="javascript:void(0);" class="delete-list-item"><i class="fa fa-trash"></i> Delete</a>
55-
</td>
56-
</tr>
57-
<tr>
58-
<td></td>
59-
<td>Activity</td>
60-
<td>Warehouse</td>
61-
<td>Invoice No</td>
62-
</tr>
63-
</thead>
64-
<tbody>
65-
<tr v-for="activity in result.productActivities" v-if="activity.Show">
66-
<td><input type="checkbox" class="" value="activity.RowId" @@change="handleSelection(activity)" /></td>
67-
<td>{{activity.ActivityTypeIdHeading}}</td>
68-
<td>{{activity.WareHouseIdHeading}}</td>
69-
<td>{{activity.InvoiceNumber}}</td>
70-
</tr>
71-
</tbody>
72-
</table>
73-
</div>
74+
</form>
7475
</div>
7576

7677
@section scripts {

VueJsTutorial/Views/Shared/_Layout.cshtml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
<meta charset="utf-8"/>
55
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
66
<title>@ViewData["Title"] - VueJS</title>
7-
<environment include="Development">
8-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"/>
9-
</environment>
7+
<environment include="Development"></environment>
108
<environment exclude="Development">
119
@*<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css"
1210
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
@@ -16,10 +14,7 @@
1614
</environment>
1715
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap&subset=latin-ext" rel="stylesheet"/>
1816
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
19-
<link href="~/lib/noty/noty.min.css" rel="stylesheet"/>
20-
<link href="~/lib/flatpickr/flatpickr.min.css" rel="stylesheet"/>
21-
<link href="~/lib/flatpickr/ie.css" rel="stylesheet"/>
22-
<link rel="stylesheet" href="~/css/site.css"/>
17+
<link href="~/release/site.min.css" rel="stylesheet"/>
2318
</head>
2419
<body>
2520
<header>
@@ -58,10 +53,6 @@
5853
</div>
5954
</footer>
6055
<environment include="Development">
61-
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.0/axios.min.js"></script>
62-
<script src="https://cdn.jsdelivr.net/npm/lodash@4.13.1/lodash.min.js"></script>
63-
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
64-
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script>
6556
@*<script src="~/lib/jquery/dist/jquery.js"></script>
6657
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>*@
6758
</environment>
@@ -79,15 +70,15 @@
7970
integrity="sha256-E/V4cWE4qvAeO5MOhjtGtqDzPndRO1LBk8lJ/PR7CA4=">
8071
</script>*@
8172
</environment>
82-
83-
<script src="~/lib/flatpickr/flatpickr.min.js"></script>
84-
<script src="~/lib/noty/noty.min.js"></script>
85-
<script src="~/js/vuehelpers.js" asp-append-version="true"></script>
73+
<script src="~/release/library-bundle.js" asp-append-version="true"></script>
74+
<script src="~/release/vue-bundle.js" asp-append-version="true"></script>
75+
<script src="~/js/declarations.js" asp-append-version="true"></script>
8676
<script src="~/js/events.js" asp-append-version="true"></script>
77+
<script src="~/js/vuehelpers.js" asp-append-version="true"></script>
8778
<script src="~/js/ajaxHelper.js" asp-append-version="true"></script>
8879
<script src="~/js/helper.js" asp-append-version="true"></script>
8980
<script src="~/js/toolbar.js" asp-append-version="true"></script>
90-
<script src="~/js/site.js" asp-append-version="true"></script>
81+
<script src="~/release/site.js" asp-append-version="true"></script>
9182
@RenderSection("Scripts", required: false)
9283
</body>
9384
</html>

VueJsTutorial/VueJsTutorial.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
<TargetFramework>netcoreapp2.2</TargetFramework>
55
</PropertyGroup>
66

7+
<ItemGroup>
8+
<_ContentIncludedByDefault Remove="wwwroot\css\site.min.css" />
9+
</ItemGroup>
10+
711

812
<ItemGroup>
913
<PackageReference Include="Microsoft.AspNetCore.App" />

VueJsTutorial/libman.json

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
{
22
"version": "1.0",
33
"defaultProvider": "cdnjs",
4+
"defaultDestination": "wwwroot/lib/",
45
"libraries": [
56
{
6-
"library": "bootbox.js@4.4.0",
7-
"destination": "wwwroot/lib/bootbox.js/"
7+
"library": "vue@2.6.10",
8+
"destination": "wwwroot/lib/vuejs/"
9+
},
10+
{
11+
"library": "axios@0.19.0",
12+
"destination": "wwwroot/lib/axios/"
13+
},
14+
{
15+
"library": "lodash.js@4.17.15",
16+
"destination": "wwwroot/lib/lodash/"
17+
},
18+
{
19+
"library": "twitter-bootstrap@4.3.1",
20+
"destination": "wwwroot/lib/bootstrap/"
821
},
922
{
10-
"library": "bootstrap-datetimepicker@4.17.47",
11-
"destination": "wwwroot/lib/bootstrap-datetimepicker/"
23+
"library": "bootbox.js@4.4.0",
24+
"destination": "wwwroot/lib/bootbox.js/"
1225
},
1326
{
1427
"library": "iCheck@1.0.2",
@@ -29,6 +42,16 @@
2942
{
3043
"library": "noty@3.1.4",
3144
"destination": "wwwroot/lib/noty/"
45+
},
46+
{
47+
"provider": "jsdelivr",
48+
"library": "vuelidate@0.7.4",
49+
"destination": "wwwroot/lib/vuelidate/"
50+
},
51+
{
52+
"provider": "jsdelivr",
53+
"library": "vuelidate-error-extractor@2.4.0",
54+
"destination": "wwwroot/lib/vuelidate-error-extractor/"
3255
}
3356
]
3457
}

0 commit comments

Comments
 (0)