forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from sedici/ticket#10970
10970-Agrego opciones para default workflow
- Loading branch information
Showing
6 changed files
with
98 additions
and
6 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...med-task/sedici-approve-not-select/claimed-task-actions-approve_not_select.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<button type="button" | ||
[className]="'btn btn-success'" | ||
ngbTooltip="{{'submission.workflow.tasks.claimed.approve_help' | translate}}" | ||
[disabled]="processing$ | async" | ||
(click)="submitTask()"> | ||
<span *ngIf="processing$ | async"><i class='fas fa-circle-notch fa-spin'></i> {{'submission.workflow.tasks.generic.processing' | translate}}</span> | ||
<span *ngIf="(processing$ | async) !== true"><i class="fa fa-thumbs-up"></i> {{'submission.workflow.tasks.claimed.approve_not_select' | translate}}</span> | ||
</button> |
Empty file.
75 changes: 75 additions & 0 deletions
75
...aimed-task/sedici-approve-not-select/claimed-task-actions-approve_not_select.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { | ||
AsyncPipe, | ||
NgIf, | ||
} from '@angular/common'; | ||
import { | ||
Component, | ||
Injector, | ||
} from '@angular/core'; | ||
import { Router } from '@angular/router'; | ||
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; | ||
import { | ||
TranslateModule, | ||
TranslateService, | ||
} from '@ngx-translate/core'; | ||
import { | ||
Observable, | ||
of, | ||
} from 'rxjs'; | ||
|
||
import { RemoteData } from '../../../../core/data/remote-data'; | ||
import { RequestService } from '../../../../core/data/request.service'; | ||
import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; | ||
import { SearchService } from '../../../../core/shared/search/search.service'; | ||
import { WorkflowItemDataService } from '../../../../core/submission/workflowitem-data.service'; | ||
import { NotificationsService } from '../../../notifications/notifications.service'; | ||
import { ClaimedApprovedTaskSearchResult } from '../../../object-collection/shared/claimed-approved-task-search-result.model'; | ||
import { ClaimedTaskActionsAbstractComponent } from '../abstract/claimed-task-actions-abstract.component'; | ||
|
||
export const WORKFLOW_TASK_OPTION_APPROVE_NOT_SELECT = 'submit_approve_not_select'; | ||
|
||
@Component({ | ||
selector: 'ds-claimed-task-actions-approve_not_select', | ||
styleUrls: ['./claimed-task-actions-approve_not_select.component.scss'], | ||
templateUrl: './claimed-task-actions-approve_not_select.component.html', | ||
standalone: true, | ||
imports: [NgbTooltipModule, NgIf, AsyncPipe, TranslateModule], | ||
}) | ||
/** | ||
* Component for displaying and processing the approve action on a workflow task item | ||
*/ | ||
export class ClaimedTaskActionsApproveNotSelectComponent extends ClaimedTaskActionsAbstractComponent { | ||
|
||
constructor( | ||
protected injector: Injector, | ||
protected router: Router, | ||
protected notificationsService: NotificationsService, | ||
protected translate: TranslateService, | ||
protected searchService: SearchService, | ||
protected requestService: RequestService, | ||
protected workflowItemDataService: WorkflowItemDataService, | ||
) { | ||
super(injector, router, notificationsService, translate, searchService, requestService); | ||
} | ||
|
||
reloadObjectExecution(): Observable<RemoteData<DSpaceObject> | DSpaceObject> { | ||
return of(this.object); | ||
} | ||
|
||
convertReloadedObject(dso: DSpaceObject): DSpaceObject { | ||
const reloadedObject = Object.assign(new ClaimedApprovedTaskSearchResult(), dso, { | ||
indexableObject: dso, | ||
}); | ||
return reloadedObject; | ||
} | ||
|
||
public handleReloadableActionResponse(result: boolean, dso: DSpaceObject): void { | ||
super.handleReloadableActionResponse(result, dso); | ||
|
||
// Item page version table includes labels for workflow Items, determined | ||
// based on the result of /workflowitems/search/item?uuid=... | ||
// In order for this label to be in sync with the workflow state, we should | ||
// invalidate WFIs as they are approved. | ||
this.workflowItemDataService.invalidateByHref(this.object?._links.workflowitem?.href); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters