Skip to content

Commit c293982

Browse files
committed
ENH Update text for "add link" button to "add new link"
1 parent 4b607fe commit c293982

9 files changed

Lines changed: 13 additions & 11 deletions

File tree

client/dist/js/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/lang/en.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') {
77
} else {
88
ss.i18n.addDictionary('en', {
99
"LinkField.ADD_LINK": "Add link",
10+
"LinkField.ADD_NEW_LINK": "Add new link",
1011
"LinkField.ARCHIVE": "Archive",
1112
"LinkField.ARCHIVE_CONFIRM": "Are you sure you want to archive this link?",
1213
"LinkField.ARCHIVE_ERROR": "Failed to archive link",
@@ -29,4 +30,4 @@ if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') {
2930
"LinkField.SORT_ERROR": "Unable to sort links",
3031
"LinkField.SORT_SUCCESS": "Updated link sort order"
3132
});
32-
}
33+
}

client/lang/src/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"LinkField.ADD_LINK": "Add link",
3+
"LinkField.ADD_NEW_LINK": "Add new link",
34
"LinkField.ARCHIVE": "Archive",
45
"LinkField.ARCHIVE_CONFIRM": "Are you sure you want to archive this link?",
56
"LinkField.ARCHIVE_ERROR": "Failed to archive link",
@@ -21,4 +22,4 @@
2122
"LinkField.SAVE_SUCCESS": "Saved link",
2223
"LinkField.SORT_ERROR": "Unable to sort links",
2324
"LinkField.SORT_SUCCESS": "Updated link sort order"
24-
}
25+
}

client/src/components/LinkField/tests/LinkField-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ test('LinkField can handle a string "0" value', async () => {
9090
value: '0'
9191
})}
9292
/>);
93-
await screen.findByText('Add Link');
93+
await screen.findByText('Add new Link');
9494
expect(container.querySelectorAll('.link-picker')).toHaveLength(1);
9595
});
9696

client/src/components/LinkPicker/LinkPickerMenu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const LinkPickerMenu = ({ types, onSelect, dropdownToggleRef }) => {
1010
const [isOpen, setIsOpen] = useState(false);
1111
const toggle = () => setIsOpen(prevState => !prevState);
1212
const { loading } = useContext(LinkFieldContext);
13-
const ariaLabel = i18n._t('LinkField.ADD_LINK', 'Add link');
13+
const ariaLabel = i18n._t('LinkField.ADD_NEW_LINK', 'Add new link');
1414

1515
return <Dropdown
1616
disabled={loading}
@@ -25,7 +25,7 @@ const LinkPickerMenu = ({ types, onSelect, dropdownToggleRef }) => {
2525
aria-label={ariaLabel}
2626
innerRef={dropdownToggleRef}
2727
>
28-
{i18n._t('LinkField.ADD_LINK', 'Add Link')}
28+
{i18n._t('LinkField.ADD_NEW_LINK', 'Add new Link')}
2929
</DropdownToggle>
3030
<DropdownMenu>
3131
{types.map(({key, title, icon, allowed}) => {

client/src/components/LinkPicker/tests/LinkPicker-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test('LinkPickerMenu render() should display toggle if can create', () => {
2525
<LinkPicker {...makeProps({ canCreate: true })} />
2626
</LinkFieldContext.Provider>);
2727
expect(container.querySelectorAll('.link-picker__menu-toggle')).toHaveLength(1);
28-
expect(container.querySelector('.link-picker__menu-toggle')).toHaveTextContent('Add Link');
28+
expect(container.querySelector('.link-picker__menu-toggle')).toHaveTextContent('Add new Link');
2929
expect(container.querySelectorAll('.link-picker__cannot-create')).toHaveLength(0);
3030
});
3131

docs/en/userguide/02_work_with_link_field.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The following examples below illustrate the appearance of a link field and modal
3333

3434
![A screenshot of the single link field](./_images/single_link_field.png)
3535

36-
The single link field is designed for managing individual links. To create a new link, you can click on the "Add link" button and select the desired link type from the dropdown menu. This action opens a modal window where you can input the necessary information for creating the link. For detailed information about the default link types, please refer to the ["Link types"](./01_links_types.md) section.
36+
The single link field is designed for managing individual links. To create a new link, you can click on the "Add new link" button and select the desired link type from the dropdown menu. This action opens a modal window where you can input the necessary information for creating the link. For detailed information about the default link types, please refer to the ["Link types"](./01_links_types.md) section.
3737

3838
## Multi link field
3939

templates/SilverStripe/LinkField/Form/MultiLinkField.ss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
aria-haspopup="true"
1414
aria-expanded="false"
1515
class="link-picker__menu-toggle dropdown-toggle btn btn-secondary"
16-
aria-label="<%t SilverStripe\LinkField\Models\MultiLinkField.AddLink "Add link" %>">
16+
aria-label="<%t SilverStripe\LinkField\Models\MultiLinkField.AddNewLink "Add new link" %>">
1717
<span class="font-icon-plus-1" aria-hidden="true"></span>
18-
<%t SilverStripe\LinkField\Models\MultiLinkField.AddLink "Add link" %>
18+
<%t SilverStripe\LinkField\Models\MultiLinkField.AddNewLink "Add new link" %>
1919
</button>
2020
</div>
2121
</div>

tests/behat/features/linkfield-in-elemental.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ I want to be able to work with LinkField and MultiLinkField in Elemental Block
1515
And I click on "Link Blocks Page" in the tree
1616

1717
Scenario: I can create link blocks page
18-
Given I press the "Add block" button
18+
Given I press the "Add new block" button
1919
# There are few buttons on the page with 'Content' text
2020
Then I click on the ".font-icon-block-content" element
2121
Then I should see "Untitled Content block" in the ".element-editor__element" element

0 commit comments

Comments
 (0)