From 74a46e73ead236a8c97327e3a6f442b0d8e655dc Mon Sep 17 00:00:00 2001 From: Jonathan Lim-Breitbart Date: Fri, 23 May 2025 12:02:37 -0700 Subject: [PATCH 1/3] fix(Library): Remove archive option for public units --- .../library-project-menu.component.html | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) 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 9d1fce40347..e64c03978c8 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 @@ -25,16 +25,18 @@ public Publish } - @if (archived) { - - unarchive - Restore - - } @else { - - archive - Archive - + @if (!project.metadata.publicUnitType) { + @if (archived) { + + unarchive + Restore + + } @else { + + archive + Archive + + } } From b1ca9c0523959b3764154ccd992dc0ef9097f268 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 23 May 2025 19:18:07 +0000 Subject: [PATCH 2/3] Updated messages --- src/messages.xlf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/messages.xlf b/src/messages.xlf index 8ae9115b4aa..58154926332 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -6158,7 +6158,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Publish src/app/modules/library/library-project-menu/library-project-menu.component.html - 25,29 + 25,28 src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.html @@ -6169,7 +6169,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.Restore src/app/modules/library/library-project-menu/library-project-menu.component.html - 31,34 + 32,35 src/app/notebook/notebook-report/notebook-report.component.html @@ -6188,7 +6188,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 - 36,41 + 37,43 src/app/teacher/archive-projects-button/archive-projects-button.component.html From 870688b44cc717f6f757b3b7e16f167a16d2ce67 Mon Sep 17 00:00:00 2001 From: Jonathan Lim-Breitbart Date: Wed, 28 May 2025 14:51:49 -0700 Subject: [PATCH 3/3] Remove fdescribe; fix and update tests --- .../library-project-menu.component.spec.ts | 15 +++++++++++++++ .../match-summary-display.component.spec.ts | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/app/modules/library/library-project-menu/library-project-menu.component.spec.ts b/src/app/modules/library/library-project-menu/library-project-menu.component.spec.ts index eaf95840398..9fb9d30f4f7 100644 --- a/src/app/modules/library/library-project-menu/library-project-menu.component.spec.ts +++ b/src/app/modules/library/library-project-menu/library-project-menu.component.spec.ts @@ -38,6 +38,7 @@ describe('LibraryProjectMenuComponent', () => { user.displayName = 'Spongebob Squarepants'; project.owner = user; project.tags = []; + project.metadata = { publicUnitType: null }; component.project = project; fixture.detectChanges(); harness = await TestbedHarnessEnvironment.harnessForFixture(fixture, LibraryProjectMenuHarness); @@ -45,6 +46,7 @@ describe('LibraryProjectMenuComponent', () => { showsArchiveButton(); showsRestoreButton(); + hideArchiveAndRestoreButtons(); }); function showsArchiveButton() { @@ -66,3 +68,16 @@ function showsRestoreButton() { }); }); } + +function hideArchiveAndRestoreButtons() { + describe('project is public', () => { + beforeEach(() => { + component.project.metadata.publicUnitType = 'wiseTested'; + component.ngOnInit(); + }); + it('does not show archive or restore buttons', async () => { + expect(await harness.hasRestoreMenuButton()).toBe(false); + expect(await harness.hasArchiveMenuButton()).toBe(false); + }); + }); +} diff --git a/src/assets/wise5/directives/teacher-summary-display/match-summary-display/match-summary-display.component.spec.ts b/src/assets/wise5/directives/teacher-summary-display/match-summary-display/match-summary-display.component.spec.ts index c4b6076954a..869530c4cc5 100644 --- a/src/assets/wise5/directives/teacher-summary-display/match-summary-display/match-summary-display.component.spec.ts +++ b/src/assets/wise5/directives/teacher-summary-display/match-summary-display/match-summary-display.component.spec.ts @@ -8,7 +8,7 @@ import { SummaryService } from '../../../components/summary/summaryService'; import { TeacherDataService } from '../../../services/teacherDataService'; import { TeacherProjectService } from '../../../services/teacherProjectService'; -fdescribe('MatchSummaryDisplayComponent', () => { +describe('MatchSummaryDisplayComponent', () => { let component: MatchSummaryDisplayComponent; let fixture: ComponentFixture;