-
-
Notifications
You must be signed in to change notification settings - Fork 638
[6.x] Multisite - entry grouping #15241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jaygeorge
wants to merge
40
commits into
6.x
Choose a base branch
from
multisite-entry-grouping
base: 6.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
aa2c5b3
Add site grouping with new sectioned grid UI
jaygeorge ab32844
Opus review
jaygeorge 2a3cf0a
When we initially "add groups" and no groups exist, we should go stra…
jaygeorge a0f9301
when you click Add site it should focus on the new row
jaygeorge 57adc40
Also do that for the "other" group
jaygeorge 9e4530d
Closing the Add Group stack without saving now removes the leftover N…
jaygeorge 9a53917
Draft
jaygeorge 26b85d9
Improve editing positions
jaygeorge cb66b09
Merge branch 'multisite-site-grouping-configuration' into multisite-e…
jaygeorge a90e3ba
Put other at the bottom
jaygeorge 19f1bd6
Fix entry grouping dropdown width
jaygeorge 2643032
Replace / with >
jaygeorge da214cb
Fix grouped Working In Combobox layout and search
jaygeorge c0c391e
Fiddle with aesthetics
jaygeorge 324f86b
Fix subheading also being highlighted with the active item
jaygeorge f785992
Balance separator spacing
jaygeorge f2669c8
Smooth Working In selection when switching groups
jaygeorge d6dbc08
Add a custom scrollbar to the combobox so there's no confusion about …
jaygeorge fa56d9b
Change the border radius to compensate for custom scrollbar
jaygeorge e05acae
Add group to global site headr
jaygeorge a80af87
Merge branch '6.x' into multisite-entry-grouping
jaygeorge 167e9f3
Add the group structure to the combobox when the "Create Localization…
jaygeorge 07aa1fe
"Create Localization" > Add the status dot to make things clearer
jaygeorge 79c54bb
Prefer a group origin when creating a localization
jaygeorge ff05248
Follow the group origin when it moves out of the group
jaygeorge 7c5e0c3
Show group headers in the collection configuration too
jaygeorge 74143cd
Collection Configuration > show headers in selected items too
jaygeorge 2f2920e
Show groups in the global site header
jaygeorge f69d511
Tweak spacing of groups
jaygeorge 85e2355
Add grouping to globals
jaygeorge d2c1903
Show group in the selected global origin combobox
jaygeorge d383a7e
For "Add sites" grid button, Only auto-focus on Configure Sites secti…
jaygeorge 6bff4eb
Fix multisite grouping review issues
jaygeorge 206df14
Add grouping to the globals selector too
jaygeorge 36de321
Make the globals selector wider to accommodate grouping
jaygeorge 097f868
Escape literal dots in slug field path regex
jaygeorge d84fe8f
Import Statamic trans helper in SitesController
jaygeorge 2bf8174
Fix site grouping PHPUnit failures
jaygeorge e9838be
Merge branch '6.x' into multisite-entry-grouping
jaygeorge 93710be
Do not translate user-defined site group names
jaygeorge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,23 +1,69 @@ | ||
| <script setup> | ||
| import { Select } from '@/components/ui'; | ||
| import { computed } from 'vue'; | ||
| import { Icon, Select, Subheading } from '@/components/ui'; | ||
| import { | ||
| flatOptionsFromSiteGroups, | ||
| groupItemsBySiteGroup, | ||
| hasNamedSiteGroups, | ||
| selectedSiteGroupLabel, | ||
| } from '@/util/site-groups.js'; | ||
|
|
||
| defineProps({ | ||
| const props = defineProps({ | ||
| sites: { type: Array, required: true }, | ||
| modelValue: { type: String, required: true }, | ||
| }); | ||
|
|
||
| defineEmits(['update:modelValue']); | ||
|
|
||
| const hasNamedGroups = computed(() => hasNamedSiteGroups(props.sites)); | ||
|
|
||
| const options = computed(() => { | ||
| if (!hasNamedGroups.value) { | ||
| return props.sites; | ||
| } | ||
|
|
||
| return flatOptionsFromSiteGroups(groupItemsBySiteGroup(props.sites)); | ||
| }); | ||
|
|
||
| function groupLabel(option) { | ||
| return selectedSiteGroupLabel(option, hasNamedGroups.value); | ||
| } | ||
| </script> | ||
|
|
||
| <template> | ||
| <Select | ||
| class="w-36" | ||
| :options="sites" | ||
| class="w-60" | ||
| :options="options" | ||
| option-label="name" | ||
| option-value="handle" | ||
| align="end" | ||
| :adaptive-width="true" | ||
| :virtualize="!hasNamedGroups" | ||
| :model-value="modelValue" | ||
| @update:model-value="$emit('update:modelValue', $event)" | ||
| /> | ||
| > | ||
| <template #selected-option="{ option }"> | ||
| <span v-if="option" class="flex min-w-0 items-center gap-1.5"> | ||
| <template v-if="groupLabel(option)"> | ||
| <span class="truncate">{{ groupLabel(option) }}</span> | ||
| <Icon name="chevron-right" class="size-3.5! shrink-0 text-gray-700 dark:text-white/70" aria-hidden="true" /> | ||
| </template> | ||
| <span class="truncate">{{ __(option.name) }}</span> | ||
| </span> | ||
| </template> | ||
|
|
||
| <template v-if="hasNamedGroups" #before-option="option"> | ||
| <div | ||
| v-if="option._showGroupSeparator" | ||
| class="mx-2 mb-2.25 mt-0.75 border-t border-gray-200 dark:border-gray-700" | ||
| role="separator" | ||
| /> | ||
| <Subheading | ||
| v-if="option._groupLabel" | ||
| size="sm" | ||
| class="px-2.5 pb-1 pt-1.5 font-semibold uppercase tracking-wide text-gray-950 text-2xs dark:text-gray-300" | ||
| :text="option._groupLabel" | ||
| /> | ||
| </template> | ||
| </Select> | ||
| </template> |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.