Skip to content

Commit 39d1fc2

Browse files
authored
Merge pull request DSpace#2068 from atmire/w2p-97184_theme-feedback_contribute-main
Refactor badges
2 parents 959f826 + 6c7da1c commit 39d1fc2

141 files changed

Lines changed: 992 additions & 423 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/app/admin/admin-search-page/admin-search-results/admin-search-result-grid-element/item-search-result/item-admin-search-result-grid-element.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-
1919
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
2020
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
2121
import { AccessStatusDataService } from '../../../../../core/data/access-status-data.service';
22-
import { AccessStatusObject } from '../../../../../shared/object-list/access-status-badge/access-status.model';
22+
import { AccessStatusObject } from '../../../../../shared/object-collection/shared/badges/access-status-badge/access-status.model';
2323
import { AuthService } from '../../../../../core/auth/auth.service';
2424
import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub';
2525
import { FileService } from '../../../../../core/shared/file.service';

src/app/admin/admin-search-page/admin-search-results/admin-search-result-list-element/item-search-result/item-admin-search-result-list-element.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
[viewMode]="viewModes.ListElement"
33
[index]="index"
44
[linkType]="linkType"
5-
[listID]="listID"
6-
[hideBadges]="true"></ds-listable-object-component-loader>
5+
[listID]="listID"></ds-listable-object-component-loader>
76
<ds-item-admin-search-result-actions-element [item]="dso" [small]="false"></ds-item-admin-search-result-actions-element>

src/app/core/core.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ import { SubmissionAccessesModel } from './config/models/config-submission-acces
160160
import { RatingAdvancedWorkflowInfo } from './tasks/models/rating-advanced-workflow-info.model';
161161
import { AdvancedWorkflowInfo } from './tasks/models/advanced-workflow-info.model';
162162
import { SelectReviewerAdvancedWorkflowInfo } from './tasks/models/select-reviewer-advanced-workflow-info.model';
163-
import { AccessStatusObject } from '../shared/object-list/access-status-badge/access-status.model';
163+
import { AccessStatusObject } from '../shared/object-collection/shared/badges/access-status-badge/access-status.model';
164164
import { AccessStatusDataService } from './data/access-status-data.service';
165165
import { LinkHeadService } from './services/link-head.service';
166166
import { ResearcherProfileDataService } from './profile/researcher-profile-data.service';

src/app/core/data/access-status-data.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv
33
import { ObjectCacheService } from '../cache/object-cache.service';
44
import { HALEndpointService } from '../shared/hal-endpoint.service';
55
import { RequestService } from './request.service';
6-
import { AccessStatusObject } from 'src/app/shared/object-list/access-status-badge/access-status.model';
7-
import { ACCESS_STATUS } from 'src/app/shared/object-list/access-status-badge/access-status.resource-type';
6+
import { AccessStatusObject } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model';
7+
import { ACCESS_STATUS } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.resource-type';
88
import { Observable } from 'rxjs';
99
import { RemoteData } from './remote-data';
1010
import { Item } from '../shared/item.model';

src/app/core/shared/context.model.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,38 @@
33
*/
44

55
export enum Context {
6+
/** Default context */
67
Any = 'undefined',
8+
9+
/** General item page context */
710
ItemPage = 'itemPage',
11+
12+
/** General search page context */
813
Search = 'search',
14+
915
Workflow = 'workflow',
1016
Workspace = 'workspace',
1117
SupervisedItems = 'supervisedWorkspace',
18+
19+
/** Administrative menu context */
1220
AdminMenu = 'adminMenu',
21+
1322
EntitySearchModalWithNameVariants = 'EntitySearchModalWithNameVariants',
1423
EntitySearchModal = 'EntitySearchModal',
24+
25+
/** Administrative search page context */
1526
AdminSearch = 'adminSearch',
1627
AdminWorkflowSearch = 'adminWorkflowSearch',
28+
1729
SideBarSearchModal = 'sideBarSearchModal',
1830
SideBarSearchModalCurrent = 'sideBarSearchModalCurrent',
31+
32+
/** The MyDSpace* Context values below are used for badge display in MyDSpace. */
33+
MyDSpaceArchived = 'mydspaceArchived',
34+
MyDSpaceWorkspace = 'mydspaceWorkspace',
35+
MyDSpaceWorkflow = 'mydspaceWorkflow',
36+
MyDSpaceDeclined = 'mydspaceDeclined',
37+
MyDSpaceApproved = 'mydspaceApproved',
38+
MyDSpaceWaitingController = 'mydspaceWaitingController',
39+
MyDSpaceValidation = 'mydspaceValidation',
1940
}

src/app/core/shared/item.model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import { Version } from './version.model';
2121
import { VERSION } from './version.resource-type';
2222
import { BITSTREAM } from './bitstream.resource-type';
2323
import { Bitstream } from './bitstream.model';
24-
import { ACCESS_STATUS } from 'src/app/shared/object-list/access-status-badge/access-status.resource-type';
25-
import { AccessStatusObject } from 'src/app/shared/object-list/access-status-badge/access-status.model';
24+
import { ACCESS_STATUS } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.resource-type';
25+
import { AccessStatusObject } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model';
2626
import { HandleObject } from './handle-object.model';
2727
import { IDENTIFIERS } from '../../shared/object-list/identifier-data/identifier-data.resource-type';
2828
import { IdentifierData } from '../../shared/object-list/identifier-data/identifier-data.model';

src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[dsDebounce]="300" (onDebounce)="confirm.emit(false)"></textarea>
88
<div class="d-flex" *ngIf="mdRepresentation">
99
<a class="mr-2" target="_blank" [routerLink]="mdRepresentationItemRoute$ | async">{{ mdRepresentationName$ | async }}</a>
10-
<ds-type-badge [object]="mdRepresentation"></ds-type-badge>
10+
<ds-themed-type-badge [object]="mdRepresentation"></ds-themed-type-badge>
1111
</div>
1212
</div>
1313
<div class="ds-flex-cell ds-lang-cell" role="cell">

src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe('DsoEditMetadataValueComponent', () => {
6868
});
6969

7070
it('should not show a badge', () => {
71-
expect(fixture.debugElement.query(By.css('ds-type-badge'))).toBeNull();
71+
expect(fixture.debugElement.query(By.css('ds-themed-type-badge'))).toBeNull();
7272
});
7373

7474
describe('when no changes have been made', () => {
@@ -134,7 +134,7 @@ describe('DsoEditMetadataValueComponent', () => {
134134
});
135135

136136
it('should show a badge', () => {
137-
expect(fixture.debugElement.query(By.css('ds-type-badge'))).toBeTruthy();
137+
expect(fixture.debugElement.query(By.css('ds-themed-type-badge'))).toBeTruthy();
138138
});
139139

140140
assertButton(EDIT_BTN, true, true);

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</div>
2020
</span>
2121
<div class="card-body">
22-
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
22+
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
2323
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
2424
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
2525
</ds-truncatable-part>

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</div>
2020
</span>
2121
<div class="card-body">
22-
<ds-type-badge *ngIf="showLabel" [object]="dso"></ds-type-badge>
22+
<ds-themed-badges *ngIf="showLabel" [object]="dso" [context]="context"></ds-themed-badges>
2323
<ds-truncatable-part [id]="dso.id" [minLines]="3" type="h4">
2424
<h4 class="card-title" [innerHTML]="dsoTitle"></h4>
2525
</ds-truncatable-part>

0 commit comments

Comments
 (0)