Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue challenge #7595

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/app/community/community.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { DialogsLoadingService } from '../shared/dialogs/dialogs-loading.service
import { MatDialog } from '@angular/material/dialog';
import { CommunityLinkDialogComponent } from './community-link-dialog.component';
import { TeamsService } from '../teams/teams.service';
import { DialogsAnnouncementComponent } from '../shared/dialogs/dialogs-announcement.component';
import { DialogsPromptComponent } from '../shared/dialogs/dialogs-prompt.component';
import { CouchService } from '../shared/couchdb.service';
import { PlanetMessageService } from '../shared/planet-message.service';
Expand Down Expand Up @@ -48,6 +49,18 @@ export class CommunityComponent implements OnInit, OnDestroy {
resizeCalendar: any = false;
deviceType: DeviceType;
deviceTypes = DeviceType;
challengeActive: boolean;
challengeTemplate = `
# Challenge Template

Please add your screenshot below:

![Screenshot](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRUcXBM7Z8y61oNm2yWy_4NPsGPBvCcKJiPhw&s)

Please add your short message below:

> Your message here...
`;

constructor(
private dialog: MatDialog,
Expand Down Expand Up @@ -83,6 +96,10 @@ export class CommunityComponent implements OnInit, OnDestroy {
this.setCouncillors(users);
}
});
this.challengeActive = this.configuration.code === 'learning' && new Date().getMonth() === 9;
if (this.challengeActive) {
this.openAnnouncementDialog();
}
}

@HostListener('window:resize') onResize() {
Expand Down Expand Up @@ -139,7 +156,11 @@ export class CommunityComponent implements OnInit, OnDestroy {
}
}

openAddMessageDialog(message = '') {
openAnnouncementDialog() {
this.dialog.open(DialogsAnnouncementComponent);
}

openAddMessageDialog(message = this.challengeActive ? this.challengeTemplate : '') {
this.dialogsFormService.openDialogsForm(
$localize`Add Voice`,
[ { name: 'message', placeholder: $localize`Your Voice`, type: 'markdown', required: true, imageGroup: 'community' } ],
Expand Down
35 changes: 35 additions & 0 deletions src/app/shared/dialogs/dialogs-announcement.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Component } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';

@Component({
template: `
<planet-markdown [content]="announcement"></planet-markdown>
`
})
export class DialogsAnnouncementComponent {
announcement = `
## Planet issues challenge

<img src="https://meetgor-cdn.pages.dev/github-filter-issues.png" alt="issues challenge" width="350" height="250">

Get ready for virtual intern github issues challenge!

**Duration:** 30 days

## Steps to participate:
- Find an issue on Planet
- Take a screenshot/record a video
- Create an issue on our github repository using link below

[open new Planet issue](https://github.com/open-learning-exchange/planet/issues/new)
`;


constructor(
public dialogRef: MatDialogRef<DialogsAnnouncementComponent>,
) {}

onClose(): void {
this.dialogRef.close();
}
}
7 changes: 5 additions & 2 deletions src/app/shared/dialogs/planet-dialogs.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { SharedComponentsModule } from '../shared-components.module';
import { SyncDirective } from '../../manager-dashboard/sync.directive';
import { DialogsImagesComponent } from './dialogs-images.component';
import { DialogsVideoComponent } from './dialogs-video.component';
import { DialogsAnnouncementComponent } from './dialogs-announcement.component';
import { DialogsRatingsComponent, DialogsRatingsDirective } from './dialogs-ratings.component';


Expand All @@ -40,7 +41,8 @@ import { DialogsRatingsComponent, DialogsRatingsDirective } from './dialogs-rati
DialogsRatingsComponent,
DialogsRatingsDirective,
ChangePasswordDirective,
SyncDirective
SyncDirective,
DialogsAnnouncementComponent,
],
declarations: [
DialogsFormComponent,
Expand All @@ -54,7 +56,8 @@ import { DialogsRatingsComponent, DialogsRatingsDirective } from './dialogs-rati
DialogsRatingsComponent,
DialogsRatingsDirective,
ChangePasswordDirective,
SyncDirective
SyncDirective,
DialogsAnnouncementComponent
],
providers: [
DialogsFormService,
Expand Down
Loading