Skip to content

Commit

Permalink
version 0.13.10 (#7080)
Browse files Browse the repository at this point in the history
Co-authored-by: Laxman Maharjan <email@mlaxman.com.np>
Co-authored-by: Rhea Malviya <94139372+rheam97@users.noreply.github.com>
  • Loading branch information
lmmrssa and rheam97 authored Apr 18, 2022
1 parent 8deb6c8 commit c96084b
Show file tree
Hide file tree
Showing 113 changed files with 41,551 additions and 13,246 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/planet-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Planet DB-Init Builder

on:
push:
branches-ignore:
- l10n_i18n
release:
types:
- created
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/planet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Planet Builder

on:
push:
branches-ignore:
- l10n_i18n
release:
types: [published]
workflow_dispatch:
Expand Down
3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "planet-app:build"
}
},
"ivy":true
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "planet-app",
"version": "0.13.9",
"version": "0.13.10",
"license": "AGPL-3.0",
"scripts": {
"ng": "ng",
Expand Down
4 changes: 2 additions & 2 deletions src/app/community/community-link-dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export class CommunityLinkDialogComponent {
@ViewChild('linkStepper') linkStepper: MatStepper;
selectedLink: { db, title, selector? };
links: { db, title, selector? }[] = [
{ db: 'teams', title: 'Teams', selector: { type: 'team' } },
{ db: 'teams', title: 'Enterprises', selector: { type: 'enterprise' } }
{ db: 'teams', title: $localize`Teams`, selector: { type: 'team' } },
{ db: 'teams', title: $localize`Enterprises`, selector: { type: 'enterprise' } }
];
linkForm: FormGroup;

Expand Down
22 changes: 11 additions & 11 deletions src/app/community/community.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class CommunityComponent implements OnInit, OnDestroy {
openAddMessageDialog(message = '') {
this.dialogsFormService.openDialogsForm(
'Add Story',
[ { name: 'message', placeholder: 'Your Story', type: 'markdown', required: true, imageGroup: 'community' } ],
[ { name: 'message', placeholder: $localize`Your Story`, type: 'markdown', required: true, imageGroup: 'community' } ],
{ message: [ message, CustomValidators.requiredMarkdown ] },
{ autoFocus: true, onSubmit: this.postMessage.bind(this) }
);
Expand All @@ -148,7 +148,7 @@ export class CommunityComponent implements OnInit, OnDestroy {
messageType: 'sync',
messagePlanetCode: this.configuration.code,
...message
}, 'Message has been posted successfully').pipe(
}, $localize`Message has been posted successfully`).pipe(
switchMap(() => forkJoin([
this.usersService.getAllUsers(),
this.couchService.findAll('notifications', findDocuments({ status: 'unread', type: 'communityMessage' }))
Expand All @@ -168,7 +168,7 @@ export class CommunityComponent implements OnInit, OnDestroy {
sendNotifications(user, currentUser) {
return {
'user': user,
'message': `<b>${currentUser.split(':')[1]}</b> posted a <b>new story</b>.`,
'message': $localize`<b>${currentUser.split(':')[1]}</b> posted a <b>new story</b>.`,
'link': '/',
'type': 'communityMessage',
'priority': 1,
Expand Down Expand Up @@ -240,10 +240,10 @@ export class CommunityComponent implements OnInit, OnDestroy {
request: this.couchService.updateDocument('teams', { ...link, _deleted: true }).pipe(switchMap(() => this.getLinks())),
onNext: (res) => {
this.setLinksAndFinances(res);
this.planetMessageService.showMessage(`${link.title} deleted`);
this.planetMessageService.showMessage($localize`${link.title} deleted`);
deleteDialog.close();
},
onError: () => this.planetMessageService.showAlert(`There was an error deleting ${link.title}`)
onError: () => this.planetMessageService.showAlert($localize`There was an error deleting ${link.title}`)
},
changeType: 'delete',
type: 'link',
Expand All @@ -262,7 +262,7 @@ export class CommunityComponent implements OnInit, OnDestroy {

openChangeTitleDialog({ member: councillor }) {
this.dialogsFormService.openDialogsForm(
councillor.doc.leadershipTitle ? 'Change Leader Title' : 'Add Leader Title',
councillor.doc.leadershipTitle ? $localize`Change Leader Title` : $localize`Add Leader Title`,
[ { name: 'leadershipTitle', placeholder: 'Title', type: 'textbox' } ],
{ leadershipTitle: councillor.doc.leadershipTitle || '' },
{ autoFocus: true, onSubmit: this.updateTitle(councillor).bind(this) }
Expand All @@ -280,10 +280,10 @@ export class CommunityComponent implements OnInit, OnDestroy {
finalize(() => this.dialogsLoadingService.stop())
).subscribe(() => {
const msg = !leadershipTitle ?
'Title deleted' :
$localize`Title deleted` :
!councillor.doc.leadershipTitle ?
'Title added' :
'Title updated';
$localize`Title added` :
$localize`Title updated`;
this.dialogsFormService.closeDialogsForm();
this.planetMessageService.showMessage(msg);
this.usersService.requestUsers();
Expand All @@ -302,8 +302,8 @@ export class CommunityComponent implements OnInit, OnDestroy {
this.dialogsFormService.closeDialogsForm();
};
this.dialogsFormService.openDialogsForm(
this.team.description ? 'Edit Description' : 'Add Description',
[ { name: 'description', placeholder: 'Description', type: 'markdown', required: true, imageGroup: 'community' } ],
this.team.description ? $localize`Edit Description` : $localize`Add Description`,
[ { name: 'description', placeholder: $localize`Description`, type: 'markdown', required: true, imageGroup: 'community' } ],
{ description: { text: this.team.description || '', images: this.team.images || [] } },
{ onSubmit: submitDescription }
);
Expand Down
10 changes: 5 additions & 5 deletions src/app/configuration/configuration.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class ConfigurationComponent implements OnInit {
{ domain: environment.centerAddress, protocol: environment.centerProtocol })
.subscribe((data) => {
this.nations = data.docs;
}, (error) => this.planetMessageService.showAlert('There is a problem getting the list of nations'));
}, (error) => this.planetMessageService.showAlert($localize`There is a problem getting the list of nations`));
}

onChange(selectedValue: string) {
Expand Down Expand Up @@ -251,18 +251,18 @@ export class ConfigurationComponent implements OnInit {
this.configurationService.updateConfiguration(configuration).pipe(finalize(spinnerOff)).subscribe(
() => this.stateService.requestData('configurations', 'local'),
err => {
this.planetMessageService.showAlert('There was an error updating the configuration');
this.planetMessageService.showAlert($localize`There was an error updating the configuration`);
}, () => {
this.router.navigate([ '/manager' ]);
this.planetMessageService.showMessage('Configuration Updated Successfully');
this.planetMessageService.showMessage($localize`Configuration Updated Successfully`);
}
);
} else {
const admin = Object.assign(credentials, this.contactFormGroup.value);
this.configurationService.createPlanet(admin, configuration, credentials).pipe(finalize(spinnerOff)).subscribe((data) => {
this.planetMessageService.showMessage('Admin created: ' + credentials.name);
this.planetMessageService.showMessage($localize`Admin created: ${credentials.name}`);
this.router.navigate([ '/login' ]);
}, (error) => this.planetMessageService.showAlert('There was an error creating planet'));
}, (error) => this.planetMessageService.showAlert($localize`There was an error creating planet`));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/configuration/configuration.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ConfigurationService {
return mergeMap(data => {
const requestNotification = {
'user': 'SYSTEM',
'message': `New ${configuration.planetType} <b>"${configuration.name}"</b> has requested to connect.`,
'message': $localize`New ${configuration.planetType} <b>"${configuration.name}"</b> has requested to connect.`,
'link': '/manager/requests/',
'linkParams': { 'search': configuration.code },
'type': 'request',
Expand Down
6 changes: 3 additions & 3 deletions src/app/configuration/migration.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class MigrationComponent implements OnInit {
.subscribe(() => {
this.stepper.selected.completed = true;
this.stepper.next();
}, error => this.planetMessageService.showMessage('Configuration is not valid. Please check again.'));
}, error => this.planetMessageService.showMessage($localize`Configuration is not valid. Please check again.`));
}

clonePlanet() {
Expand All @@ -94,7 +94,7 @@ export class MigrationComponent implements OnInit {
switchMap(() => this.getDatabaseNames()),
switchMap((syncDatabases: string[]) => forkJoin(syncDatabases.map(db => this.syncService.sync(this.syncDoc(db), this.credential))))
).subscribe(() => {
this.planetMessageService.showMessage(`Planet is being synced with domain "${this.cloneDomain}". Please hold on.`);
this.planetMessageService.showMessage($localize`Planet is being synced with domain "${this.cloneDomain}". Please hold on.`);
this.dialogsLoadingService.start();
this.replicationCompletionCheck(() => this.cloneUserDbs());
});
Expand Down Expand Up @@ -124,7 +124,7 @@ export class MigrationComponent implements OnInit {
completeMigration() {
this.router.navigate([ '/' ]);
this.dialogsLoadingService.stop();
this.planetMessageService.showMessage(`Cloning "${this.cloneDomain}" complete.`);
this.planetMessageService.showMessage($localize`Cloning "${this.cloneDomain}" complete.`);
}

syncDoc(db: string) {
Expand Down
4 changes: 2 additions & 2 deletions src/app/courses/add-courses/courses-add.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class CoursesAddComponent implements OnInit, OnDestroy {
// from the languages import
languageNames = languages.map(list => list.name);

mockStep = { stepTitle: 'Add title', description: '!!!' };
mockStep = { stepTitle: $localize`Add title`, description: '!!!' };

constructor(
private router: Router,
Expand Down Expand Up @@ -198,7 +198,7 @@ export class CoursesAddComponent implements OnInit, OnDestroy {
)
])
)).subscribe(([ courseRes, tagsRes ]) => {
const message = courseInfo.courseTitle + (this.pageType === 'Update' ? ' Updated Successfully' : ' Added');
const message = courseInfo.courseTitle + (this.pageType === 'Update' ? $localize` Updated Successfully` : $localize` Added`);
this.courseChangeComplete(message, courseRes, shouldNavigate);
}, (err) => {
// Connect to an error display component to show user that an error has occurred
Expand Down
20 changes: 10 additions & 10 deletions src/app/courses/courses.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
// It's safer to remove the item from the array based on its id than to splice based on the index
this.courses.data = this.courses.data.filter((c: any) => data.id !== c._id);
this.deleteDialog.close();
this.planetMessageService.showMessage('Course deleted: ' + course.courseTitle);
this.planetMessageService.showMessage($localize`Course deleted: ${course.courseTitle}`);
},
onError: (error) => this.planetMessageService.showAlert('There was a problem deleting this course.')
onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting this course.`)
};
}

Expand All @@ -283,9 +283,9 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
this.getCourses();
this.selection.clear();
this.deleteDialog.close();
this.planetMessageService.showMessage('You have deleted ' + deleteArray.length + ' courses');
this.planetMessageService.showMessage($localize`You have deleted ${deleteArray.length} courses`);
},
onError: (error) => this.planetMessageService.showAlert('There was a problem deleting courses.')
onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting courses.`)
};
}

Expand Down Expand Up @@ -374,7 +374,7 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
newShelf._rev = res.rev;
this.userService.shelf = newShelf;
this.setupList(this.courses.data, this.userShelf.courseIds);
this.planetMessageService.showMessage(message + ' myCourses');
this.planetMessageService.showMessage($localize`${message} myCourses`);
}, (error) => (error));
}

Expand All @@ -383,7 +383,7 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
const courseIds = courses.map((data) => {
return data._id;
}).concat(currentShelf.courseIds).reduce(dedupeShelfReduce, []);
const message = courses.length === 1 ? courses[0].courseTitle + ' have been added to' : courses.length + ' courses have been added to';
const message = courses.length === 1 ? $localize`${courses[0].courseTitle} have been added to` : $localize`${courses.length} courses have been added to`;
this.updateShelf(Object.assign({}, currentShelf, { courseIds }), message);
}

Expand All @@ -409,7 +409,7 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
this.syncService.replicatorsArrayWithTags(courses, type, parentType).pipe(switchMap(replicators =>
this.syncService.confirmPasswordAndRunReplicators(replicators)
)).subscribe(() => {
this.planetMessageService.showMessage(courses.length + ' ' + this.dbName + ' ' + 'queued to ' + msg);
this.planetMessageService.showMessage($localize`${courses.length} ${this.dbName} queued to ${msg}`);
}, () => error => this.planetMessageService.showMessage(error));
}

Expand All @@ -435,9 +435,9 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
center: selected.length > 1 ? 'nations' : 'nation',
nation: selected.length > 1 ? 'communities' : 'community'
}[this.planetType];
this.planetMessageService.showMessage(`Courses queued to push to ${childType}.`);
this.planetMessageService.showMessage($localize`Courses queued to push to ${childType}.`);
this.dialogRef.close();
}, () => this.planetMessageService.showAlert('There was an error sending these courses'));
}, () => this.planetMessageService.showAlert($localize`There was an error sending these courses`));
};
}

