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

feat/CSTM-CPC-973-Display-All-Pet-Types #528

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions api-gateway/src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@

<script src="scripts/inventory-list/inventory-service.js"></script>


<script src="scripts/pet-type-list/pet-type-list.js"></script>
<script src="scripts/pet-type-list/pet-type-list.controller.js"></script>
<script src="scripts/pet-type-list/pet-type-list.component.js"></script>


</head>

<body id="bg">
Expand Down
2 changes: 1 addition & 1 deletion api-gateway/src/main/resources/static/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const petClinicApp = angular.module('petClinicApp', [
'ui.router', 'layoutNav', 'layoutFooter', 'layoutWelcome', 'ownerList', 'ownerDetails', 'ownerForm', 'ownerRegister', 'petForm'
, 'visits', 'vetList','vetForm','vetDetails', 'visitList', 'billForm', 'billUpdateForm', 'loginForm', 'rolesDetails', 'signupForm',
'billDetails', 'billsByOwnerId', 'billHistory','billsByVetId','inventoryList', 'inventoryForm', 'productForm','inventoryProductList', 'inventoryUpdateForm', 'productUpdateForm'
, 'verification' , 'adminPanel','resetPwdForm','forgotPwdForm']);
, 'verification' , 'adminPanel','resetPwdForm','forgotPwdForm','petTypeList']);



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="nav-link" ui-sref="owners">Owners</a>
<a class="nav-link" ui-sref="ownerDetails({ ownerId: UUID })">Edit Account</a>
<a class="nav-link" ui-sref="petTypes">Pet Types</a>
</div>
</li>
<li class="nav-item">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

angular.module('petTypeList')
.component('petTypeList', {
templateUrl: 'scripts/pet-type-list/pet-type-list.template.html',
controller: 'PetTypeListController'
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

angular.module('petTypeList')
.controller('PetTypeListController', ['$http', '$stateParams', '$scope', '$state', function ($http, $stateParams, $scope, $state) {
var self = this;
self.petTypes = {};
// Initialize as an empty array

$http.get('api/gateway/owners/petTypes').then(function (resp) {
self.petTypes = resp.data;
console.log(self.petTypes);

});
}]);


Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

angular.module('petTypeList', ['ui.router'])
.config(['$stateProvider', function ($stateProvider) {

$stateProvider
.state('petTypes', {
parent: 'app',
url: '/petTypes',
template: '<pet-type-list></pet-type-list>',
controller: 'PetTypeListController',
controllerAs: 'vm'
})
}]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

<style>
h3.titleOwner {
color: #2f2b2b;
text-align: left;
padding-bottom: 20px;
padding-top: 20px;
}

.CurrentOwnersContainer {
margin: 20px;
}

.FilterOwnersLabel {
color: rgba(0, 0, 0, 0.5);
}

@media (max-width: 576px) {
/* Define styles for small screens */
.responsive-text {
font-size: 13px;
}
}

@media (min-width: 577px) and (max-width: 992px) {
/* Define styles for medium screens */
.responsive-text {
font-size: 15px;
}
}

@media (min-width: 993px) {
/* Define styles for large screens and above */
.responsive-text {
font-size: 17px;
}
}

.ownerTable thead tr th {
font-weight: 400;
color: gray;
}

input[type="Text"] {
font-size: 15px;
}
</style>

<div class="CurrentOwnersContainer" ng-app="petTypeList" ng-controller="PetTypeListController">
<h3 class="titleOwner">Current Pet Types</h3>
<table id="owner" class="table table-striped table-responsive ownerTable pb-3">
<thead class="bg-white">
<tr>
<th class="bg-white border">Pet Type ID</th>
<th class="bg-white border">Pet Type Name</th>
<th class="bg-white d-none d-sm-table-cell d-md-table-cell border">Description</th>
</tr>
</thead>
<tbody class="border">
<tr ng-repeat="petType in $ctrl.petTypes">
<td>{{petType.petTypeId }}</td>
<td class="responsive-text">{{ petType.name }}</td>
<td class="d-none d-sm-table-cell d-md-table-cell responsive-text">{{ petType.petTypeDescription }}</td>
</tr>
</tbody>
</table>
</div>
Loading