Skip to content

Commit

Permalink
holy moly lets hope this works (hyperledger-archives#2452)
Browse files Browse the repository at this point in the history
Signed-off-by: samwinslet <[email protected]>
  • Loading branch information
winslet authored Oct 24, 2017
1 parent e8e9c17 commit 539d76b
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 84 deletions.
2 changes: 1 addition & 1 deletion packages/composer-playground/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { AppComponent } from './app.component';
import { APP_RESOLVER_PROVIDERS } from './app.resolver';
import { AppState, InternalStateType } from './app.service';
import { AboutComponent } from './about';
import { BasicModalsModule } from './basic-modals/basic-models.module';
import { BasicModalsModule } from './basic-modals/basic-modals.module';
import { WelcomeComponent } from './welcome';
import { NoContentComponent } from './no-content';
import { VersionCheckComponent } from './version-check';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { CommonModule } from '@angular/common';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';

import { BusyComponent } from './busy/busy.component';
import { ConfirmComponent } from './confirm/confirm.component';
import { DeleteComponent } from './delete-confirm/delete-confirm.component';
import { ErrorComponent } from './error/error.component';
import { ReplaceComponent } from './replace-confirm/replace-confirm.component';
Expand All @@ -13,10 +12,10 @@ import { TestModule } from './../test/test.module';

@NgModule({
imports: [CommonModule, NgbModule, TestModule],
entryComponents: [BusyComponent, ConfirmComponent, DeleteComponent, ErrorComponent, ReplaceComponent, SuccessComponent],
declarations: [BusyComponent, ConfirmComponent, DeleteComponent, ErrorComponent, ReplaceComponent, SuccessComponent],
entryComponents: [BusyComponent, DeleteComponent, ErrorComponent, ReplaceComponent, SuccessComponent],
declarations: [BusyComponent, DeleteComponent, ErrorComponent, ReplaceComponent, SuccessComponent],
providers: [AlertService],
exports: [BusyComponent, ConfirmComponent, DeleteComponent, ErrorComponent, ReplaceComponent, SuccessComponent]
exports: [BusyComponent, DeleteComponent, ErrorComponent, ReplaceComponent, SuccessComponent]
})

export class BasicModalsModule {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ describe(`RegistryComponent`, () => {
tick();
tick();
component.loadResources.should.be.called;
mockNgbModalRef.componentInstance.confirmMessage.should.equal('Please confirm that you want to delete Asset: ' + mockResource.getIdentifier());
mockNgbModalRef.componentInstance.deleteMessage.should.equal('This action will be recorded in the Historian, and cannot be reversed. Are you sure you want to delete?');
}));

it('should create a new error with the alert service', fakeAsync(() => {
Expand All @@ -325,7 +325,6 @@ describe(`RegistryComponent`, () => {
component.openDeleteResourceModal(mockResource);
tick();
tick();
mockNgbModalRef.componentInstance.confirmMessage.should.equal('Please confirm that you want to delete Asset: ' + mockResource.getIdentifier());
mockAlertService.errorStatus$.next.should.be.called;
mockAlertService.errorStatus$.next.should.be
.calledWith('Removing the selected item from the registry failed:error message');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { ClientService } from '../../services/client.service';
import { AlertService } from '../../basic-modals/alert.service';
import { ResourceComponent } from '../resource/resource.component';
import { ConfirmComponent } from '../../basic-modals/confirm/confirm.component';
import { DeleteComponent } from '../../basic-modals/delete-confirm/delete-confirm.component';
import { ViewTransactionComponent } from '../view-transaction/view-transaction.component';

@Component({
Expand Down Expand Up @@ -108,9 +108,12 @@ export class RegistryComponent {
}

openDeleteResourceModal(resource: any) {
const confirmModalRef = this.modalService.open(ConfirmComponent);
confirmModalRef.componentInstance.confirmMessage = 'Please confirm that you want to delete Asset: ' + resource.getIdentifier();

const confirmModalRef = this.modalService.open(DeleteComponent);
confirmModalRef.componentInstance.headerMessage = 'Delete Asset/Participant';
confirmModalRef.componentInstance.deleteMessage = 'This action will be recorded in the Historian, and cannot be reversed. Are you sure you want to delete?';
confirmModalRef.componentInstance.fileType = resource.$type;
confirmModalRef.componentInstance.fileName = resource.getIdentifier();
confirmModalRef.componentInstance.action = 'delete';
confirmModalRef.result.then((result) => {
if (result) {
this._registry.remove(resource)
Expand All @@ -125,6 +128,7 @@ export class RegistryComponent {
} else {
// TODO: we should always get called with a code for this usage of the
// modal but will that always be true

}
});
}
Expand Down

0 comments on commit 539d76b

Please sign in to comment.