Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(activate/deactivate project): subscribe to the observable #1261

Conversation

domsteinbach
Copy link
Contributor

Need to subscribe to the observable to trigger the request, otherwise it will not be sent. The observable is lazy. Fix also for activating the project.

resolves DEV-2931

…ger the response

Need to subscribe to trigger the request, otherwise it will not be sent. The request is lazy. Fix also for activating the project.
Copy link

linear bot commented Nov 14, 2023

DEV-2931 Deactivate project functionality in your account does not work anymore

  1. Go to you account
  2. Navigate to my projects
  3. Click on the 3 dots
  4. Click on Deactivate Project

Expected result :

Project gets marked as deactivated and does not show up im my Projects anymore

Actual Result:

Nothing happens - Project stays active

Bildschirmaufnahme 2023-11-13 um 13.41.24.mov

@domsteinbach domsteinbach marked this pull request as ready for review November 14, 2023 12:41
@@ -168,6 +171,7 @@ export class ProjectsListComponent implements OnInit {
const dialogRef = this._dialog.open(DialogComponent, dialogConfig);

dialogRef.afterClosed().subscribe((response) => {
console.log('Dialog was closed', response);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course

@@ -195,18 +199,16 @@ export class ProjectsListComponent implements OnInit {
const uuid = this._projectService.iriToUuid(id);
// the deleteProject() method in js-lib sets the project's status to false, it is not actually deleted

this._dspApiConnection.admin.projectsEndpoint
this.deactivateSubscription = this._dspApiConnection.admin.projectsEndpoint
.deleteProject(id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of creating subscription use .pipe(take(1)), then you dont need to unsubscribe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. thanks.

@domsteinbach domsteinbach merged commit 92431d4 into main Nov 14, 2023
13 checks passed
@domsteinbach domsteinbach deleted the feature/dev-2931-deactivate-project-functionality-in-your-account-does-not branch November 14, 2023 14:08
irmastnt added a commit that referenced this pull request Nov 16, 2023
…return-true-observables-that-also

* main:
  chore(main): release 11.1.3 (#1268)
  fix(date-picker): date-picker doesn't show in advanced search (#1267)
  chore(main): release 11.1.2 (#1265)
  fix(results): go back to search form button fix (#1266)
  fix(advanced-search): undefined error leads to blank page (#1264)
  chore(main): release 11.1.1 (#1263)
  fix(results): user unable to execute second fulltext search (#1262)
  fix(activate/deactivate project): subscribe to the observable (#1261)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants