generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ASSETS-88888 : Add 'Select All' button on Collections Details and Sha…
…re Link Page (#40) * Added Select All checkbox to adp-collection-header block component /blocks/adp-infinite-results-collection/adp-infinite-results-collection.js : Added the functions selectAllAsets() and deselectAllAssets() which is used in adp-collection-header.js * Initial checkin of new block component adp-share-header that will contain the Select All Items button * Added block component adp-share-header which has the Select All check box /blocks/adp-infinite-results-linkshare/adp-infinite-results-linkshare.js : Added the functions selectAllAssets() and deselectAllAssets() * Removed redundant CSS * Pull Request Review Changes /blocks/adp-collection-header/adp-collection-header.css : Removed Todo comment /blocks/adp-collection-header/adp-collection-header.js : Changed back to await deleteCollection(collectionId, collection.title); /blocks/adp-share-header/adp-share-header.css: Removed redundant CSS classes * Removed the confirm-dialog.js this was in the original code copied from the adp-collections-header.js * Added logic to un check the select-all-checkbox on event CLOSE_BANNER and Remove Item from Multi Select * /blocks/adp-collection-header/adp-collection-header.js => Added , to import statement and refactored select-all-checkbox event listener /blocks/adp-share-header/adp-share-header.js => Removed extra div, refactored select-all-checkbox event listener
- Loading branch information
Showing
8 changed files
with
153 additions
and
2 deletions.
There are no files selected for viewing
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
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,55 @@ | ||
|
||
.adp-share-header { | ||
display: flex; | ||
height: 62px; | ||
} | ||
|
||
.adp-share-header-left { | ||
display: flex; | ||
gap: 15px; | ||
align-items: center; | ||
width: 100%; | ||
font-size: var(--header-font-size); | ||
padding: 0; | ||
top: 0.01rem; | ||
padding-top: 0.88rem; | ||
padding-bottom: 0.88rem; | ||
z-index: 1; | ||
} | ||
|
||
.adp-share-subinfo { | ||
display: flex; | ||
/* justify-content: space-between; /* Aligns items to the left and select all to the right */ | ||
align-items: center; /* Centers items vertically */ | ||
} | ||
|
||
.adp-share-select-all { | ||
display: flex; | ||
align-items: center; /* This will vertically align the checkbox and label */ | ||
} | ||
|
||
.adp-share-select-all input[type="checkbox"] { | ||
margin-right: 5px; /* Adds some space between the checkbox and the label */ | ||
} | ||
|
||
.adp-share-header-share-info { | ||
display: flex; | ||
flex-direction: column; /* Stack the title and sub-info vertically */ | ||
} | ||
|
||
.adp-share-header { | ||
font: var(--collection-heading-font); | ||
width: 100%; | ||
} | ||
|
||
.adp-share-header .actions .adp-action { | ||
text-wrap: nowrap; | ||
align-items: center; | ||
} | ||
|
||
.adp-share-header .actions { | ||
/* vertically align center */ | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} |
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,34 @@ | ||
import { decorateIcons } from '../../scripts/lib-franklin.js'; | ||
import { createLinkHref, navigateTo } from '../../scripts/scripts.js'; | ||
|
||
import { | ||
selectAllAssets, deselectAllAssets | ||
} from '../adp-infinite-results-linkshare/adp-infinite-results-linkshare.js'; | ||
|
||
function createShareInfoHeader(shareInfoHeader) { | ||
|
||
shareInfoHeader.innerHTML = ` | ||
<div class="adp-share-header-left"> | ||
<div class="adp-share-header-share-info"> | ||
<div class="adp-share-subinfo"> | ||
<div class="adp-share-select-all"> | ||
<input type="checkbox" id="select-all-checkbox"/> | ||
<label for="select-all-checkbox">Select All</label> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
|
||
document.getElementById('select-all-checkbox').addEventListener('click', (event) => { | ||
event.target.checked ? selectAllAssets() : deselectAllAssets(); | ||
}); | ||
|
||
decorateIcons(shareInfoHeader); | ||
return shareInfoHeader; | ||
} | ||
|
||
export default async function decorate(block) { | ||
block.innerHTML = ''; | ||
createShareInfoHeader(block); | ||
} |