Skip to content

Commit

Permalink
Merge branch 'master' into 7980-nav-bar-more-distinctive-chat-icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Mutugiii committed Jan 10, 2025
2 parents 2ff29b9 + 1c0f87c commit aac9ddb
Show file tree
Hide file tree
Showing 50 changed files with 287 additions and 95 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "planet",
"license": "AGPL-3.0",
"version": "0.16.17",
"version": "0.16.49",
"myplanet": {
"latest": "v0.21.45",
"min": "v0.20.45"
"latest": "v0.21.81",
"min": "v0.20.81"
},
"scripts": {
"ng": "ng",
Expand Down
4 changes: 2 additions & 2 deletions src/app/chat/chat-sidebar/chat-sidebar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<button mat-icon-button color="primary" (click)="resetFilter()" [disabled]="!titleSearch && !searchType" matTooltip="Clear search" i18n-matTooltip [matTooltipDisabled]="!titleSearch && !searchType">
<mat-icon>delete</mat-icon>
</button><br>
<span style="font-size: small; font-style: italic;" i18n>Full Conversation Search </span>
<mat-checkbox [checked]="fullTextSearch" (change)="toggleSearchType()"></mat-checkbox>
<span style="font-size: small; font-style: italic;" i18n>Full Conversation Search </span>
<button style="text-align: end;" mat-icon-button (mouseenter)="toggleOverlay()" (mouseleave)="toggleOverlay()" cdkOverlayOrigin #trigger="cdkOverlayOrigin">
<mat-icon>help_outline</mat-icon>
</button>
Expand Down Expand Up @@ -69,7 +69,7 @@
</ul>
</ng-container>
<ng-template #noChats>
<div i18n>No previous conversations.</div>
<div class="no-chats-message" i18n>No previous conversations.</div>
</ng-template>
</mat-drawer>

Expand Down
8 changes: 8 additions & 0 deletions src/app/chat/chat-sidebar/chat-sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ li:hover {
margin: 0;
}

.no-chats-message {
margin-left: 4px;
}

.mat-checkbox {
margin-right: 4px;
}

@media only screen and (max-width: $screen-md) {
.expand-button {
top: 10px;
Expand Down
1 change: 1 addition & 0 deletions src/app/community/community.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ planet-calendar {
top: -0.25rem;
right: -0.25rem;
}
word-break: break-word;
}

mat-tab-group, mat-tab {
Expand Down
8 changes: 8 additions & 0 deletions src/app/courses/courses.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ $label-height: 1rem;
word-break: break-word;
}

.tags-list mat-chip {
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
}

@media(max-width: $screen-md) {
.mat-column-info {
max-width: 120px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h3 class="margin-lr-3 ellipsis-title"><ng-container i18n>Step</ng-container> {{
<span>{{stepNum}}/{{maxStep}}</span>
<button mat-icon-button *ngIf="maxStep !== 1" [disabled]="stepNum === 1" (click)="changeStep(-1)"><mat-icon>navigate_before</mat-icon></button>
<button mat-icon-button *ngIf="stepNum !== maxStep" [disabled]="stepNum === maxStep || (!parent && stepDetail?.exam?.questions.length > 0 && !attempts)" (click)="changeStep(1)"><mat-icon>navigate_next</mat-icon></button>
<button mat-raised-button *ngIf="stepNum === maxStep && maxStep !== 1" [disabled]="!parent && stepDetail?.exam?.questions.length > 0 && !attempts" (click)="backToCourseDetail()" i18n>Finish</button>
<button mat-raised-button class="finish-button" *ngIf="stepNum === maxStep" [disabled]="!parent && stepDetail?.exam?.questions.length > 0 && !attempts" (click)="backToCourseDetail()" i18n>Finish</button>
</div>
</mat-toolbar>
<div class="view-container view-full-height" [ngClass]="{'grid-view': showChat, 'flex-view': !isGridView && !showChat}" *ngIf="stepDetail?.description || resource?._attachments; else emptyRecord">
Expand Down
4 changes: 4 additions & 0 deletions src/app/courses/step-view-courses/courses-step-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,8 @@
text-overflow: ellipsis;
}

.finish-button {
margin-left: 10px;
}

}
2 changes: 1 addition & 1 deletion src/app/dashboard/dashboard-tile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
flex-wrap: wrap;
font-size: 1.25rem;
}

color: #fff;
}

.right-tile {
Expand Down
4 changes: 4 additions & 0 deletions src/app/exams/exams-add.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class ExamsAddComponent implements OnInit {
pageType: 'Add' | 'Update' | 'Copy' = 'Add';
courseName = '';
examType: 'exam' | 'survey' = <'exam' | 'survey'>this.route.snapshot.paramMap.get('type') || 'exam';
teamId = this.route.parent?.snapshot.paramMap.get('teamId') || null;
successMessage = this.examType === 'survey' ? $localize`New survey added` : $localize`New test added`;
steps = [];
showFormError = false;
Expand Down Expand Up @@ -120,6 +121,9 @@ export class ExamsAddComponent implements OnInit {

onSubmit(reRoute = false) {
if (this.examForm.valid) {
if (this.teamId) {
this.examForm.value.teamId = this.teamId;
}
this.showFormError = false;
this.addExam(Object.assign({}, this.examForm.value, this.documentInfo), reRoute);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/app/health/health-event-dialog.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ <h4 class="primary-text-color" *ngIf="hasConditionAndTreatment" i18n>Other Notes
<mat-dialog-actions>
<button type="button" mat-raised-button mat-dialog-close i18n>Close</button>
<button type="button" color="primary" mat-dialog-close (click)="editExam(event)" *ngIf="canUpdate" mat-raised-button>
<span i18n>Edit</span> <ng-container *ngIf="minutes">({{ minutes }}:{{ seconds }})</ng-container>
<span i18n>Edit <ng-container *ngIf="minutes">({{ minutes }}:{{ seconds }})</ng-container></span>
</button>
</mat-dialog-actions>
1 change: 1 addition & 0 deletions src/app/health/health-event.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export class HealthEventComponent implements OnInit {
this.goBack();
}
},
displayName: '',
showMainParagraph: false,
extraMessage: $localize`The value(s) of the following are not in the normal range. Click <b>Cancel</b> to fix or click <b>OK</b> to submit.`,
showLabels: invalidFields
Expand Down
5 changes: 3 additions & 2 deletions src/app/health/health.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<div class="space-container">
<mat-toolbar class="primary-color font-size-1 action-buttons">
<span class="toolbar-fill"></span>
<a mat-raised-button color="accent" i18n [routerLink]="['update']" *ngIf="isOwnUser">Update Details</a>
<a mat-raised-button color="accent" i18n [routerLink]="['event', { id: userDetail._id }]">Add Examination</a>
<span *ngIf="userDetail.firstName === undefined"><ng-container i18n>Member login:</ng-container> {{userDetail.name}}</span>
Expand Down Expand Up @@ -56,7 +57,7 @@ <h4 class="primary-text-color" i18n>Birthplace</h4>
</div>
<mat-divider></mat-divider>
</div>
<div>
<div class="full-width">
<div>
<h4 class="primary-text-color" i18n>Emergency Contact</h4>
<p><b i18n>Name: </b>{{healthDetail?.emergencyContactName || 'N/A'}}</p>
Expand All @@ -81,7 +82,7 @@ <h4 class="primary-text-color" i18n>Notes</h4>
</div>
</div>
<ng-container *ngIf="events.length > 0">
<h4 class="full-width" i18n>Examinations</h4>
<h3 class="full-width examinations-header" i18n>Examinations</h3>
<div class="full-width table-container" #examsTable>
<mat-table [dataSource]="eventTable" *ngIf="events.length > 0">
<ng-container *ngFor="let column of displayedColumns" [matColumnDef]="column" [sticky]="column === 'label'">
Expand Down
8 changes: 8 additions & 0 deletions src/app/health/health.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,11 @@ mat-table {
min-width: 110px;
}
}

.examinations-header {
text-align: center;
}

mat-header-cell div .header-date {
min-height: 1.7rem;
}
4 changes: 2 additions & 2 deletions src/app/home/home-router.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ const routes: Routes = [
}
]
},
{ path: 'landing', component: LandingComponent },
{ path: 'landing', loadChildren: () => import('../landing/landing.module').then(m => m.LandingModule) }
{ path: 'landing', component: LandingComponent, data: { requiresAuth: false } },
{ path: 'landing', loadChildren: () => import('../landing/landing.module').then(m => m.LandingModule), data: { requiresAuth: false } }
];

@NgModule({
Expand Down
6 changes: 3 additions & 3 deletions src/app/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ <h1><ng-container>Planet</ng-container> {{planetName}}</h1>
<button mat-icon-button *planetAuthorizedRoles="'only,health'" i18n-title title="Health" routerLink="/health"><mat-icon>local_hospital</mat-icon></button>
</ng-container>
<span *ngIf="layout === 'classic' && !forceModern">
<button mat-icon-button routerLink="/chat" i18n-title title="Chat"><mat-icon>question_answer</mat-icon></button>
<button mat-icon-button planetFeedback i18n-title title="Feedback"><mat-icon>feedback_outline</mat-icon></button>
<button mat-icon-button routerLink="/feedback" i18n-title title="Messages"><mat-icon>mail</mat-icon></button>
<button mat-icon-button routerLink="/chat" i18n-title title="Chat"><mat-icon>chat_bubble_outline</mat-icon></button>
<button mat-icon-button planetFeedback i18n-title title="Submit Feedback"><mat-icon>feedback_outline</mat-icon></button>
<button mat-icon-button routerLink="/feedback" i18n-title title="Review Feedback"><mat-icon>mail_outline</mat-icon></button>
<ng-container *planetAuthorizedRoles>
<button mat-icon-button planetSync i18n-title title="Sync" *ngIf="onlineStatus === 'accepted'"><mat-icon svgIcon="feedback"></mat-icon></button>
</ng-container>
Expand Down
4 changes: 3 additions & 1 deletion src/app/home/home.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { UsersModule } from '../users/users.module';
import { PlanetComponent } from './planet.component';
import { CoursesViewDetailModule } from '../courses/view-courses/courses-view-detail.module';
import { ChatModule } from '../chat/chat.module';
import { SurveysModule } from '../surveys/surveys.module';

@NgModule({
imports: [
Expand All @@ -46,7 +47,8 @@ import { ChatModule } from '../chat/chat.module';
PlanetCalendarModule,
UsersModule,
CoursesViewDetailModule,
ChatModule
ChatModule,
SurveysModule
],
declarations: [
HomeComponent,
Expand Down
2 changes: 1 addition & 1 deletion src/app/manager-dashboard/manager-dashboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h3 i18n *ngIf="showParentList">{{ planetType === 'community' ? 'Nation' : 'Cent
<p *ngSwitchDefault i18n><b>Your request has not yet been accepted by { planetType, select, community {nation} nation {center}}</b></p>
</ng-container>
</div>
<div *ngIf="pin"><span i18n>Your tablet pin number is:</span> <b class="pinClass">{{ ' ' + pin + ' ' }}</b>
<div *ngIf="pin"><span i18n>myPlanet Server pin:</span> <b class="pinClass">{{ ' ' + pin + ' ' }}</b>
<button mat-raised-button i18n (click)="resetPin()">Reset Pin</button>
</div>
</ng-container>
Expand Down
13 changes: 10 additions & 3 deletions src/app/meetups/meetups.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,16 @@ export class MeetupService {
openDeleteDialog(meetups: any[] | any, callback) {
const isMany = meetups.length > 1;
const displayName = isMany ? '' : (meetups[0] || meetups).title;
const recurringInfo = (meetups[0] || meetups).recurring && (meetups[0] || meetups).recurring !== 'none' && (meetups[0] || meetups).recurringNumber
? `(Recurs ${ (meetups[0] || meetups).recurring} for ${ (meetups[0] || meetups).recurringNumber } ${ (meetups[0] || meetups).recurring === 'daily' ? 'days' : 'weeks' })`
: '';
const recurringInfo =
(meetups[0] || meetups).recurring &&
(meetups[0] || meetups).recurring !== 'none' &&
(meetups[0] || meetups).recurringNumber
? `(Recurs ${(meetups[0] || meetups).recurring} for ${
(meetups[0] || meetups).recurringNumber
} ${
(meetups[0] || meetups).recurring === 'daily' ? 'days' : 'weeks'
})`
: '';
this.deleteDialog = this.dialog.open(DialogsPromptComponent, {
data: {
okClick: this.deleteMeetups([ meetups ].flat(), displayName, callback),
Expand Down
5 changes: 3 additions & 2 deletions src/app/news/news-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ export class NewsListComponent implements OnChanges {
data: {
okClick: this.deleteNews(news),
changeType: 'delete',
type: 'news'
type: 'news',
displayName: news.message
}
});
}
Expand All @@ -134,7 +135,7 @@ export class NewsListComponent implements OnChanges {
this.deleteDialog.close();
},
onError: (error) => {
this.planetMessageService.showAlert($localize`There was a problem deleting this news.`);
this.planetMessageService.showAlert($localize`There was a problem deleting this message.`);
}
};
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/news/news.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class NewsService {
return ((item.viewIn || []).find(view => view._id === viewId) || {}).sharedDate;
}

postNews(post, successMessage = $localize`Thank you for submitting your news`, isMessageEdit = true) {
postNews(post, successMessage = $localize`Thank you for submitting your message`, isMessageEdit = true) {
const { configuration } = this.stateService;
const message = typeof post.message === 'string' ? post.message : post.message.text;
const images = this.createImagesArray(post, message);
Expand All @@ -76,7 +76,7 @@ export class NewsService {
}

deleteNews(post) {
return this.postNews({ ...post, _deleted: true }, $localize`Post deleted`);
return this.postNews({ ...post, _deleted: true }, $localize`Message deleted`);
}

createImagesArray(post, message) {
Expand All @@ -90,7 +90,7 @@ export class NewsService {
return this.couchService.bulkDocs(this.dbName, replies.map(reply => ({ ...reply.doc, replyTo: newReplyToId })));
}

shareNews(news, planets?: any[], successMessage = $localize`News has been successfully shared`) {
shareNews(news, planets?: any[], successMessage = $localize`Message has been successfully shared`) {
const viewInObject = (planet) => (
{ '_id': `${planet.code}@${planet.parentCode}`, section: 'community', sharedDate: this.couchService.datePlaceholder }
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/resources/resources-add.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
</mat-autocomplete>
<mat-error><planet-form-error-messages [control]="resourceForm.controls.openWhichFile"></planet-form-error-messages></mat-error>
</mat-form-field>
<div class="inner-gaps by-column full-width">
<div class="file-upload inner-gaps by-column full-width">
<label i18n>File Upload:</label>
<planet-file-input (fileChange)="bindFile($event)"></planet-file-input>
<label i18n class="warn-text-color" *ngIf="resourceForm?.errors?.fileTooBig">File size cannot exceed more than 512 MB</label>
Expand Down
6 changes: 6 additions & 0 deletions src/app/resources/resources-add.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@
.form-container {
width: auto;
}

.file-upload {
display: flex;
flex-direction: column;
}

}
}
21 changes: 21 additions & 0 deletions src/app/resources/resources.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ $label-height: 1rem;
}
}

.list-content-menu {
&.list-content-menu-auto {
.header {
word-break: break-word;
max-width: 100%;

a {
display: inline-block;
}
}
}
}

.ellipsis-menu {
text-align: center;
}
Expand All @@ -56,6 +69,14 @@ $label-height: 1rem;
justify-content: center;
}

.tags-list mat-chip {
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
}

@media(max-width: $screen-md) {
.resources-list {
.mat-column-createdDate {
Expand Down
9 changes: 9 additions & 0 deletions src/app/shared/auth-guard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ export class AuthService {
// For main app (which requires login). Uses canActivateChild to check on every route
// change if session has expired
canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {
let currentRoute: ActivatedRouteSnapshot | null = route;

while (currentRoute) {
if (currentRoute.data && currentRoute.data.requiresAuth === false) {
return of(true);
}
currentRoute = currentRoute.parent;
}

return this.checkUser(state.url);
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/dialogs/dialogs-announcement.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="announcement-container">
<img
src="https://res.cloudinary.com/mutugiii/image/upload/v1733224910/dec_challenge_svcbi3.jpg"
src="assets/challenge/dec challenge.jpeg"
alt="Issues Challenge"
class="announcement-banner"
/>
Expand Down
3 changes: 2 additions & 1 deletion src/app/shared/dialogs/dialogs-announcement.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
background-color: $primary;
transition: width 0.5s;
display: flex;
justify-content: center;
align-items: center;
white-space: nowrap;
padding: 0 10px;
}

.thermometer-label {
Expand Down
Loading

0 comments on commit aac9ddb

Please sign in to comment.