Compare commits
No commits in common. "7808101c58066438b7af4e263152acbe6d19ed2c" and "84ab4410f509c02f6f85292d7a7354da05f7fdd9" have entirely different histories.
7808101c58
...
84ab4410f5
|
@ -29,9 +29,6 @@ const AwardingSchema = new Schema({
|
||||||
max: 2,
|
max: 2,
|
||||||
default: 0
|
default: 0
|
||||||
},
|
},
|
||||||
rejectReason: {
|
|
||||||
type: String
|
|
||||||
},
|
|
||||||
date: {
|
date: {
|
||||||
type: Date,
|
type: Date,
|
||||||
default: Date.now()
|
default: Date.now()
|
||||||
|
|
|
@ -114,6 +114,7 @@ awarding.route('/:id')
|
||||||
return; // prevent node to process this function further after next() has finished.
|
return; // prevent node to process this function further after next() has finished.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// optional task 3: increment version manually as we do not use .save(.)
|
||||||
req.body.updatedAt = new Date();
|
req.body.updatedAt = new Date();
|
||||||
req.body.$inc = {__v: 1};
|
req.body.$inc = {__v: 1};
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,6 @@ export interface Award {
|
||||||
proposer?: AppUser;
|
proposer?: AppUser;
|
||||||
date?: number; // since Date.now() returns a number
|
date?: number; // since Date.now() returns a number
|
||||||
confirmed?: number;
|
confirmed?: number;
|
||||||
rejectReason?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Promotion {
|
export interface Promotion {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
.table-container {
|
.table-container {
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
width: 90%;
|
width: 75%;
|
||||||
min-width: 800px;
|
min-width: 800px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,6 @@
|
||||||
<th class="col-sm-1 ">Antragsteller</th>
|
<th class="col-sm-1 ">Antragsteller</th>
|
||||||
<th class="col-sm-1 text-right">Datum</th>
|
<th class="col-sm-1 text-right">Datum</th>
|
||||||
<th class="col-sm-1 text-center">Status</th>
|
<th class="col-sm-1 text-center">Status</th>
|
||||||
<th class="col-sm-2 text-right">Grund für Ablehnung</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody *ngFor="let award of awards">
|
<tbody *ngFor="let award of awards">
|
||||||
|
@ -103,9 +102,6 @@
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{{award.confirmed === 0? 'In Bearbeitung' : (award.confirmed === 1? 'Genehmigt' : 'Abgelehnt')}}
|
{{award.confirmed === 0? 'In Bearbeitung' : (award.confirmed === 1? 'Genehmigt' : 'Abgelehnt')}}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right">
|
|
||||||
{{award.rejectReason ? award.rejectReason : ''}}
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<th class="col-sm-2">Begründung</th>
|
<th class="col-sm-2">Begründung</th>
|
||||||
<th class="col-sm-1 ">Antragsteller</th>
|
<th class="col-sm-1 ">Antragsteller</th>
|
||||||
<th class="col-sm-1 text-right">Datum</th>
|
<th class="col-sm-1 text-right">Datum</th>
|
||||||
<th class="col-sm-2 text-right">Aktion</th>
|
<th class="col-sm-1 text-right">Aktion</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody *ngFor="let award of awards">
|
<tbody *ngFor="let award of awards">
|
||||||
|
@ -34,10 +34,7 @@
|
||||||
{{award.decorationId.name}}
|
{{award.decorationId.name}}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<textarea style="width:100%;"
|
{{award.reason}}
|
||||||
rows="7"
|
|
||||||
title="reason"
|
|
||||||
#reason>{{award.reason}}</textarea>
|
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{award.proposer?.username}}
|
{{award.proposer?.username}}
|
||||||
|
@ -46,15 +43,8 @@
|
||||||
{{award.date | date: 'dd.MM.yyyy'}}
|
{{award.date | date: 'dd.MM.yyyy'}}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
<a class="action" (click)="confirm(award, true, reason.value)">Bestätigen</a><br>
|
<a class="action" (click)="confirm(award, true)">Bestätigen</a><br>
|
||||||
<a class="action" (click)="confirm(award, false, reason.value, rejectReason.value)">Ablehnen</a>
|
<a class="action" (click)="confirm(award, false)">Ablehnen</a>
|
||||||
<div>
|
|
||||||
<textarea cols="20"
|
|
||||||
rows="5"
|
|
||||||
title="rejectReason"
|
|
||||||
placeholder="Begründung für Ablehnung (optional)"
|
|
||||||
#rejectReason></textarea>
|
|
||||||
</div>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -25,20 +25,12 @@ export class ConfirmAwardComponent implements OnInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
confirm(award: Award, decision: boolean, reason: string, rejectReason: string) {
|
confirm(award: Award, decision: boolean) {
|
||||||
const updateObject = {
|
const updateObject = {
|
||||||
_id: award._id,
|
_id: award._id,
|
||||||
confirmed: decision ? 1 : 2
|
confirmed: decision ? 1 : 2
|
||||||
};
|
};
|
||||||
|
|
||||||
if (rejectReason) {
|
|
||||||
updateObject['rejectReason'] = rejectReason;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reason && reason !== award.reason) {
|
|
||||||
updateObject['reason'] = reason;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.awardingService.updateAward(updateObject).subscribe(res => {
|
this.awardingService.updateAward(updateObject).subscribe(res => {
|
||||||
const currentUser = this.loginService.getCurrentUser();
|
const currentUser = this.loginService.getCurrentUser();
|
||||||
this.awardingService.getUnconfirmedAwards(currentUser.squad.fraction).subscribe(awards => {
|
this.awardingService.getUnconfirmedAwards(currentUser.squad.fraction).subscribe(awards => {
|
||||||
|
|
Loading…
Reference in New Issue