Skip to content

Commit

Permalink
Merge pull request #2748 from creative-commoners/pulls/4.11/hide-redi…
Browse files Browse the repository at this point in the history
…rector-file

FIX Hide uploadfield in redirector page by default
  • Loading branch information
kinglozzer authored Jul 8, 2022
2 parents 1897cb3 + 4d679ab commit aee45aa
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions client/src/legacy/RedirectorPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ $.entwine('ss', function ($) {
if ($(this).attr('value') == 'Internal') {
$('#Form_EditForm_ExternalURL_Holder').hide();
$('#Form_EditForm_LinkToID_Holder').show();
$('#Form_EditForm_LinkToFileID_Holder').hide();
$('#Form_EditForm_LinkToFile_Holder').hide();
} else if ($(this).attr('value') == 'External') {
$('#Form_EditForm_ExternalURL_Holder').show();
$('#Form_EditForm_LinkToID_Holder').hide();
$('#Form_EditForm_LinkToFileID_Holder').hide();
$('#Form_EditForm_LinkToFile_Holder').hide();
} else {
$('#Form_EditForm_LinkToFileID_Holder').show();
$('#Form_EditForm_LinkToFile_Holder').show();
$('#Form_EditForm_ExternalURL_Holder').hide();
$('#Form_EditForm_LinkToID_Holder').hide();
}
Expand Down
40 changes: 40 additions & 0 deletions tests/behat/features/redirector-page.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@gsat
Feature: Redirector Pages
As an author
I want to redirect to a different location
So that I can help users find specific content

Background:
Given a "page" "Page 1"
And a "page" "My Redirect" which redirects to a "page" "Page 1"
And a "image" "assets/file1.jpg"
And I am logged in with "ADMIN" permissions
And I go to "/admin/pages"

Scenario: Only the appropriate fields are shown
When I click on "My Redirect" in the tree
Then I should see an edit page form
# distinct from the "A page on your website" text for the option itself
And I should see "Page on your website" in the "#Form_EditForm_LinkToID_Holder" region
And I should not see "Choose existing"
And I should not see "Other website URL"

Scenario: I can choose to redirect to a file
When I click on "My Redirect" in the tree
Then I should see an edit page form
When I click on the "#Form_EditForm_RedirectionType_File" element
Then I should see "Choose existing"
And I should not see "Page on your website" in the "#Form_EditForm_LinkToID_Holder" region
And I should not see "Other website URL"
# Necessary to avoid a "unsaved changed" alert from breaking the test
Given I press the "Save" button

Scenario: I can choose to redirect to a URL
When I click on "My Redirect" in the tree
Then I should see an edit page form
When I click on the "#Form_EditForm_RedirectionType_External" element
Then I should see "Other website URL"
And I should not see "Page on your website" in the "#Form_EditForm_LinkToID_Holder" region
And I should not see "Choose existing"
# Necessary to avoid a "unsaved changed" alert from breaking the test
Given I press the "Save" button

0 comments on commit aee45aa

Please sign in to comment.