Skip to content

Commit

Permalink
Merge branch 'master' into 8035-myhealth-examinations-without-text-no…
Browse files Browse the repository at this point in the history
…t-lined-up
  • Loading branch information
dogi authored Jan 7, 2025
2 parents a101aff + b768259 commit b18d3aa
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 28 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"license": "AGPL-3.0",
"version": "0.16.40",
"myplanet": {
"latest": "v0.21.62",
"min": "v0.20.62"
"latest": "v0.21.74",
"min": "v0.20.74"
},
"scripts": {
"ng": "ng",
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/dialogs/dialogs-announcement.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { planetAndParentId } from '../../manager-dashboard/reports/reports.utils
export const includedCodes = [ 'guatemala', 'san.pablo', 'xela', 'okuro', 'uriur', 'mutugi', 'vi' ];
export const challengeCourseId = '4e6b78800b6ad18b4e8b0e1e38a98cac';
export const examId = '4e6b78800b6ad18b4e8b0e1e38b382ab';
export const challengePeriod = (new Date() > new Date(2024, 10, 31)) && (new Date() < new Date(2024, 12, 1));
export const challengePeriod = (new Date() > new Date(2024, 10, 31)) && (new Date() < new Date(2025, 0, 16));

@Component({
template: `
Expand Down
4 changes: 2 additions & 2 deletions src/app/teams/teams.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
<ng-container matColumnDef="doc.name">
<mat-header-cell *matHeaderCellDef mat-sort-header="doc.name" i18n>Name</mat-header-cell>
<mat-cell *matCellDef="let element">
<h3>
{{element.doc.name}}
<h3 class="team-name">
{{element.doc.name.length > 200 ? element.doc.name.slice(0, 200) + '...': element.doc.name }}
<mat-icon class="margin-lr-3" i18n-title title="{{ mode === 'enterprise' ? 'Joined Enterprise' : 'Joined Team' }}" [inline]="true" *ngIf="element.userStatus=='member'">check</mat-icon>
</h3>
</mat-cell>
Expand Down
5 changes: 5 additions & 0 deletions src/app/teams/teams.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
justify-content: center;
}

.team-name{
max-width: 95%;
overflow: hidden;
}

@media screen and (max-width: #{$screen-sm}) {
mat-cell button {
min-width: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<mat-toolbar>
<button mat-icon-button (click)="goBack()"><mat-icon>arrow_back</mat-icon></button>
<span i18n>Edit Achievements</span>
<span *ngIf="achievementNotFound" i18n>Add Achievements</span>
<span *ngIf="!achievementNotFound" i18n>Edit Achievements</span>
</mat-toolbar>

<div class="planet-users-achievements-update space-container">
Expand Down Expand Up @@ -91,7 +92,7 @@
</form>
</div>
<div class="achievement-button">
<button type="button" (click)="onSubmit()" mat-raised-button [planetSubmit]="editForm.valid && profileForm.valid" color="primary" i18n>Update</button>
<button type="button" (click)="onSubmit()" mat-raised-button [planetSubmit]="editForm.valid && profileForm.valid" color="primary" i18n>Submit</button>
<button type="button" mat-raised-button color="warn" (click)="goBack()" i18n>Cancel</button>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import { showFormErrors } from '../../shared/table-helpers';
encapsulation: ViewEncapsulation.None
})
export class UsersAchievementsUpdateComponent implements OnInit, OnDestroy {

user = this.userService.get();
configuration = this.stateService.configuration;
docInfo = { '_id': this.user._id + '@' + this.configuration.code, '_rev': undefined };
readonly dbName = 'achievements';
achievementNotFound = false;
editForm: FormGroup;
profileForm: FormGroup;
private onDestroy$ = new Subject<void>();
Expand Down Expand Up @@ -59,20 +59,25 @@ export class UsersAchievementsUpdateComponent implements OnInit, OnDestroy {
ngOnInit() {
this.profileForm.patchValue(this.user);
this.usersAchievementsService.getAchievements(this.docInfo._id)
.pipe(catchError(() => this.usersAchievementsService.getAchievements(this.user._id)))
.subscribe((achievements) => {
this.editForm.patchValue(achievements);
this.editForm.controls.achievements = this.fb.array(achievements.achievements || []);
this.editForm.controls.references = this.fb.array(achievements.references || []);
this.editForm.controls.links = this.fb.array(achievements.links || []);
// Keeping older otherInfo property so we don't lose this info on database
this.editForm.controls.otherInfo = this.fb.array(achievements.otherInfo || []);
if (this.docInfo._id === achievements._id) {
this.docInfo._rev = achievements._rev;
}
}, (error) => {
console.log(error);
});
.pipe(
catchError(() => this.usersAchievementsService.getAchievements(this.user._id))
)
.subscribe((achievements) => {
this.editForm.patchValue(achievements);
this.editForm.controls.achievements = this.fb.array(achievements.achievements || []);
this.editForm.controls.references = this.fb.array(achievements.references || []);
this.editForm.controls.links = this.fb.array(achievements.links || []);
// Keeping older otherInfo property so we don't lose this info on database
this.editForm.controls.otherInfo = this.fb.array(achievements.otherInfo || []);

if (this.docInfo._id === achievements._id) {
this.docInfo._rev = achievements._rev;
}
}, (error) => {
console.log(error);
this.achievementNotFound = true;
});

this.planetStepListService.stepMoveClick$.pipe(takeUntil(this.onDestroy$)).subscribe(
() => this.editForm.controls.dateSortOrder.setValue('none')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ <h2>{{user.firstName}} {{user.middleName}} {{user.lastName}}</h2>
<span *ngIf="user.birthplace" i18n>Birthplace: {{' ' + user.birthplace}} </span>
</div>
</div>
<mat-divider></mat-divider>
<div *ngIf="achievements.purpose">
<mat-divider></mat-divider>
<h3 i18n>My Purpose</h3>
<td-markdown [content]="achievements.purpose"></td-markdown>
</div>
<mat-divider></mat-divider>
<div *ngIf="achievements.goals">
<mat-divider></mat-divider>
<h3 i18n>My Goals</h3>
<td-markdown [content]="achievements.goals"></td-markdown>
</div>
<mat-divider></mat-divider>
<ng-container *planetBeta>
<div *ngIf="certifications.length > 0">
<mat-divider></mat-divider>
<h3 i18n>My Certifications</h3>
<mat-list class="certs-list">
<mat-list-item *ngFor="let certification of certifications">
Expand All @@ -52,8 +52,8 @@ <h3 i18n>My Certifications</h3>
</mat-list>
</div>
</ng-container>
<mat-divider></mat-divider>
<div *ngIf="achievements?.links?.length > 0">
<mat-divider></mat-divider>
<h3 i18n>My Links</h3>
<mat-list>
<mat-list-item class="mat-list-item-word-wrap" *ngFor="let link of achievements.links">
Expand All @@ -62,8 +62,8 @@ <h4 class="link-title" mat-line>{{link.title}}:</h4>
</mat-list-item>
</mat-list>
</div>
<mat-divider></mat-divider>
<div *ngIf="achievements.achievementsHeader || achievements.achievements.length > 0">
<mat-divider></mat-divider>
<h3 i18n>My Achievements</h3>
<td-markdown [content]="achievements.achievementsHeader"></td-markdown>
<mat-list>
Expand All @@ -85,8 +85,8 @@ <h3 i18n>My Achievements</h3>
</mat-list-item>
</mat-list>
</div>
<mat-divider></mat-divider>
<div *ngIf="achievements.references.length > 0">
<mat-divider></mat-divider>
<h3 i18n>My References</h3>
<mat-list class="references-list">
<mat-list-item class="mat-list-item-word-wrap" *ngFor="let reference of achievements.references">
Expand Down

0 comments on commit b18d3aa

Please sign in to comment.