From 204c86426c6d3996eff68d291bdeea737d96d74e Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Fri, 9 May 2025 12:29:52 -0700 Subject: [PATCH 01/23] Refactored template with @if and @for --- .../contact-form/contact-form.component.html | 262 +++++++++--------- 1 file changed, 135 insertions(+), 127 deletions(-) diff --git a/src/app/contact/contact-form/contact-form.component.html b/src/app/contact/contact-form/contact-form.component.html index fa2a0c07656..84b4110929f 100644 --- a/src/app/contact/contact-form/contact-form.component.html +++ b/src/app/contact/contact-form/contact-form.component.html @@ -6,136 +6,144 @@ -
-

Thank you for contacting WISE!

-

Your message has been sent. We will get back to you as soon as possible.

-
-
- Return to WISE Home + @if (complete) { +
+

Thank you for contacting WISE!

+

Your message has been sent. We will get back to you as soon as possible.

+
+
-
-
-

Contact WISE

-

- - Name - - Name required - -

-

- - Email - - Email required - Invalid Email - -

-

- - Teacher - - - {{ teacher.displayName }} - - - Teacher required - -

-

- - Issue Type - - - {{ issueType.value }} - - - Issue Type required - -

-

- - Project Name - - -

-

- - Summary - - Summary required - -

-

- - Description - - Description required - -

-

- This site is protected by reCAPTCHA and the Google - Privacy Policy and - Terms of Service apply. -

- -
 
-
- -

- Recaptcha failed. Please reload the page and try again! + } @else { + +

Contact WISE

+

+ + Name + + @if (contactFormGroup.controls['name'].hasError('required')) { + Name required + } + +

+ @if (!isStudent) { +

+ + Email + + @if (contactFormGroup.controls['email'].hasError('required')) { + Email required + } + @if (contactFormGroup.controls['email'].hasError('email')) { + Invalid Email + } + +

+ } @else { + @if (teachers.length > 0) { +

+ + Teacher + + @for (teacher of teachers; track teacher.username) { + + {{ teacher.displayName }} + + } + + @if (contactFormGroup.controls['teacher'].hasError('required')) { + Teacher required + } + +

+ } + } +

+ + Issue Type + + @for (issueType of issueTypes; track issueType.key) { + + {{ issueType.value }} + + } + + @if (contactFormGroup.controls['issueType'].hasError('required')) { + Issue Type required + } +

-
- -

- Sorry, there was a problem submitting the form. Please try again. + @if (projectName) { +

+ + Project Name + + +

+ } +

+ + Summary + + @if (contactFormGroup.controls['summary'].hasError('required')) { + Summary required + } + +

+

+ + Description + + @if (contactFormGroup.controls['description'].hasError('required')) { + Description required + } + +

+ @if (isRecaptchaEnabled) { +

+ This site is protected by reCAPTCHA and the Google + Privacy Policy and + Terms of Service apply. +

+ } + @if (!isError) { +
 
+ } @else { + @if (isRecaptchaEnabled && isRecaptchaError) { +

+ Recaptcha failed. Please reload the page and try again! +

+ } @else { +

+ Sorry, there was a problem submitting the form. Please try again. +

+ } + } +

+

-
-

- -

-
+ + }
From 9dcd0eb8f5aeb28bcffe4654ed4ae50a00e0d381 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Sat, 10 May 2025 23:36:30 -0700 Subject: [PATCH 02/23] Changes to library project details --- .../library-project-details.component.html | 7 +++++++ .../library-project-details.component.ts | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/app/modules/library/library-project-details/library-project-details.component.html b/src/app/modules/library/library-project-details/library-project-details.component.html index 445bb0c5157..d2dd792235b 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.html +++ b/src/app/modules/library/library-project-details/library-project-details.component.html @@ -196,6 +196,13 @@
+ @if (isMyUnit) { + + + + } @if ( isTeacher && !isRunProject && diff --git a/src/app/modules/library/library-project-details/library-project-details.component.ts b/src/app/modules/library/library-project-details/library-project-details.component.ts index 03207f3b7a0..1458072a49b 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.ts +++ b/src/app/modules/library/library-project-details/library-project-details.component.ts @@ -39,6 +39,7 @@ export class LibraryProjectDetailsComponent implements OnInit { protected authorsString: string = ''; protected canPreview: boolean; protected isCopy: boolean; + protected isMyUnit: boolean; protected isTeacher: boolean; protected isRunProject: false; protected licenseInfo = $localize`License pertains to original content created by the author(s). Authors are responsible for the usage and attribution of any third-party content linked to or included in this work.`; @@ -46,6 +47,7 @@ export class LibraryProjectDetailsComponent implements OnInit { protected parentAuthorsString: string = ''; protected parentProject: ParentProject; protected project: Project; + protected shareUnitUrl: string; protected standardLabels: any = { commonCore: $localize`Common Core`, learningForJustice: $localize`Learning For Justice`, @@ -78,6 +80,8 @@ export class LibraryProjectDetailsComponent implements OnInit { this.project.metadata.unitType === 'Other' && this.project.metadata.resources.length === 0 ); } + this.isMyUnit = this.project.isOwner(this.userService.getUserId()); + this.shareUnitUrl = `${this.configService.getContextPath()}/contact?projectId=${this.project.id}&share=true`; } private setLicenseInfo(): void { From 2d443c433f9ba5878b8e86f20d82a7e1521a530f Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Sat, 10 May 2025 23:36:35 -0700 Subject: [PATCH 03/23] Changes to contact form --- .../contact-form/contact-form.component.html | 27 ++++++++++++------- .../contact-form/contact-form.component.ts | 25 +++++++++++++---- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/app/contact/contact-form/contact-form.component.html b/src/app/contact/contact-form/contact-form.component.html index 84b4110929f..fb2d38f9c6d 100644 --- a/src/app/contact/contact-form/contact-form.component.html +++ b/src/app/contact/contact-form/contact-form.component.html @@ -82,15 +82,17 @@

Contact WISE

} -

- - Summary - - @if (contactFormGroup.controls['summary'].hasError('required')) { - Summary required - } - -

+ @if (!isShareIssueType()) { +

+ + Summary + + @if (contactFormGroup.controls['summary'].hasError('required')) { + Summary required + } + +

+ }

Description @@ -101,6 +103,11 @@

Contact WISE

formControlName="description" rows="10" cols="10" + [placeholder]=" + isShareIssueType() + ? 'Why do you want to share this unit with the WISE community?' + : '' + " > @if (contactFormGroup.controls['description'].hasError('required')) { @@ -139,7 +146,7 @@

Contact WISE

@if (isSendingRequest) { } - Submit + Submit{{ isShareIssueType() ? ' for Review' : '' }}

diff --git a/src/app/contact/contact-form/contact-form.component.ts b/src/app/contact/contact-form/contact-form.component.ts index 51eaa5cc8c6..d281e5f703c 100644 --- a/src/app/contact/contact-form/contact-form.component.ts +++ b/src/app/contact/contact-form/contact-form.component.ts @@ -12,11 +12,11 @@ import { ReCaptchaV3Service } from 'ng-recaptcha-2'; import { Subscription, lastValueFrom } from 'rxjs'; @Component({ - selector: 'app-contact-form', - templateUrl: './contact-form.component.html', - styleUrls: ['./contact-form.component.scss'], - encapsulation: ViewEncapsulation.None, - standalone: false + selector: 'app-contact-form', + templateUrl: './contact-form.component.html', + styleUrls: ['./contact-form.component.scss'], + encapsulation: ViewEncapsulation.None, + standalone: false }) export class ContactFormComponent implements OnInit { issueTypes: object[] = []; @@ -30,6 +30,7 @@ export class ContactFormComponent implements OnInit { projectId: number; projectName: string; isError: boolean = false; + isShare: boolean = false; isStudent: boolean = false; isSignedIn: boolean = false; isSendingRequest: boolean = false; @@ -58,9 +59,16 @@ export class ContactFormComponent implements OnInit { this.isRecaptchaEnabled = this.configService.isRecaptchaEnabled(); this.populateFieldsIfSignedIn(); this.populateIssueTypes(); + this.setIsShare(); this.setIssueTypeIfNecessary(); } + private setIsShare() { + this.route.queryParams.subscribe((params) => { + this.isShare = params['share']; + }); + } + obtainRunIdOrProjectIdIfNecessary() { this.route.queryParams.subscribe((params) => { this.runId = params['runId']; @@ -137,6 +145,7 @@ export class ContactFormComponent implements OnInit { { key: 'PROJECT_PROBLEMS', value: $localize`Problems with a WISE Unit` }, { key: 'STUDENT_MANAGEMENT', value: $localize`Student Management` }, { key: 'AUTHORING', value: $localize`Need Help with Authoring` }, + { key: 'SHARE', value: $localize`Share Unit` }, { key: 'FEEDBACK', value: $localize`Feedback to WISE` }, { key: 'OTHER', value: $localize`Other` } ]; @@ -146,6 +155,8 @@ export class ContactFormComponent implements OnInit { setIssueTypeIfNecessary() { if (this.runId != null) { this.setControlFieldValue('issueType', 'PROJECT_PROBLEMS'); + } else if (this.isShare) { + this.setControlFieldValue('issueType', 'SHARE'); } } @@ -266,4 +277,8 @@ export class ContactFormComponent implements OnInit { setIsSendingRequest(value: boolean) { this.isSendingRequest = value; } + + protected isShareIssueType(): boolean { + return this.contactFormGroup.get('issueType').value === 'SHARE'; + } } From 9dddadea987e232b1ceb033b73ffeb1fb1200435 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Mon, 12 May 2025 09:22:23 -0700 Subject: [PATCH 04/23] Changes to project info authoring --- .../project-info-authoring.component.html | 7 +++++++ .../project-info-authoring.component.scss | 4 ++++ .../project-info-authoring.component.ts | 11 ++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html index 8142226e355..ebbbaccb185 100644 --- a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html +++ b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html @@ -1,3 +1,10 @@ +@if (isMyUnit) { + +}
Unit Icon diff --git a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.scss b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.scss index a785243aa16..3617af08b39 100644 --- a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.scss +++ b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.scss @@ -45,4 +45,8 @@ .input { width: 50%; +} + +.share-button { + float: right; } \ No newline at end of file diff --git a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts index 1f2e49091da..ae635b9c0fa 100644 --- a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts +++ b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts @@ -4,6 +4,7 @@ import { TeacherProjectService } from '../../services/teacherProjectService'; import { MatDialog } from '@angular/material/dialog'; import { Subject, debounceTime } from 'rxjs'; import { AssetChooser } from '../project-asset-authoring/asset-chooser'; +import { UserService } from '../../../../app/services/user.service'; @Component({ selector: 'project-info-authoring', @@ -13,6 +14,7 @@ import { AssetChooser } from '../project-asset-authoring/asset-chooser'; }) export class ProjectInfoAuthoringComponent { isEditingProjectIcon: boolean = false; + protected isMyUnit: boolean; isShowProjectIcon: boolean = false; isShowProjectIconError: boolean = false; isShowProjectIconLoading: boolean = false; @@ -21,11 +23,13 @@ export class ProjectInfoAuthoringComponent { metadataChanged: Subject = new Subject(); projectIcon: string = ''; projectIcons: any = []; + protected shareUnitUrl; constructor( private configService: ConfigService, private dialog: MatDialog, - private projectService: TeacherProjectService + private projectService: TeacherProjectService, + private userService: UserService ) {} ngOnInit(): void { @@ -39,6 +43,11 @@ export class ProjectInfoAuthoringComponent { this.metadataAuthoring = JSON.parse( this.configService.getConfigParam('projectMetadataSettings') ); + const userAuthor = this.metadata.authors.find( + (author) => author.id === this.userService.getUserId() + ); + this.isMyUnit = userAuthor !== undefined; + this.shareUnitUrl = `${this.configService.getContextPath()}/contact?projectId=${this.configService.getRunId()}&share=true`; this.loadProjectIcon(); this.processMetadata(); this.metadataChanged.pipe(debounceTime(1000)).subscribe(() => { From 9443354f339868eae66796d7263011ae1dbeb6e1 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Tue, 13 May 2025 12:06:08 -0700 Subject: [PATCH 05/23] Remove required validator for summry if sharing unit --- .../contact-form/contact-form.component.html | 10 +++++-- .../contact-form/contact-form.component.ts | 29 ++++++++++++++----- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/app/contact/contact-form/contact-form.component.html b/src/app/contact/contact-form/contact-form.component.html index fb2d38f9c6d..603b13269a3 100644 --- a/src/app/contact/contact-form/contact-form.component.html +++ b/src/app/contact/contact-form/contact-form.component.html @@ -82,11 +82,17 @@

Contact WISE

} - @if (!isShareIssueType()) { + @if (!isShare) {

Summary - + @if (contactFormGroup.controls['summary'].hasError('required')) { Summary required } diff --git a/src/app/contact/contact-form/contact-form.component.ts b/src/app/contact/contact-form/contact-form.component.ts index d281e5f703c..390f2dd7115 100644 --- a/src/app/contact/contact-form/contact-form.component.ts +++ b/src/app/contact/contact-form/contact-form.component.ts @@ -59,16 +59,11 @@ export class ContactFormComponent implements OnInit { this.isRecaptchaEnabled = this.configService.isRecaptchaEnabled(); this.populateFieldsIfSignedIn(); this.populateIssueTypes(); + this.adjustSummaryRequiredOnIssueTypeChange(); this.setIsShare(); this.setIssueTypeIfNecessary(); } - private setIsShare() { - this.route.queryParams.subscribe((params) => { - this.isShare = params['share']; - }); - } - obtainRunIdOrProjectIdIfNecessary() { this.route.queryParams.subscribe((params) => { this.runId = params['runId']; @@ -152,6 +147,26 @@ export class ContactFormComponent implements OnInit { } } + private adjustSummaryRequiredOnIssueTypeChange() { + this.contactFormGroup.get('issueType').valueChanges.subscribe(() => { + const summaryControl = this.contactFormGroup.get('summary'); + if (this.getControlFieldValue('issueType') === 'SHARE') { + summaryControl.clearValidators(); + summaryControl.updateValueAndValidity(); + this.isShare = true; + } else if (this.isShare) { + summaryControl.addValidators(Validators.required); + this.isShare = false; + } + }); + } + + private setIsShare() { + this.route.queryParams.subscribe((params) => { + this.isShare = params['share']; + }); + } + setIssueTypeIfNecessary() { if (this.runId != null) { this.setControlFieldValue('issueType', 'PROJECT_PROBLEMS'); @@ -279,6 +294,6 @@ export class ContactFormComponent implements OnInit { } protected isShareIssueType(): boolean { - return this.contactFormGroup.get('issueType').value === 'SHARE'; + return this.getControlFieldValue('issueType') === 'SHARE'; } } From 35c837f2715febea188bce62db9c7a091fa61ae7 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Tue, 13 May 2025 14:49:24 -0700 Subject: [PATCH 06/23] Fixed tests and check for author instead of owner in library project details --- .../library-project-details.component.spec.ts | 1 + .../library-project-details.component.ts | 9 ++++++++- .../project-info-authoring.component.spec.ts | 10 ++++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/app/modules/library/library-project-details/library-project-details.component.spec.ts b/src/app/modules/library/library-project-details/library-project-details.component.spec.ts index 60fb5d20a58..7700f618866 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.spec.ts +++ b/src/app/modules/library/library-project-details/library-project-details.component.spec.ts @@ -42,6 +42,7 @@ describe('LibraryProjectDetailsComponent', () => { { provide: MAT_DIALOG_DATA, useValue: { project: project } } ] }); + spyOn(TestBed.inject(UserService), 'getUserId').and.returnValue(10); fixture = TestBed.createComponent(LibraryProjectDetailsComponent); component = fixture.componentInstance; diff --git a/src/app/modules/library/library-project-details/library-project-details.component.ts b/src/app/modules/library/library-project-details/library-project-details.component.ts index 1458072a49b..ce8c2fb4817 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.ts +++ b/src/app/modules/library/library-project-details/library-project-details.component.ts @@ -80,10 +80,17 @@ export class LibraryProjectDetailsComponent implements OnInit { this.project.metadata.unitType === 'Other' && this.project.metadata.resources.length === 0 ); } - this.isMyUnit = this.project.isOwner(this.userService.getUserId()); + this.isMyUnit = this.userIsAuthor(); this.shareUnitUrl = `${this.configService.getContextPath()}/contact?projectId=${this.project.id}&share=true`; } + private userIsAuthor(): boolean { + return ( + this.project.metadata.authors.find((author) => author.id === this.userService.getUserId()) !== + undefined + ); + } + private setLicenseInfo(): void { this.authorsString = this.getAuthorsString(this.project.metadata.authors); if (this.parentProject) { diff --git a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.spec.ts b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.spec.ts index 82d8d58cb80..4790161f92a 100644 --- a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.spec.ts +++ b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.spec.ts @@ -7,8 +7,10 @@ import { ConfigService } from '../../services/configService'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { EditUnitResourcesComponent } from '../edit-unit-resources/edit-unit-resources.component'; import { EditUnitTypeComponent } from '../edit-unit-type/edit-unit-type.component'; +import { MockProvider } from 'ng-mocks'; +import { UserService } from '../../../../app/services/user.service'; -describe('ProjectInfoAuthoringComponent', () => { +fdescribe('ProjectInfoAuthoringComponent', () => { let component: ProjectInfoAuthoringComponent; let fixture: ComponentFixture; @@ -21,13 +23,17 @@ describe('ProjectInfoAuthoringComponent', () => { StudentTeacherCommonServicesModule ], providers: [ + MockProvider(UserService), TeacherProjectService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting() ] }).compileComponents(); - spyOn(TestBed.inject(TeacherProjectService), 'getProjectMetadata').and.returnValue({}); + spyOn(TestBed.inject(TeacherProjectService), 'getProjectMetadata').and.returnValue({ + authors: [] + }); spyOn(TestBed.inject(ConfigService), 'getConfigParam').and.returnValue('{ "fields": [] }'); + spyOn(TestBed.inject(UserService), 'getUserId').and.returnValue(1); fixture = TestBed.createComponent(ProjectInfoAuthoringComponent); component = fixture.componentInstance; fixture.detectChanges(); From c95f23fa2e3c0aee2c46ee600cce6e6b0c17c969 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Tue, 13 May 2025 15:05:43 -0700 Subject: [PATCH 07/23] Changed button/text colors --- .../library-project-details.component.html | 2 +- .../library-project-details.component.scss | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/modules/library/library-project-details/library-project-details.component.html b/src/app/modules/library/library-project-details/library-project-details.component.html index d2dd792235b..db878987ffa 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.html +++ b/src/app/modules/library/library-project-details/library-project-details.component.html @@ -198,7 +198,7 @@ @if (isMyUnit) { - diff --git a/src/app/modules/library/library-project-details/library-project-details.component.scss b/src/app/modules/library/library-project-details/library-project-details.component.scss index 45e801753d7..ebf876f0db6 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.scss +++ b/src/app/modules/library/library-project-details/library-project-details.component.scss @@ -58,6 +58,16 @@ } } +.share-button { + background-color: #099A09; + color: white; +} + +.share-button > maticon { + // background-color: white; + color: white; +} + discourse-category-activity, unit-tags { margin-bottom: 12px; display: block; From 0347d18e27e863d381e4276c6fd52d24487f6bc9 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Tue, 13 May 2025 15:05:43 -0700 Subject: [PATCH 08/23] Changed button/text colors --- .../library-project-details.component.html | 2 +- .../library-project-details.component.scss | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/modules/library/library-project-details/library-project-details.component.html b/src/app/modules/library/library-project-details/library-project-details.component.html index d2dd792235b..db878987ffa 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.html +++ b/src/app/modules/library/library-project-details/library-project-details.component.html @@ -198,7 +198,7 @@ @if (isMyUnit) { - diff --git a/src/app/modules/library/library-project-details/library-project-details.component.scss b/src/app/modules/library/library-project-details/library-project-details.component.scss index 45e801753d7..b9c5e607105 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.scss +++ b/src/app/modules/library/library-project-details/library-project-details.component.scss @@ -58,6 +58,15 @@ } } +.share-button { + background-color: #099A09; + color: white; +} + +.share-button > maticon { + color: white; +} + discourse-category-activity, unit-tags { margin-bottom: 12px; display: block; From daff2f11a4c88af0e03e13d09cbc967dcad48e87 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 13 May 2025 22:18:50 +0000 Subject: [PATCH 09/23] Updated messages --- src/messages.xlf | 132 +++++++++++++++++++++++++++-------------------- 1 file changed, 75 insertions(+), 57 deletions(-) diff --git a/src/messages.xlf b/src/messages.xlf index c7b9a98d7fd..0ae92719644 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -283,7 +283,7 @@ src/app/modules/library/library-project-details/library-project-details.component.html - 198,202 + 198,201 src/app/modules/library/public-unit-type-selector/community-library-details.html @@ -1575,10 +1575,6 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.src/app/authoring-tool/import-step/choose-import-step/choose-import-step.component.html 73,77 - - src/app/contact/contact-form/contact-form.component.html - 135,139 - src/app/forgot/student/forgot-student-password-change/forgot-student-password-change.component.html 16,20 @@ -1944,28 +1940,28 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Thank you for contacting WISE! src/app/contact/contact-form/contact-form.component.html - 10,11 + 11,12 Your message has been sent. We will get back to you as soon as possible. src/app/contact/contact-form/contact-form.component.html - 11,14 + 12,15 Return to WISE Home src/app/contact/contact-form/contact-form.component.html - 14,19 + 15,19 Contact WISE src/app/contact/contact-form/contact-form.component.html - 24,26 + 20,22 src/app/forgot/student/forgot-student-password-change/forgot-student-password-change.component.html @@ -2004,7 +2000,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Name src/app/contact/contact-form/contact-form.component.html - 27,28 + 23,24 src/app/modules/library/share-project-dialog/share-project-dialog.component.html @@ -2027,14 +2023,14 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Name required src/app/contact/contact-form/contact-form.component.html - 30,34 + 26,30 Email src/app/contact/contact-form/contact-form.component.html - 36,37 + 33,34 src/app/forgot/teacher/forgot-teacher-username/forgot-teacher-username.component.html @@ -2057,7 +2053,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Email required src/app/contact/contact-form/contact-form.component.html - 39,41 + 36,38 src/app/forgot/teacher/forgot-teacher-username/forgot-teacher-username.component.html @@ -2076,14 +2072,14 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Invalid Email src/app/contact/contact-form/contact-form.component.html - 42,46 + 39,42 Teacher src/app/contact/contact-form/contact-form.component.html - 48,50 + 47,49 src/app/forgot/forgot-home/forgot-home.component.html @@ -2102,35 +2098,35 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Teacher required src/app/contact/contact-form/contact-form.component.html - 55,59 + 56,59 Issue Type src/app/contact/contact-form/contact-form.component.html - 61,63 + 64,66 Issue Type required src/app/contact/contact-form/contact-form.component.html - 68,72 + 73,76 Project Name src/app/contact/contact-form/contact-form.component.html - 74,75 + 80,81 Summary src/app/contact/contact-form/contact-form.component.html - 80,81 + 88,91 src/assets/wise5/components/summary/SummaryInfo.ts @@ -2149,14 +2145,14 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Summary required src/app/contact/contact-form/contact-form.component.html - 83,87 + 97,100 Description src/app/contact/contact-form/contact-form.component.html - 89,92 + 104,107 src/assets/wise5/authoringTool/milestones-authoring/milestones-authoring.component.html @@ -2191,14 +2187,14 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Description required src/app/contact/contact-form/contact-form.component.html - 100,104 + 120,124 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. src/app/contact/contact-form/contact-form.component.html - 105,109 + 126,129 src/app/forgot/student/forgot-student-password-security/forgot-student-password-security.component.html @@ -2225,69 +2221,76 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. Recaptcha failed. Please reload the page and try again! src/app/contact/contact-form/contact-form.component.html - 118,121 + 136,139 Sorry, there was a problem submitting the form. Please try again. src/app/contact/contact-form/contact-form.component.html - 123,127 + 140,144 + + + + Submit + + src/app/contact/contact-form/contact-form.component.html + 155,156 Trouble Signing In src/app/contact/contact-form/contact-form.component.ts - 127 + 130 src/app/contact/contact-form/contact-form.component.ts - 135 + 138 Need Help Using WISE src/app/contact/contact-form/contact-form.component.ts - 128 + 131 src/app/contact/contact-form/contact-form.component.ts - 136 + 139 Problems with a WISE Unit src/app/contact/contact-form/contact-form.component.ts - 129 + 132 src/app/contact/contact-form/contact-form.component.ts - 137 + 140 Feedback to WISE src/app/contact/contact-form/contact-form.component.ts - 130 + 133 src/app/contact/contact-form/contact-form.component.ts - 140 + 144 Other src/app/contact/contact-form/contact-form.component.ts - 131 + 134 src/app/contact/contact-form/contact-form.component.ts - 141 + 145 src/app/domain/profile.constants.ts @@ -2298,7 +2301,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Student Management src/app/contact/contact-form/contact-form.component.ts - 138 + 141 src/app/help/faq/teacher-faq/teacher-faq.component.html @@ -2313,7 +2316,18 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Need Help with Authoring src/app/contact/contact-form/contact-form.component.ts - 139 + 142 + + + + Share Unit + + src/app/contact/contact-form/contact-form.component.ts + 143 + + + src/app/modules/library/share-project-dialog/share-project-dialog.component.html + 1,3 @@ -5838,7 +5852,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/app/modules/library/library-project-details/library-project-details.component.ts - 52 + 54 @@ -5849,7 +5863,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/app/modules/library/library-project-details/library-project-details.component.ts - 50 + 52 @@ -5860,7 +5874,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/app/modules/library/library-project-details/library-project-details.component.ts - 51 + 53 @@ -5983,11 +5997,22 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.191,197 + + Share with Community + + src/app/modules/library/library-project-details/library-project-details.component.html + 202,208 + + + src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html + 4,8 + + Use with Class src/app/modules/library/library-project-details/library-project-details.component.html - 207,212 + 214,219 src/app/teacher/create-run-dialog/create-run-dialog.component.html @@ -5998,7 +6023,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Preview src/app/modules/library/library-project-details/library-project-details.component.html - 213,217 + 220,224 src/app/teacher/run-menu/run-menu.component.html @@ -6033,7 +6058,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.License pertains to original content created by the author(s). Authors are responsible for the usage and attribution of any third-party content linked to or included in this work. src/app/modules/library/library-project-details/library-project-details.component.ts - 44 + 45 @@ -6059,7 +6084,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html - 3,6 + 10,13 src/assets/wise5/classroomMonitor/classroomMonitorComponents/edit-component-annotations/edit-component-annotations.component.html @@ -6330,13 +6355,6 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.153 - - Share Unit - - src/app/modules/library/share-project-dialog/share-project-dialog.component.html - 1,3 - - Sharing a curriculum unit allows other WISE teachers to use it with their own students and optionally edit the unit's content. @@ -12956,35 +12974,35 @@ The branches will be removed but the steps will remain in the unit. Unit Icon src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html - 2,3 + 9,10 This unit does not have a unit icon. src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html - 10,12 + 17,19 Click the edit button to set one. src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html - 11,14 + 18,21 Choose a new Unit Icon by clicking on one below or upload your own custom icon. src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html - 20,22 + 27,29 Upload src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html - 23,28 + 30,35 From e693646f1546b3facf21a5badf7a43758697be43 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Mon, 19 May 2025 23:57:07 -0700 Subject: [PATCH 10/23] Shared units have project name as summary in email subject line --- src/app/contact/contact-form/contact-form.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/contact/contact-form/contact-form.component.ts b/src/app/contact/contact-form/contact-form.component.ts index 390f2dd7115..d5b9af6d742 100644 --- a/src/app/contact/contact-form/contact-form.component.ts +++ b/src/app/contact/contact-form/contact-form.component.ts @@ -181,7 +181,8 @@ export class ContactFormComponent implements OnInit { const email = this.getEmail(); const teacherUsername = this.getTeacherUsername(); const issueType = this.getIssueType(); - const summary = this.getSummary(); + const summary = + this.getControlFieldValue('issueType') === 'SHARE' ? this.projectName : this.getSummary(); const description = this.getDescription(); const runId = this.getRunId(); const projectId = this.getProjectId(); From 8a783078a808e9fdac858584a6c4222e1d2bdab9 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Tue, 20 May 2025 13:23:50 -0700 Subject: [PATCH 11/23] Change share to publish --- .../contact-form/contact-form.component.html | 42 ++++++++++--------- .../contact-form/contact-form.component.ts | 36 +++++++--------- .../library-project-details.component.html | 9 +--- .../library-project-details.component.scss | 9 ---- .../library-project-details.component.ts | 2 - .../library-project-menu.component.html | 5 +++ .../library-project-menu.component.ts | 3 ++ .../project-info-authoring.component.html | 4 +- .../project-info-authoring.component.ts | 4 +- 9 files changed, 51 insertions(+), 63 deletions(-) diff --git a/src/app/contact/contact-form/contact-form.component.html b/src/app/contact/contact-form/contact-form.component.html index 603b13269a3..690732d5584 100644 --- a/src/app/contact/contact-form/contact-form.component.html +++ b/src/app/contact/contact-form/contact-form.component.html @@ -82,23 +82,15 @@

Contact WISE

} - @if (!isShare) { -

- - Summary - - @if (contactFormGroup.controls['summary'].hasError('required')) { - Summary required - } - -

- } +

+ + Summary + + @if (contactFormGroup.controls['summary'].hasError('required')) { + Summary required + } + +

Description @@ -110,7 +102,7 @@

Contact WISE

rows="10" cols="10" [placeholder]=" - isShareIssueType() + isPublishIssueType() ? 'Why do you want to share this unit with the WISE community?' : '' " @@ -141,6 +133,14 @@

Contact WISE

} } + @if (isPublishIssueType()) { +

+ By submitting, you will be sending your unit to WISE to be reviewed. If approved, your + unit will be added to the Community Built library. Make sure you have finished filling + out all appropriate fields on your project's Unit Info page before submitting it for + review. +

+ }

diff --git a/src/app/contact/contact-form/contact-form.component.ts b/src/app/contact/contact-form/contact-form.component.ts index d5b9af6d742..4abe3e2c195 100644 --- a/src/app/contact/contact-form/contact-form.component.ts +++ b/src/app/contact/contact-form/contact-form.component.ts @@ -30,7 +30,7 @@ export class ContactFormComponent implements OnInit { projectId: number; projectName: string; isError: boolean = false; - isShare: boolean = false; + private isPublish: boolean = false; isStudent: boolean = false; isSignedIn: boolean = false; isSendingRequest: boolean = false; @@ -59,8 +59,8 @@ export class ContactFormComponent implements OnInit { this.isRecaptchaEnabled = this.configService.isRecaptchaEnabled(); this.populateFieldsIfSignedIn(); this.populateIssueTypes(); - this.adjustSummaryRequiredOnIssueTypeChange(); - this.setIsShare(); + this.setDefaultPublishSummary(); + this.setIsPublish(); this.setIssueTypeIfNecessary(); } @@ -140,38 +140,33 @@ export class ContactFormComponent implements OnInit { { key: 'PROJECT_PROBLEMS', value: $localize`Problems with a WISE Unit` }, { key: 'STUDENT_MANAGEMENT', value: $localize`Student Management` }, { key: 'AUTHORING', value: $localize`Need Help with Authoring` }, - { key: 'SHARE', value: $localize`Share Unit` }, + { key: 'PUBLISH', value: $localize`Publish Unit to the WISE Community` }, { key: 'FEEDBACK', value: $localize`Feedback to WISE` }, { key: 'OTHER', value: $localize`Other` } ]; } } - private adjustSummaryRequiredOnIssueTypeChange() { + private setDefaultPublishSummary() { this.contactFormGroup.get('issueType').valueChanges.subscribe(() => { - const summaryControl = this.contactFormGroup.get('summary'); - if (this.getControlFieldValue('issueType') === 'SHARE') { - summaryControl.clearValidators(); - summaryControl.updateValueAndValidity(); - this.isShare = true; - } else if (this.isShare) { - summaryControl.addValidators(Validators.required); - this.isShare = false; + if (this.getControlFieldValue('issueType') === 'PUBLISH') { + const summaryControl = this.contactFormGroup.get('summary'); + summaryControl.setValue($localize`Publish my unit to the WISE Community Built library`); } }); } - private setIsShare() { + private setIsPublish() { this.route.queryParams.subscribe((params) => { - this.isShare = params['share']; + this.isPublish = params['publish']; }); } setIssueTypeIfNecessary() { if (this.runId != null) { this.setControlFieldValue('issueType', 'PROJECT_PROBLEMS'); - } else if (this.isShare) { - this.setControlFieldValue('issueType', 'SHARE'); + } else if (this.isPublish) { + this.setControlFieldValue('issueType', 'PUBLISH'); } } @@ -181,8 +176,7 @@ export class ContactFormComponent implements OnInit { const email = this.getEmail(); const teacherUsername = this.getTeacherUsername(); const issueType = this.getIssueType(); - const summary = - this.getControlFieldValue('issueType') === 'SHARE' ? this.projectName : this.getSummary(); + const summary = this.getSummary(); const description = this.getDescription(); const runId = this.getRunId(); const projectId = this.getProjectId(); @@ -294,7 +288,7 @@ export class ContactFormComponent implements OnInit { this.isSendingRequest = value; } - protected isShareIssueType(): boolean { - return this.getControlFieldValue('issueType') === 'SHARE'; + protected isPublishIssueType(): boolean { + return this.getControlFieldValue('issueType') === 'PUBLISH'; } } diff --git a/src/app/modules/library/library-project-details/library-project-details.component.html b/src/app/modules/library/library-project-details/library-project-details.component.html index abb32ad2b67..dbee909a7c0 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.html +++ b/src/app/modules/library/library-project-details/library-project-details.component.html @@ -53,7 +53,7 @@
@if (isTeacher && project.wiseVersion !== 4) { - + }
@@ -206,13 +206,6 @@
- @if (isMyUnit) { - - - - } @if ( isTeacher && !isRunProject && diff --git a/src/app/modules/library/library-project-details/library-project-details.component.scss b/src/app/modules/library/library-project-details/library-project-details.component.scss index b9c5e607105..45e801753d7 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.scss +++ b/src/app/modules/library/library-project-details/library-project-details.component.scss @@ -58,15 +58,6 @@ } } -.share-button { - background-color: #099A09; - color: white; -} - -.share-button > maticon { - color: white; -} - discourse-category-activity, unit-tags { margin-bottom: 12px; display: block; diff --git a/src/app/modules/library/library-project-details/library-project-details.component.ts b/src/app/modules/library/library-project-details/library-project-details.component.ts index ce8c2fb4817..bcd922ef0e7 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.ts +++ b/src/app/modules/library/library-project-details/library-project-details.component.ts @@ -47,7 +47,6 @@ export class LibraryProjectDetailsComponent implements OnInit { protected parentAuthorsString: string = ''; protected parentProject: ParentProject; protected project: Project; - protected shareUnitUrl: string; protected standardLabels: any = { commonCore: $localize`Common Core`, learningForJustice: $localize`Learning For Justice`, @@ -81,7 +80,6 @@ export class LibraryProjectDetailsComponent implements OnInit { ); } this.isMyUnit = this.userIsAuthor(); - this.shareUnitUrl = `${this.configService.getContextPath()}/contact?projectId=${this.project.id}&share=true`; } private userIsAuthor(): boolean { diff --git a/src/app/modules/library/library-project-menu/library-project-menu.component.html b/src/app/modules/library/library-project-menu/library-project-menu.component.html index 8d58a75a13f..9d1fce40347 100644 --- a/src/app/modules/library/library-project-menu/library-project-menu.component.html +++ b/src/app/modules/library/library-project-menu/library-project-menu.component.html @@ -20,6 +20,11 @@ share Share } + @if (isMyUnit) { + + public Publish + + } @if (archived) { unarchive diff --git a/src/app/modules/library/library-project-menu/library-project-menu.component.ts b/src/app/modules/library/library-project-menu/library-project-menu.component.ts index 1e485f1d8a5..723cbd41343 100644 --- a/src/app/modules/library/library-project-menu/library-project-menu.component.ts +++ b/src/app/modules/library/library-project-menu/library-project-menu.component.ts @@ -24,8 +24,10 @@ export class LibraryProjectMenuComponent { protected canEdit: boolean; protected canShare: boolean; protected isChild: boolean; + @Input() isMyUnit: boolean; @Input() isRun: boolean; @Input() project: Project; + protected publishUnitUrl: string; constructor( private archiveProjectService: ArchiveProjectService, @@ -40,6 +42,7 @@ export class LibraryProjectMenuComponent { this.canShare = this.isOwner() && !this.isRun; this.isChild = this.project.isChild(); this.archived = this.project.hasTagWithText('archived'); + this.publishUnitUrl = `${this.configService.getContextPath()}/contact?projectId=${this.project.id}&publish=true`; } private isOwner(): boolean { diff --git a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html index ebbbaccb185..c9dcdefedc8 100644 --- a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html +++ b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html @@ -1,7 +1,7 @@ @if (isMyUnit) { } diff --git a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts index ae635b9c0fa..de0d2dd642d 100644 --- a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts +++ b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts @@ -23,7 +23,7 @@ export class ProjectInfoAuthoringComponent { metadataChanged: Subject = new Subject(); projectIcon: string = ''; projectIcons: any = []; - protected shareUnitUrl; + protected publishUnitUrl; constructor( private configService: ConfigService, @@ -47,7 +47,7 @@ export class ProjectInfoAuthoringComponent { (author) => author.id === this.userService.getUserId() ); this.isMyUnit = userAuthor !== undefined; - this.shareUnitUrl = `${this.configService.getContextPath()}/contact?projectId=${this.configService.getRunId()}&share=true`; + this.publishUnitUrl = `${this.configService.getContextPath()}/contact?projectId=${this.configService.getRunId()}&publish=true`; this.loadProjectIcon(); this.processMetadata(); this.metadataChanged.pipe(debounceTime(1000)).subscribe(() => { From 90cb7799dfa0ac537bf8faf8ca86afa680242102 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Tue, 20 May 2025 14:28:05 -0700 Subject: [PATCH 12/23] Code improvement --- .../library-project-details.component.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/modules/library/library-project-details/library-project-details.component.ts b/src/app/modules/library/library-project-details/library-project-details.component.ts index bcd922ef0e7..e0b2cfc13b5 100644 --- a/src/app/modules/library/library-project-details/library-project-details.component.ts +++ b/src/app/modules/library/library-project-details/library-project-details.component.ts @@ -83,9 +83,8 @@ export class LibraryProjectDetailsComponent implements OnInit { } private userIsAuthor(): boolean { - return ( - this.project.metadata.authors.find((author) => author.id === this.userService.getUserId()) !== - undefined + return this.project.metadata.authors.some( + (author) => author.id === this.userService.getUserId() ); } From a94bc6e0fd4b85770c3d1586190ceaf1486bf10e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 20 May 2025 21:32:16 +0000 Subject: [PATCH 13/23] Updated messages --- src/messages.xlf | 82 ++++++++++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 34 deletions(-) diff --git a/src/messages.xlf b/src/messages.xlf index dde0e56785c..53755c51a13 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -283,7 +283,7 @@ src/app/modules/library/library-project-details/library-project-details.component.html - 208,211 + 208,212 src/app/modules/library/public-unit-type-selector/community-library-details.html @@ -1575,6 +1575,10 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.src/app/authoring-tool/import-step/choose-import-step/choose-import-step.component.html 73,77 + + src/app/contact/contact-form/contact-form.component.html + 158,162 + src/app/forgot/student/forgot-student-password-change/forgot-student-password-change.component.html 16,20 @@ -2126,7 +2130,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Summary src/app/contact/contact-form/contact-form.component.html - 88,91 + 87,88 src/assets/wise5/components/summary/SummaryInfo.ts @@ -2145,14 +2149,14 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Summary required src/app/contact/contact-form/contact-form.component.html - 97,100 + 90,94 Description src/app/contact/contact-form/contact-form.component.html - 104,107 + 96,99 src/assets/wise5/authoringTool/milestones-authoring/milestones-authoring.component.html @@ -2187,14 +2191,14 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Description required src/app/contact/contact-form/contact-form.component.html - 120,124 + 112,116 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. src/app/contact/contact-form/contact-form.component.html - 126,129 + 118,121 src/app/forgot/student/forgot-student-password-security/forgot-student-password-security.component.html @@ -2221,21 +2225,21 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. Recaptcha failed. Please reload the page and try again! src/app/contact/contact-form/contact-form.component.html - 136,139 + 128,131 Sorry, there was a problem submitting the form. Please try again. src/app/contact/contact-form/contact-form.component.html - 140,144 + 132,136 - - Submit + + Submit for Review src/app/contact/contact-form/contact-form.component.html - 155,156 + 156,158 @@ -2319,15 +2323,18 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.142 - - Share Unit + + Publish Unit to the WISE Community src/app/contact/contact-form/contact-form.component.ts 143 + + + Publish my unit to the WISE Community Built library - src/app/modules/library/share-project-dialog/share-project-dialog.component.html - 1,3 + src/app/contact/contact-form/contact-form.component.ts + 154 @@ -5859,7 +5866,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/app/modules/library/library-project-details/library-project-details.component.ts - 54 + 53 @@ -5870,7 +5877,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/app/modules/library/library-project-details/library-project-details.component.ts - 52 + 51 @@ -5881,7 +5888,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/app/modules/library/library-project-details/library-project-details.component.ts - 53 + 52 @@ -6032,22 +6039,11 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.201,207 - - Share with Community - - src/app/modules/library/library-project-details/library-project-details.component.html - 212,218 - - - src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html - 4,8 - - Use with Class src/app/modules/library/library-project-details/library-project-details.component.html - 224,229 + 217,222 src/app/teacher/create-run-dialog/create-run-dialog.component.html @@ -6058,7 +6054,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Preview src/app/modules/library/library-project-details/library-project-details.component.html - 232,234 + 225,227 src/app/teacher/run-menu/run-menu.component.html @@ -6093,7 +6089,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Unit Resources src/app/modules/library/library-project-details/library-project-details.component.html - 234,239 + 227,232 @@ -6144,11 +6140,22 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.20,24 + + Publish + + src/app/modules/library/library-project-menu/library-project-menu.component.html + 25,29 + + + src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html + 4,8 + + Restore src/app/modules/library/library-project-menu/library-project-menu.component.html - 26,29 + 31,34 src/app/notebook/notebook-report/notebook-report.component.html @@ -6167,7 +6174,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Archive src/app/modules/library/library-project-menu/library-project-menu.component.html - 31,36 + 36,41 src/app/teacher/archive-projects-button/archive-projects-button.component.html @@ -6397,6 +6404,13 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.153 + + Share Unit + + src/app/modules/library/share-project-dialog/share-project-dialog.component.html + 1,3 + + Sharing a curriculum unit allows other WISE teachers to use it with their own students and optionally edit the unit's content. From 40aa28bf449b08b4630d077b75bf3d8117617839 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Tue, 20 May 2025 15:26:43 -0700 Subject: [PATCH 14/23] Remove fdescribe --- .../project-info-authoring.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.spec.ts b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.spec.ts index 4790161f92a..01004012520 100644 --- a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.spec.ts +++ b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.spec.ts @@ -10,7 +10,7 @@ import { EditUnitTypeComponent } from '../edit-unit-type/edit-unit-type.componen import { MockProvider } from 'ng-mocks'; import { UserService } from '../../../../app/services/user.service'; -fdescribe('ProjectInfoAuthoringComponent', () => { +describe('ProjectInfoAuthoringComponent', () => { let component: ProjectInfoAuthoringComponent; let fixture: ComponentFixture; From 57f905e4a8f75eb46ab5982b598c7d5409dea6ae Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Wed, 21 May 2025 08:40:08 -0700 Subject: [PATCH 15/23] Fixed unit info publish link --- .../project-info-authoring.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html index c9dcdefedc8..d867b627f1c 100644 --- a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html +++ b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html @@ -1,5 +1,5 @@ @if (isMyUnit) { -

Contact Us! + publicly share your custom unit? Head to the Authoring Tool, select your unit, go to the Unit + Info page, and click Publish!

*Please note: While WISE staff have reviewed these units, we cannot specifically vouch for From d27c7e62596506cbda833dcc82a66ceeae9df759 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Wed, 21 May 2025 08:45:36 -0700 Subject: [PATCH 17/23] Fixed undefined projectId when publishing from unit info --- .../project-info-authoring/project-info-authoring.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts index de0d2dd642d..c4fc8c15d16 100644 --- a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts +++ b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts @@ -47,7 +47,7 @@ export class ProjectInfoAuthoringComponent { (author) => author.id === this.userService.getUserId() ); this.isMyUnit = userAuthor !== undefined; - this.publishUnitUrl = `${this.configService.getContextPath()}/contact?projectId=${this.configService.getRunId()}&publish=true`; + this.publishUnitUrl = `${this.configService.getContextPath()}/contact?projectId=${this.configService.getProjectId()}&publish=true`; this.loadProjectIcon(); this.processMetadata(); this.metadataChanged.pipe(debounceTime(1000)).subscribe(() => { From c961d212fb10788629e424ad47b93b9e3d84cb08 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 21 May 2025 15:50:28 +0000 Subject: [PATCH 18/23] Updated messages --- src/messages.xlf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/messages.xlf b/src/messages.xlf index 53755c51a13..6a23909916f 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -6320,11 +6320,11 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.12,14 - - "Community Built" units are designed and contributed by WISE community members. Want to publicly share your custom unit? Contact Us! + + "Community Built" units are designed and contributed by WISE community members. Want to publicly share your custom unit? Head to the Authoring Tool, select your unit, go to the Unit Info page, and click Publish! src/app/modules/library/public-unit-type-selector/community-library-details.html - 5,9 + 5,10 From 28ae3987eaa05d4b87d782a000e929a414b59ca2 Mon Sep 17 00:00:00 2001 From: Aaron Detre Date: Wed, 21 May 2025 09:25:50 -0700 Subject: [PATCH 19/23] Refactor contact form --- .../contact-form/contact-form.component.ts | 160 ++++++------------ 1 file changed, 55 insertions(+), 105 deletions(-) diff --git a/src/app/contact/contact-form/contact-form.component.ts b/src/app/contact/contact-form/contact-form.component.ts index 4abe3e2c195..5e9bf27ca5d 100644 --- a/src/app/contact/contact-form/contact-form.component.ts +++ b/src/app/contact/contact-form/contact-form.component.ts @@ -1,43 +1,43 @@ +import { ActivatedRoute } from '@angular/router'; import { Component, OnInit, ViewEncapsulation } from '@angular/core'; -import { FormControl, FormGroup, Validators, FormBuilder } from '@angular/forms'; -import { ActivatedRoute, Router } from '@angular/router'; -import { finalize } from 'rxjs/operators'; -import { UserService } from '../../services/user.service'; -import { Teacher } from '../../domain/teacher'; -import { Student } from '../../domain/student'; import { ConfigService } from '../../services/config.service'; -import { StudentService } from '../../student/student.service'; +import { finalize } from 'rxjs/operators'; +import { FormControl, FormGroup, Validators, FormBuilder } from '@angular/forms'; import { LibraryService } from '../../services/library.service'; import { ReCaptchaV3Service } from 'ng-recaptcha-2'; +import { Student } from '../../domain/student'; +import { StudentService } from '../../student/student.service'; import { Subscription, lastValueFrom } from 'rxjs'; +import { Teacher } from '../../domain/teacher'; +import { UserService } from '../../services/user.service'; @Component({ + encapsulation: ViewEncapsulation.None, selector: 'app-contact-form', - templateUrl: './contact-form.component.html', + standalone: false, styleUrls: ['./contact-form.component.scss'], - encapsulation: ViewEncapsulation.None, - standalone: false + templateUrl: './contact-form.component.html' }) export class ContactFormComponent implements OnInit { - issueTypes: object[] = []; - contactFormGroup: FormGroup = this.fb.group({ + protected complete: boolean = false; + protected contactFormGroup: FormGroup = this.fb.group({ name: new FormControl('', [Validators.required]), issueType: new FormControl('', [Validators.required]), summary: new FormControl('', [Validators.required]), description: new FormControl('', [Validators.required]) }); - runId: number; - projectId: number; - projectName: string; - isError: boolean = false; + protected isError: boolean = false; + protected isSendingRequest: boolean = false; + private isSignedIn: boolean = false; + protected isStudent: boolean = false; + protected issueTypes: object[] = []; private isPublish: boolean = false; - isStudent: boolean = false; - isSignedIn: boolean = false; - isSendingRequest: boolean = false; - isRecaptchaEnabled: boolean = false; - isRecaptchaError: boolean = false; - teachers: any[] = []; - complete: boolean = false; + protected isRecaptchaEnabled: boolean = false; + protected isRecaptchaError: boolean = false; + private projectId: number; + protected projectName: string; + private runId: number; + protected teachers: any[] = []; constructor( private fb: FormBuilder, @@ -46,11 +46,10 @@ export class ContactFormComponent implements OnInit { private studentService: StudentService, private libraryService: LibraryService, private recaptchaV3Service: ReCaptchaV3Service, - private route: ActivatedRoute, - private router: Router + private route: ActivatedRoute ) {} - ngOnInit() { + ngOnInit(): void { this.isSignedIn = this.userService.isSignedIn(); this.isStudent = this.userService.isStudent(); this.obtainRunIdOrProjectIdIfNecessary(); @@ -64,7 +63,7 @@ export class ContactFormComponent implements OnInit { this.setIssueTypeIfNecessary(); } - obtainRunIdOrProjectIdIfNecessary() { + private obtainRunIdOrProjectIdIfNecessary(): void { this.route.queryParams.subscribe((params) => { this.runId = params['runId']; this.projectId = params['projectId']; @@ -81,7 +80,7 @@ export class ContactFormComponent implements OnInit { }); } - obtainTeacherListIfNecessary() { + private obtainTeacherListIfNecessary(): void { if (this.isStudent && this.runId == null && this.projectId == null) { this.studentService.getTeacherList().subscribe((teacherList) => { this.teachers = teacherList; @@ -93,7 +92,7 @@ export class ContactFormComponent implements OnInit { } } - studentHasTeacher() { + private studentHasTeacher(): boolean { return this.teachers.length > 0; } @@ -108,7 +107,7 @@ export class ContactFormComponent implements OnInit { } } - populateFieldsIfSignedIn() { + private populateFieldsIfSignedIn(): void { if (this.isSignedIn) { if (this.isStudent) { const user = this.userService.getUser().getValue(); @@ -124,7 +123,7 @@ export class ContactFormComponent implements OnInit { } } - populateIssueTypes() { + private populateIssueTypes(): void { if (this.isStudent) { this.issueTypes = [ { key: 'TROUBLE_LOGGING_IN', value: $localize`Trouble Signing In` }, @@ -147,7 +146,7 @@ export class ContactFormComponent implements OnInit { } } - private setDefaultPublishSummary() { + private setDefaultPublishSummary(): void { this.contactFormGroup.get('issueType').valueChanges.subscribe(() => { if (this.getControlFieldValue('issueType') === 'PUBLISH') { const summaryControl = this.contactFormGroup.get('summary'); @@ -156,13 +155,7 @@ export class ContactFormComponent implements OnInit { }); } - private setIsPublish() { - this.route.queryParams.subscribe((params) => { - this.isPublish = params['publish']; - }); - } - - setIssueTypeIfNecessary() { + private setIssueTypeIfNecessary(): void { if (this.runId != null) { this.setControlFieldValue('issueType', 'PROJECT_PROBLEMS'); } else if (this.isPublish) { @@ -170,30 +163,27 @@ export class ContactFormComponent implements OnInit { } } + private setIsPublish(): void { + this.route.queryParams.subscribe((params) => { + this.isPublish = params['publish']; + }); + } + async submit(): Promise { this.isError = false; - const name = this.getName(); - const email = this.getEmail(); - const teacherUsername = this.getTeacherUsername(); - const issueType = this.getIssueType(); - const summary = this.getSummary(); - const description = this.getDescription(); - const runId = this.getRunId(); - const projectId = this.getProjectId(); - const userAgent = this.getUserAgent(); const recaptchaResponse = await this.getRecaptchaResponse(); this.setIsSendingRequest(true); return this.userService .sendContactMessage( - name, - email, - teacherUsername, - issueType, - summary, - description, - runId, - projectId, - userAgent, + this.getControlFieldValue('name'), + this.getControlFieldValueOrNull('email', !this.isStudent), + this.getControlFieldValueOrNull('teacher', this.isStudent && this.studentHasTeacher()), + this.getControlFieldValue('issueType'), + this.getControlFieldValue('summary'), + this.getControlFieldValue('description'), + this.runId, + this.projectId, + this.getUserAgent(), recaptchaResponse ) .pipe( @@ -206,7 +196,7 @@ export class ContactFormComponent implements OnInit { }); } - handleSendContactMessageResponse(response: any) { + private handleSendContactMessageResponse(response: any): void { if (response.status === 'success') { this.complete = true; } else if (response.status === 'error') { @@ -218,73 +208,33 @@ export class ContactFormComponent implements OnInit { this.setIsSendingRequest(false); } - setControlFieldValue(name: string, value: string) { + setControlFieldValue(name: string, value: string): void { this.contactFormGroup.controls[name].setValue(value); } - markControlFieldAsDisabled(name: string) { + private markControlFieldAsDisabled(name: string): void { this.contactFormGroup.controls[name].disable(); } - getControlFieldValue(fieldName) { + private getControlFieldValue(fieldName: string): any { return this.contactFormGroup.get(fieldName).value; } - getName() { - return this.getControlFieldValue('name'); - } - - getEmail() { - let email = null; - if (!this.isStudent) { - email = this.getControlFieldValue('email'); - } - return email; - } - - getIssueType() { - return this.getControlFieldValue('issueType'); - } - - getSummary() { - return this.getControlFieldValue('summary'); - } - - getDescription() { - return this.getControlFieldValue('description'); + private getControlFieldValueOrNull(fieldName: string, condition: boolean): any { + return condition ? this.getControlFieldValue(fieldName) : null; } - getRunId() { - return this.runId; - } - - getProjectId() { - return this.projectId; - } - - getTeacherUsername() { - if (this.isStudent && this.studentHasTeacher()) { - return this.getControlFieldValue('teacher'); - } else { - return null; - } - } - - getUserAgent() { + private getUserAgent(): string { return navigator.userAgent; } - routeToContactCompletePage() { - this.router.navigate(['contact/complete', {}]); - } - private async getRecaptchaResponse(): Promise { return this.configService.isRecaptchaEnabled() ? await lastValueFrom(this.recaptchaV3Service.execute('importantAction')) : ''; } - setIsSendingRequest(value: boolean) { + private setIsSendingRequest(value: boolean): void { this.isSendingRequest = value; } From 567c06f5349ca5ee9ca5c2a93bbe2a6281ff0ff8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 21 May 2025 16:30:42 +0000 Subject: [PATCH 20/23] Updated messages --- src/messages.xlf | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/messages.xlf b/src/messages.xlf index 6a23909916f..276747aa51a 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -2246,55 +2246,55 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Trouble Signing In src/app/contact/contact-form/contact-form.component.ts - 130 + 129 src/app/contact/contact-form/contact-form.component.ts - 138 + 137 Need Help Using WISE src/app/contact/contact-form/contact-form.component.ts - 131 + 130 src/app/contact/contact-form/contact-form.component.ts - 139 + 138 Problems with a WISE Unit src/app/contact/contact-form/contact-form.component.ts - 132 + 131 src/app/contact/contact-form/contact-form.component.ts - 140 + 139 Feedback to WISE src/app/contact/contact-form/contact-form.component.ts - 133 + 132 src/app/contact/contact-form/contact-form.component.ts - 144 + 143 Other src/app/contact/contact-form/contact-form.component.ts - 134 + 133 src/app/contact/contact-form/contact-form.component.ts - 145 + 144 src/app/domain/profile.constants.ts @@ -2305,7 +2305,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Student Management src/app/contact/contact-form/contact-form.component.ts - 141 + 140 src/app/help/faq/teacher-faq/teacher-faq.component.html @@ -2320,21 +2320,21 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Need Help with Authoring src/app/contact/contact-form/contact-form.component.ts - 142 + 141 Publish Unit to the WISE Community src/app/contact/contact-form/contact-form.component.ts - 143 + 142 Publish my unit to the WISE Community Built library src/app/contact/contact-form/contact-form.component.ts - 154 + 153 From 40502e07bb00cd73456f7c2d33c28fc76d6b18ae Mon Sep 17 00:00:00 2001 From: Jonathan Lim-Breitbart Date: Wed, 21 May 2025 18:40:53 -0700 Subject: [PATCH 21/23] Update some text and minor styling --- .../contact-form/contact-form.component.html | 15 +++++++-------- .../contact-form/contact-form.component.ts | 2 +- .../community-library-details.html | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/app/contact/contact-form/contact-form.component.html b/src/app/contact/contact-form/contact-form.component.html index 690732d5584..e1d2a57350a 100644 --- a/src/app/contact/contact-form/contact-form.component.html +++ b/src/app/contact/contact-form/contact-form.component.html @@ -120,9 +120,7 @@

Contact WISE

Terms of Service apply.

} - @if (!isError) { -
 
- } @else { + @if (isError) { @if (isRecaptchaEnabled && isRecaptchaError) {

Recaptcha failed. Please reload the page and try again! @@ -134,12 +132,13 @@

Contact WISE

} } @if (isPublishIssueType()) { -

- By submitting, you will be sending your unit to WISE to be reviewed. If approved, your - unit will be added to the Community Built library. Make sure you have finished filling - out all appropriate fields on your project's Unit Info page before submitting it for - review. +

+ By submitting, you will be sending your unit to be reviewed. If approved, it will be + added to the Community Built library. Make sure you have filled out all appropriate + fields in the Unit Info page in the authoring tool. We will be in touch if we require + any more information.

+

Thank you!

}