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 + + } } 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; 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