Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Keneweab committed Oct 25, 2023
1 parent 75a99f4 commit f2d1de8
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 16 deletions.
40 changes: 24 additions & 16 deletions liquid-prep-app/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { CropStaticInfoResolver } from './resolve/CropStaticInfoResolver';
import { HomeComponent } from './components/dashboard/home/home.component';
import { FieldsComponent } from './components/dashboard/fields/fields.component';
import { SensorsComponent } from './components/dashboard/sensors/sensors.component';

import { WateringInsigtsComponent } from './components/watering-insigts/watering-insigts.component';

const routes: Routes = [
{ path: '', component: WelcomeComponent },
Expand All @@ -24,52 +24,60 @@ const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
{ path: 'sensors', component: SensorsComponent },
{ path: 'fields', component: FieldsComponent }
]
{ path: 'fields', component: FieldsComponent },
],
},
{ path: 'select-crop', loadChildren: () => import('./components/select-crop/select-crop.module')
.then(m => m.SelectCropModule)
{
path: 'select-crop',
loadChildren: () =>
import('./components/select-crop/select-crop.module').then(
(m) => m.SelectCropModule
),
},
{
path: 'my-crops',
component: MyCropsComponent
component: MyCropsComponent,
},
{
path: 'insights',
component: WateringInsigtsComponent,
},
{
path: 'measure-soil/:id',
component: MeasureSoilComponent
component: MeasureSoilComponent,
},
{
path: 'seed-date/:id',
component: SeedDateComponent
component: SeedDateComponent,
},
{
path: 'settings',
component: SettingsComponent
component: SettingsComponent,
},
{
path: 'advice/:id',
component: AdviceComponent,
resolve: {
cropStaticInfo: CropStaticInfoResolver
}
cropStaticInfo: CropStaticInfoResolver,
},
},
{
path: 'test-sensor',
component: TestSensorComponent
component: TestSensorComponent,
},
{
path: 'past-readings',
component: PastReadingsComponent
component: PastReadingsComponent,
},
{
path: 'sensors',
component: SensorsComponent
component: SensorsComponent,
},
];

@NgModule({
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })],
providers: [CropStaticInfoResolver],
exports: [RouterModule]
exports: [RouterModule],
})
export class AppRoutingModule { }
export class AppRoutingModule {}
2 changes: 2 additions & 0 deletions liquid-prep-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { HomeComponent } from './components/dashboard/home/home.component';
import { FieldsComponent } from './components/dashboard/fields/fields.component';
import { SensorsComponent } from './components/dashboard/sensors/sensors.component';
import { SortModalComponent } from './components/sort-modal/sort-modal.component';
import { WateringInsigtsComponent } from './components/watering-insigts/watering-insigts.component';

const DEFAULT_SWIPER_CONFIG: SwiperConfigInterface = {
observer: true,
Expand Down Expand Up @@ -84,6 +85,7 @@ const DEFAULT_SWIPER_CONFIG: SwiperConfigInterface = {
FieldsComponent,
SensorsComponent,
SortModalComponent,
WateringInsigtsComponent,
],
imports: [
BrowserModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<app-header-title fxFlexFill> </app-header-title>
<div>
<div class="header-container">
<div class="header-title">
<h2>Southwest Field 1</h2>
<span class="crop-name">Rice</span>
</div>
<div class="header-details">
<div>
<span>Planted</span>
<p>June 15, 2023</p>
</div>
<div>
<span>Harvest in</span>
<p>46 Days</p>
</div>
<div>
<span>Growth Stage</span>
<p>3</p>
</div>
</div>
</div>
<div class="card-container">
<mat-card style="background-color: #edf5ff">
<mat-card-content>
<div class="card-advice">
<div>
<span class="card-title">WATERING ADVICE</span>
<h2>Water Today</h2>
<h3>15 GPM/acre</h3>
<button mat-raised-button class="mark-button">
MARK AS WATERED
</button>
</div>
<div>
<img
src="./../../../assets/moisture-water/littlewater_mediummoisture.png"
class="water-image"
/>
</div>
</div>
</mat-card-content>
</mat-card>
<mat-card>
<mat-card-content>
<div class="soil-moisture-container">
<span class="card-title">CURRENT SOIL MOISTURE</span>
<div>Mesurement</div>
<div>
<p>Last Measured: Sept 14, 2023, 8:00am CDT</p>
<button mat-button class="view-logs">VIEW HISTORY</button>
</div>
</div>
</mat-card-content>
</mat-card>
<mat-card>
<mat-card-content>
<div class="history-container">
<div>
<span class="card-title">LAST WATERED</span>
<h2>Sept 10, 2023</h2>
</div>
<button mat-button class="view-history">VIEW HISTORY</button>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
.header-container {
display: flex;
flex-wrap: wrap;
color: white;
width: auto;
height: 140px;
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
url("../../../assets/crops-images/cotton-harvest-rect.png");
background-repeat: no-repeat;
background-size: cover;

.header-title {
margin-top: 10px;
margin-left: 15px;
width: 100%;

h2 {
padding: 0px;
margin: 0px;
font-size: medium;
font-weight: 500;
letter-spacing: 1px;
}

.crop-name {
font-size: 20px;
font-weight: 550;
}
}

.header-details {
opacity: 0.8;
display: grid;
margin-left: 15px;
grid-template-columns: 130px 100px 100px;
}
}

.card-container {
margin: 15px;

.card-title {
letter-spacing: 1px;
color: gray;
font-size: 10px;
}

.card-advice {
display: grid;
grid-template-columns: 180px 120px;

.mark-button {
color: white;
letter-spacing: 2px;
font-size: smaller;
background-color: #2f4ff3;
}

h2 {
padding: 0px;
margin: 0px;
font-size: 23px;
font-weight: bold;
}
}

.soil-moisture-container {
.view-logs {
font-weight: bold;
letter-spacing: 1px;
color: #2f4ff3;
}
}

.history-container {
display: grid;
grid-template-columns: 150px 150px;

.view-history {
font-weight: bold;
letter-spacing: 1px;
color: #2f4ff3;
}
}

.water-image {
width: 120px;
height: 100px;
margin-top: 10px;
}

mat-card {
margin-bottom: 15px;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { WateringInsigtsComponent } from './watering-insigts.component';

describe('WateringInsigtsComponent', () => {
let component: WateringInsigtsComponent;
let fixture: ComponentFixture<WateringInsigtsComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ WateringInsigtsComponent ]
})
.compileComponents();
});

beforeEach(() => {
fixture = TestBed.createComponent(WateringInsigtsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Component, OnInit } from '@angular/core';
import { HeaderService } from 'src/app/service/header.service';
import { HeaderConfig } from 'src/app/models/HeaderConfig.interface';
import { Router } from '@angular/router';

@Component({
selector: 'app-watering-insigts',
templateUrl: './watering-insigts.component.html',
styleUrls: ['./watering-insigts.component.scss'],
})
export class WateringInsigtsComponent implements OnInit {
headerConfig: HeaderConfig = {
headerTitle: 'Watering Insights',
leftIconName: 'arrow_back',
rightIconName: 'cached',
leftBtnClick: null,
rightBtnClick: null,
};

constructor(private headerService: HeaderService, private router: Router) {}

ngOnInit(): void {
this.headerService.updateHeader(this.headerConfig);
}
}

0 comments on commit f2d1de8

Please sign in to comment.