Expand All @@ -446,7 +446,7 @@ export class CoursesComponent implements OnInit, OnChanges, AfterViewInit, OnDes
this.courses.data, this.dbName, { selectedIds: this.selection.selected, tagIds: selected, indeterminateIds: indeterminate }
).subscribe(() => {
this.getCourses();
this.planetMessageService.showMessage('Collections updated');
this.planetMessageService.showMessage($localize`Collections updated`);
});
}

Expand Down
8 changes: 4 additions & 4 deletions src/app/courses/courses.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ export class CoursesService {
courseIds.push(courseId);
}
return this.userService.updateShelf(courseIds, 'courseIds').pipe(map((res) => {
const admissionMessage = type === 'resign' ? title + ' successfully removed from myCourses' :
title + ' added to your dashboard';
const admissionMessage = type === 'resign' ? $localize`${title} successfully removed from myCourses` :
$localize`${title} added to your dashboard`;
this.planetMessageService.showMessage(admissionMessage);
return res;
}));
Expand All @@ -224,8 +224,8 @@ export class CoursesService {

courseAdmissionMany(courseIds, type) {
return this.userService.changeShelf(courseIds, 'courseIds', type).pipe(map(({ shelf, countChanged }) => {
const prefix = countChanged > 1 ? countChanged + ' courses' : this.getCourseNameFromId(courseIds[courseIds.length - 1]);
const message = type === 'remove' ? prefix + ' successfully removed from myCourses' : prefix + ' added to your dashboard';
const prefix = countChanged > 1 ? $localize`${countChanged} courses` : this.getCourseNameFromId(courseIds[courseIds.length - 1]);
const message = type === 'remove' ? $localize`${prefix} successfully removed from myCourses` : $localize`${prefix} added to your dashboard`;
this.planetMessageService.showMessage(message);
return shelf;
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</mat-form-field>
</mat-toolbar>
<div class="view-container view-full-height">
<planet-courses-progress-chart *ngIf="chartData?.length; else noProgress" i18n-label [label]="chartLabel" [inputs]="chartData" [height]="yAxisLength" [showAvatar]="true" (clickAction)="memberClick($event)" (changeData)="changeData($event)">
<planet-courses-progress-chart *ngIf="chartData?.length; else noProgress" [label]="chartLabel" [inputs]="chartData" [height]="yAxisLength" [showAvatar]="true" (clickAction)="memberClick($event)" (changeData)="changeData($event)">
</planet-courses-progress-chart>
<ng-template #noProgress i18n>No Progress record available</ng-template>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class CoursesProgressLeaderComponent implements OnInit, OnDestroy {
course: any;
// Need to define this variable for template which is shared with CoursesProgressLearner
headingStart = '';
chartLabel = 'Steps';
chartLabel = $localize`Steps`;
selectedStep: any;
allChartData: any[] = [];
chartData: any[];
Expand Down Expand Up @@ -77,7 +77,7 @@ export class CoursesProgressLeaderComponent implements OnInit, OnDestroy {
onStepChange(value: any) {
this.selectedStep = value;
this.setSingleStep(this.submissions);
this.chartLabel = 'Quest.';
this.chartLabel = $localize`Quest.`;
}

setSubmissions() {
Expand Down Expand Up @@ -163,12 +163,12 @@ export class CoursesProgressLeaderComponent implements OnInit, OnDestroy {
this.selectedStep = this.course.steps[courseIndex];
this.setSingleStep(this.submissions);
}
this.chartLabel = 'Quest.';
this.chartLabel = $localize`Quest.`;
}

resetToFullCourse() {
this.setFullCourse(this.submissions);
this.chartLabel = 'Steps';
this.chartLabel = $localize`Steps`;
}

userProgress(user) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h3 class="margin-lr-3 ellipsis-title"><ng-container i18n>Step</ng-container> {{
</mat-option>
</mat-select>
</mat-form-field>
<span i18n>{{stepNum}}/{{maxStep}}</span>
<span>{{stepNum}}/{{maxStep}}</span>
<button mat-icon-button [disabled]="stepNum === 1" (click)="changeStep(-1)"><mat-icon>navigate_before</mat-icon></button>
<button mat-icon-button [disabled]="stepNum === maxStep || (!parent && stepDetail?.exam?.questions.length > 0 && !attempts)" (click)="changeStep(1)"><mat-icon>navigate_next</mat-icon></button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/dashboard-tile.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class="dashboard-item"
[ngClass]="{'bg-grey': even, 'cursor-pointer': item.link}"
[routerLink]="item.link"
i18n-matTooltip [matTooltip]="item.tooltip"
[matTooltip]="item.tooltip"
cdkDrag
[cdkDragDisabled]="cardTitle==='myLife'"
#dashboardTile
Expand Down
6 changes: 3 additions & 3 deletions src/app/dashboard/dashboard-tile.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class DashboardTileComponent implements AfterViewChecked {
this.dialogPrompt.close();
this.removeMessage(item);
},
onError: () => this.planetMessageService.showMessage('There was an error removing ' + item.title)
onError: () => this.planetMessageService.showMessage($localize`There was an error removing ${item.title}`)
},
changeType: 'leave',
type: 'team',
Expand All @@ -78,7 +78,7 @@ export class DashboardTileComponent implements AfterViewChecked {
}

removeMessage(item) {
this.planetMessageService.showMessage(item.title + ' removed from ' + this.cardTitle);
this.planetMessageService.showMessage($localize`${item.title} removed from ${this.cardTitle}`);
}

drop(event: CdkDragDrop<string[]>) {
Expand All @@ -88,7 +88,7 @@ export class DashboardTileComponent implements AfterViewChecked {
this.userService.updateShelf(ids, this.shelfName).subscribe(
() => {},
() => {
this.planetMessageService.showAlert('There was an error reordering ' + this.cardTitle);
this.planetMessageService.showAlert($localize`There was an error reordering ${this.cardTitle}`);
moveItemInArray(this.itemData, event.currentIndex, event.previousIndex);
}
);
Expand Down
Loading

0 comments on commit c96084b

Please sign in to comment.