-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH Pre-render the LinkField in entwine (#241)
* ENH Pre-render the LinkField in entwine * MNT Correct disabled link Jest test * ENH Move versioned states to a constant * ENH Use global Spinner template * MNT Revert test change for aria-disabled
- Loading branch information
Maxime Rainville
authored
Mar 12, 2024
1 parent
af81ef7
commit 967c457
Showing
12 changed files
with
133 additions
and
23 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const versionStates = { | ||
draft: 'draft', | ||
modified: 'modified', | ||
unversioned: 'unversioned', | ||
unsaved: 'unsaved', | ||
published: 'published', | ||
}; | ||
|
||
export default versionStates; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
<%-- This template is here to bootstrap a LinkField React form field --%> | ||
<%-- It includes some pre-rendered content to provide a nicer UI while waiting for React to boot --%> | ||
<%-- Once React is done pre-rendering, it will discard the pre-rendered markup --%> | ||
<input $AttributesHTML /> | ||
<div data-field-id="$ID" data-schema-component="$SchemaComponent" class="entwine-linkfield" data-types="$TypesProp"></div> | ||
<div data-field-id="$ID" data-schema-component="$SchemaComponent" class="entwine-linkfield" data-types="$TypesProp"> | ||
<div class="link-field__container"> | ||
<% include SilverStripe/LinkField/Form/LinkField_Spinner %> | ||
<div> | ||
<div class="link-picker__link link-picker__link--is-first link-picker__link--is-last form-control link-picker__link--disabled link-picker__link--published" role="button" aria-disabled="false" aria-roledescription="sortable" aria-describedby="" id="link-picker__link-42"> | ||
<button type="button" disabled="" class="link-picker__button font-icon-link btn btn-secondary disabled"></button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<%-- This template is here to bootstrap a LinkField React form field --%> | ||
<%-- It includes a pre-rendered spinner to provide a nicer UI while waiting for React to boot --%> | ||
<%-- Once React is done pre-rendering, it will discard the pre-rendered markup --%> | ||
<div class="link-field__loading"> | ||
<div class="cms-content-loading-overlay ui-widget-overlay-light"></div> | ||
<% include SilverStripe/Admin/Includes/CMSLoadingSpinner %> | ||
</div> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,35 @@ | ||
<%-- This template is here to bootstrap a MultiLinkField React form field --%> | ||
<%-- It includes some pre-rendered content to provide a nicer UI while waiting for React to boot --%> | ||
<%-- Once React is done pre-rendering, it will discard the pre-rendered markup --%> | ||
<input $AttributesHTML /> | ||
<div data-is-multi="true" data-field-id="$ID" data-schema-component="$SchemaComponent" class="entwine-linkfield" data-types="$TypesProp"></div> | ||
<div data-is-multi="true" data-field-id="$ID" data-schema-component="$SchemaComponent" class="entwine-linkfield" data-types="$TypesProp"> | ||
|
||
<div class="link-field__container"> | ||
<% include SilverStripe/LinkField/Form/LinkField_Spinner %> | ||
<div class="link-picker form-control"> | ||
<div class="link-picker__menu dropdown"> | ||
<button | ||
type="button" | ||
aria-haspopup="true" | ||
aria-expanded="false" | ||
class="link-picker__menu-toggle font-icon-plus-1 dropdown-toggle btn btn-secondary" | ||
aria-label="<%t SilverStripe\LinkField\Models\MultiLinkField.AddLink "Add link" %>"> | ||
<%t SilverStripe\LinkField\Models\MultiLinkField.AddLink "Add link" %> | ||
</button> | ||
</div> | ||
</div> | ||
<div class="link-picker-links"> | ||
<% loop $LinkIDs %> | ||
<div class="link-picker__link form-control link-picker__link--published <% if $IsFirst %>link-picker__link--is-first<% end_if %> <% if $IsLast %>link-picker__link--is-last<% end_if %>"> | ||
<button | ||
type="button" | ||
disabled="" | ||
class="link-picker__button font-icon-link btn btn-secondary disabled" | ||
aria-label="<%t SilverStripe\LinkField\Models\MultiLinkField.EditLink "Edit link" %>"></button> | ||
</div> | ||
<% end_loop %> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters