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

Add link to delete all run from the main paginated list page #239

Merged
merged 7 commits into from
May 29, 2018

Conversation

dumityty
Copy link
Contributor

@dumityty dumityty commented May 8, 2018

Added a link next to the 'search' button to delete all runs as the only other way to truncate the whole profiles database was to go into mongo and drop the database.

Works pretty much like the individual run deletion functionality but it uses the truncate function to drop everything.

@@ -124,6 +124,21 @@ public function delete()
$this->app->redirect($redirect);
}

public function delete_all()
Copy link
Contributor

Choose a reason for hiding this comment

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

Method name "Xhgui_Controller_Run::delete_all" is not in camel caps format

@@ -124,6 +124,21 @@ public function delete()
$this->app->redirect($redirect);
}

public function delete_all()
{
$request = $this->app->request();
Copy link
Contributor

Choose a reason for hiding this comment

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

Line indented incorrectly; expected at least 8 spaces, found 6

$request = $this->app->request();

// Delete all profile runs.
$delete = $this->profiles->truncate();
Copy link
Contributor

Choose a reason for hiding this comment

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

Line indented incorrectly; expected at least 8 spaces, found 6

// Delete all profile runs.
$delete = $this->profiles->truncate();

$this->app->flash('success', 'Deleted all profiles');
Copy link
Contributor

Choose a reason for hiding this comment

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

Line indented incorrectly; expected at least 8 spaces, found 6


$this->app->flash('success', 'Deleted all profiles');

$referrer = $request->getReferrer();
Copy link
Contributor

Choose a reason for hiding this comment

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

Line indented incorrectly; expected at least 8 spaces, found 6

$this->app->expects($this->once())
->method('redirect');

$result = $this->profiles->getAll();
Copy link
Contributor

Choose a reason for hiding this comment

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

Line indented incorrectly; expected at least 8 spaces, found 6

->method('redirect');

$result = $this->profiles->getAll();
$this->assertCount(5, $result['results']);
Copy link
Contributor

Choose a reason for hiding this comment

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

Line indented incorrectly; expected at least 8 spaces, found 6

$result = $this->profiles->getAll();
$this->assertCount(5, $result['results']);

$this->runs->delete_all();
Copy link
Contributor

Choose a reason for hiding this comment

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

Line indented incorrectly; expected at least 8 spaces, found 6


$this->runs->delete_all();

$result = $this->profiles->getAll();
Copy link
Contributor

Choose a reason for hiding this comment

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

Line indented incorrectly; expected at least 8 spaces, found 6

$this->runs->delete_all();

$result = $this->profiles->getAll();
$this->assertCount(0, $result['results']);
Copy link
Contributor

Choose a reason for hiding this comment

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

Line indented incorrectly; expected at least 8 spaces, found 6

@markstory markstory self-assigned this May 9, 2018
@markstory markstory merged commit b9abf78 into perftools:master May 29, 2018
@glensc glensc mentioned this pull request Jun 19, 2020
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.

3 participants