Skip to content

Commit

Permalink
Settings page fixes: release dates, save new functions (#835)
Browse files Browse the repository at this point in the history
  • Loading branch information
llorentelemmc authored Jan 29, 2025
1 parent 7e4ebf6 commit d23918e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions AMW_angular/io/src/app/core/amw-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export const ENVIRONMENT = {
// used for date-fns
export const DATE_TIME_FORMAT = 'dd.MM.yyyy HH:mm';
export const DATE_FORMAT = 'dd.MM.yyyy';
export const ISO_FORMAT = 'yyyy-MM-dd';
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ReleaseEditComponent implements OnInit {

ngOnInit(): void {
if (this.release) {
this.installationDate = DateModel.fromEpoch(this.release.installationInProductionAt);
this.installationDate = DateModel.fromLocalString(this.release.installationInProductionAt);
}
}

Expand All @@ -45,14 +45,14 @@ export class ReleaseEditComponent implements OnInit {

save() {
if (this.hasInvalidDate()) {
return
return;
}
if (this.installationDate.toEpoch() != null) {
const release: Release = {
name: this.release.name,
mainRelease: this.release.mainRelease,
description: this.release.description,
installationInProductionAt: this.installationDate.toEpoch(),
installationInProductionAt: this.installationDate.toISOFormat(),
id: this.release.id ? this.release.id : null,
default: false,
v: this.release.v ? this.release.v : null,
Expand Down
2 changes: 1 addition & 1 deletion AMW_angular/io/src/app/settings/releases/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export interface Release {
name: string;
mainRelease: boolean;
description: string;
installationInProductionAt: number;
installationInProductionAt: string;
id: number;
v: number;
default: boolean;
Expand Down
6 changes: 5 additions & 1 deletion AMW_angular/io/src/app/shared/date-picker/date.model.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NgbTimeStruct, NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
import * as datefns from 'date-fns';
import { DATE_FORMAT } from 'src/app/core/amw-constants';
import { DATE_FORMAT, ISO_FORMAT } from 'src/app/core/amw-constants';

export interface NgbDateTimeStruct extends NgbDateStruct, NgbTimeStruct {}

Expand Down Expand Up @@ -71,4 +71,8 @@ export class DateModel implements NgbDateStruct {
public toJSON(): string {
return this.toString();
}

public toISOFormat(): string {
return datefns.format(this.thisToDate(), ISO_FORMAT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Component, input, output } from '@angular/core';
template: `<div class="modal-header">
<h5 class="modal-title">{{ title() }}</h5>
<button type="button" class="btn btn-light close" aria-label="Close" (click)="onCancel()">
<span aria-hidden="true">&times;</span>
<span>&times;</span>
</button>
</div> `,
})
Expand Down
2 changes: 1 addition & 1 deletion AMW_docker/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Liima Docker image

This image is meant to run liima code quickly on widlfly server provided on docker.
This image is meant to run liima code quickly on wildfly server provided on docker.
Data is stored in the embedded h2 database in the container and it will be lost if the container is removed.

To run latest code on docker, build the latest ear package:
Expand Down

0 comments on commit d23918e

Please sign in to comment.