Skip to content

Commit

Permalink
Reorder questions to match data order
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 24, 2022
1 parent 3dba236 commit 72c9b25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function safeHandle(): int

$this->fields = $this->captureFieldsDefinitions();

[$sortField, $sortAscending, $pageSize, $prevNextLinks] = ($this->getPaginationSettings());
[$sortField, $sortAscending, $prevNextLinks, $pageSize] = ($this->getPaginationSettings());

$canonicalField = $this->getCanonicalField();

Expand Down Expand Up @@ -172,7 +172,7 @@ protected function getPaginationSettings(): array
return [null, null, null, null];
}

return [$this->getSortField(), $this->getSortDirection(), $this->getPageSize(), $this->getPrevNextLinks()];
return [$this->getSortField(), $this->getSortDirection(), $this->getPrevNextLinks(), $this->getPageSize()];
}

protected function getSortField(): string
Expand All @@ -187,6 +187,11 @@ protected function getSortDirection(): bool
return $options[$this->choice('Choose the default sort direction', array_keys($options), 'Ascending')];
}

protected function getPrevNextLinks(): bool
{
return $this->confirm('Generate previous/next links in detail view?', true);
}

protected function getPageSize(): int
{
return (int) $this->askWithValidation('pageSize',
Expand All @@ -196,11 +201,6 @@ protected function getPageSize(): int
);
}

protected function getPrevNextLinks(): bool
{
return $this->confirm('Generate previous/next links in detail view?', true);
}

protected function getCount(int $offset = 0): int
{
return $this->fields->count() + $offset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public function test_command_creates_publication_type()
'Ascending',
'Descending',
])
->expectsQuestion('Enter the page size (0 for no limit)', 10)
->expectsConfirmation('Generate previous/next links in detail view?', 'yes')
->expectsQuestion('Enter the page size (0 for no limit)', 10)
->expectsChoice('Choose a canonical name field (this will be used to generate filenames, so the values need to be unique)', 'publication-title', [
'__createdAt',
'publication-title',
Expand Down

0 comments on commit 72c9b25

Please sign in to comment.