Skip to content

Commit

Permalink
Merge branch 'master' into 8071-achievements-link-being-required-is-a…
Browse files Browse the repository at this point in the history
…mbiguous
  • Loading branch information
dogi authored Jan 15, 2025
2 parents b950622 + 2162bf2 commit f051eba
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 39 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.62",
"myplanet": {
"latest": "v0.21.99",
"min": "v0.20.99"
"latest": "v0.22.7",
"min": "v0.21.7"
},
"scripts": {
"ng": "ng",
Expand Down
21 changes: 0 additions & 21 deletions src/app/community/community.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,6 @@ planet-calendar {
overflow-y: auto;
}

.calendar-legend {
padding-top: 10px;
text-align: right;
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: 10px;
}

.calendar-legend .legend-item {
display: inline-flex;
align-items: center;
}

.calendar-legend .legend-color {
width: 20px;
height: 20px;
margin-right: 10px;
border-radius: 4px;
}

.card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
Expand Down
20 changes: 20 additions & 0 deletions src/app/shared/calendar.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.calendar-legend {
padding-top: 10px;
text-align: right;
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: 10px;
}

.calendar-legend .legend-item {
display: inline-flex;
align-items: center;
}

.calendar-legend .legend-color {
width: 20px;
height: 20px;
margin-right: 10px;
border-radius: 4px;
}
1 change: 1 addition & 0 deletions src/app/shared/calendar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { addDateAndTime, styleVariables } from './utils';

@Component({
selector: 'planet-calendar',
styleUrls: [ './calendar.component.scss' ],
template: `
<full-calendar #calendar [options]="calendarOptions"></full-calendar>
<div class="calendar-legend" *ngIf="showLegend">
Expand Down
12 changes: 11 additions & 1 deletion src/app/teams/teams-reports.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { tap } from 'rxjs/operators';
import { convertUtcDate } from './teams.utils';
import { CsvService } from '../shared/csv.service';
import { StateService } from '../shared/state.service';
import { PlanetMessageService } from '../shared/planet-message.service';

@Component({
selector: 'planet-teams-reports',
Expand All @@ -38,6 +39,7 @@ export class TeamsReportsComponent implements DoCheck {
private csvService: CsvService,
private elementRef: ElementRef,
private stateService: StateService,
private planetMessageService: PlanetMessageService,
) {}

ngDoCheck() {
Expand Down Expand Up @@ -76,6 +78,8 @@ export class TeamsReportsComponent implements DoCheck {
disableIfInvalid: true,
onSubmit: (newReport) => this.updateReport(oldReport, newReport).subscribe(() => {
this.dialogsFormService.closeDialogsForm();
const action = isEdit ? 'edited' : 'added';
this.planetMessageService.showMessage(`Report ${action}`);
})
}
);
Expand All @@ -87,11 +91,17 @@ export class TeamsReportsComponent implements DoCheck {
data: {
changeType: 'delete',
type: 'report',
displayDates: report,
displayName: `${$localize`Report from`} ${new Date(report.startDate).toLocaleDateString('en-US', { timeZone: 'UTC' })} ${$localize`to`} ${new Date(report.endDate).toLocaleDateString('en-US', { timeZone: 'UTC' })}`,
okClick: {
request: this.updateReport(report),
onNext: () => {
this.planetMessageService.showMessage('Report deleted');
this.dialogsLoadingService.stop();
deleteDialog.close();
},
onError: () => {
this.planetMessageService.showAlert('There was a problem deleting the report.');
this.dialogsLoadingService.stop();
}
},
isDateUtc: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<mat-toolbar>
<mat-toolbar *ngIf="!publicView">
<button mat-icon-button (click)="goBack()"><mat-icon>arrow_back</mat-icon></button>
<span i18n>Achievements</span>
<span class="toolbar-fill"></span>
Expand All @@ -19,14 +19,17 @@
<span *ngIf="achievementNotFound" i18n>Add Achievements</span>
<span *ngIf="!achievementNotFound" i18n>Edit Achievements</span>
</a>
<button mat-icon-button matTooltip="Copy Achievements Link" i18n-matTooltip (click)="copyLink()">
<mat-icon>link</mat-icon>
</button>
</div>
</mat-toolbar>
<div class="view-container">
<div *ngIf="achievements !== undefined" class="achievements-container">
<div class="user-info">
<img class="profile-image" [src]="profileImg">
<h2>{{user.firstName}} {{user.middleName}} {{user.lastName}}</h2>
<div class="birth-info">
<div class="birth-info" *ngIf="!publicView">
<ng-container *ngIf="user.birthDate"><span i18n>Birthdate: {{' ' + (user.birthDate | date: medium) + ' '}}</span></ng-container><br/><br/>
<span *ngIf="user.birthplace" i18n>Birthplace: {{' ' + user.birthplace}} </span>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { format } from 'date-fns';
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { Router, ActivatedRoute, ParamMap } from '@angular/router';
import { Clipboard } from '@angular/cdk/clipboard';
import { CouchService } from '../../shared/couchdb.service';
import { UserService } from '../../shared/user.service';
import { PlanetMessageService } from '../../shared/planet-message.service';
Expand Down Expand Up @@ -29,6 +30,7 @@ export class UsersAchievementsComponent implements OnInit {
urlPrefix = environment.couchAddress + '/_users/org.couchdb.user:' + this.userService.get().name + '/';
openAchievementIndex = -1;
certifications: any[] = [];
publicView = this.route.snapshot.data.requiresAuth === false;

constructor(
private couchService: CouchService,
Expand All @@ -39,7 +41,8 @@ export class UsersAchievementsComponent implements OnInit {
private usersAchievementsService: UsersAchievementsService,
private stateService: StateService,
private coursesService: CoursesService,
private certificationsService: CertificationsService
private certificationsService: CertificationsService,
private clipboard: Clipboard
) { }

ngOnInit() {
Expand Down Expand Up @@ -122,6 +125,11 @@ export class UsersAchievementsComponent implements OnInit {
});
}

copyLink() {
const link = `${window.location.origin}/profile/${this.user.name}/achievements;planet=${this.stateService.configuration.code}`;
this.clipboard.copy(link);
}

generatePDF() {
const formattedBirthDate = format(new Date(this.user.birthDate), 'MMM d, y');
let contentArray = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { ClipboardModule } from '@angular/cdk/clipboard';
import { MaterialModule } from '../../shared/material.module';
import { PlanetFormsModule } from '../../shared/forms/planet-forms.module';
import { SharedComponentsModule } from '../../shared/shared-components.module';
Expand All @@ -10,7 +11,7 @@ import { UsersAchievementsUpdateComponent } from './users-achievements-update.co

@NgModule({
imports: [
CommonModule, FormsModule, ReactiveFormsModule, RouterModule, MaterialModule, PlanetFormsModule, SharedComponentsModule
CommonModule, FormsModule, ReactiveFormsModule, RouterModule, MaterialModule, PlanetFormsModule, SharedComponentsModule, ClipboardModule
],
exports: [
UsersAchievementsUpdateComponent,
Expand Down
10 changes: 0 additions & 10 deletions src/app/users/users-profile/users-profile.component.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
<mat-toolbar *ngIf="!isDialog">
<mat-toolbar-row>
<button mat-icon-button (click)="goBack()">
<mat-icon>arrow_back</mat-icon>
</button>
<span i18n>Member Profile</span>
<span class="toolbar-fill"></span>
</mat-toolbar-row>
</mat-toolbar>

<div class="space-container">
<mat-toolbar class="primary-color font-size-1">
<span>{{userDetail.name}}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/app/users/users-router.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const routes: Routes = [
{ path: 'delete/request', component: UsersArchiveComponent },
{ path: 'profile/:name', component: UsersProfileComponent },
{ path: 'update/:name', component: UsersUpdateComponent },
{ path: 'profile/:name/achievements', component: UsersAchievementsComponent },
{ path: 'profile/:name/achievements', component: UsersAchievementsComponent, data: { requiresAuth: false } },
{ path: 'profile/:name/achievements/update', component: UsersAchievementsUpdateComponent },
{ path: 'submission', component: UsersUpdateComponent, data: { submission: true } }
];
Expand Down

0 comments on commit f051eba

Please sign in to comment.