Skip to content
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

Change role dropdown #8882

Merged
merged 15 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/enhancement-share-dropdown-layout
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Layout of Share role and expiration date dropdown

We changed the layout of the share role/permsission dropdown and
expiration date select button to make them more visible and distinctive

https://github.com/owncloud/web/pull/8882
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="oc-filter-chip oc-flex">
<oc-button
:id="id"
class="oc-filter-chip-button"
class="oc-filter-chip-button oc-pill"
:class="{ 'oc-filter-chip-button-selected': filterActive }"
appearance="raw"
>
Expand Down Expand Up @@ -77,7 +77,6 @@ export default defineComponent({
background-color: var(--oc-color-background-default) !important;
color: var(--oc-color-text-muted) !important;
border: 1px solid var(--oc-color-text-muted);
border-radius: 99px !important;
box-sizing: border-box;
display: inline-flex;
gap: var(--oc-space-xsmall);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ export default defineComponent({
&__selected-options > *:not(input) {
color: var(--oc-color-input-text-default);
background-color: var(--oc-color-background-default);
padding: 2px;
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions packages/design-system/src/styles/theme/background.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
background-color: var(--oc-color-swatch-brand-default) !important;
}

.oc-background-default {
background-color: var(--oc-color-background-default) !important;
}

/* stylelint-disable */
.oc-background-primary-gradient {
@include oc-background-primary-gradient;
Expand Down
43 changes: 25 additions & 18 deletions packages/design-system/src/styles/theme/helper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,33 @@ hr {
text-align: inherit;
}

.oc-rounded {
border-radius: 5px;
}
// Classes for border radius
.oc {
&-rounded {
border-radius: 5px;
}

.oc-rounded-top {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
&-rounded-top {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}

.oc-rounded-bottom {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
&-rounded-bottom {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}

.oc-rounded-left {
border-bottom-left-radius: 5px;
border-top-left-radius: 5px;
}
&-rounded-left {
border-bottom-left-radius: 5px;
border-top-left-radius: 5px;
}

.oc-rounded-right {
border-bottom-right-radius: 5px;
border-top-right-radius: 5px;
&-rounded-right {
border-bottom-right-radius: 5px;
border-top-right-radius: 5px;
}

&-pill {
border-radius: 100px !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
data-testid="recipient-datepicker-btn"
appearance="raw"
gap-size="none"
:aria-label="
dateCurrent ? $gettext('Edit expiration date') : $gettext('Set expiration date')
"
@click="togglePopover"
>
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<div class="oc-flex oc-flex-middle oc-flex-between oc-mb-l oc-mt-s">
<role-dropdown
:allow-share-permission="hasResharing || resourceIsSpace"
mode="create"
@option-change="collaboratorRoleChanged"
/>
<expiration-datepicker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
:existing-role="share.role"
:allow-share-permission="hasResharing || isAnySpaceShareType"
class="files-collaborators-collaborator-role"
mode="edit"
@option-change="shareRoleChanged"
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
class="files-recipient-role-select-btn"
appearance="raw"
gap-size="none"
:aria-label="mode === 'create' ? $gettext('Select permission') : $gettext('Edit permission')"
>
<span v-if="!existingRole" v-text="inviteLabel" />
<span v-else>{{ $gettext(selectedRole.label) }}</span>
Expand Down Expand Up @@ -149,6 +150,11 @@ export default defineComponent({
allowSharePermission: {
type: Boolean,
required: true
},
mode: {
type: String,
required: false,
default: 'create'
}
},
emits: ['optionChange'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports[`Collaborator ListItem component share inheritance indicators show when
</div>
<div>
<div class="oc-flex oc-flex-nowrap oc-flex-middle">
<role-dropdown-stub allowsharepermission="true" class="files-collaborators-collaborator-role" domselector="asdf" existingpermissions="" existingrole="[object Object]"></role-dropdown-stub>
<role-dropdown-stub allowsharepermission="true" class="files-collaborators-collaborator-role" domselector="asdf" existingpermissions="" existingrole="[object Object]" mode="edit"></role-dropdown-stub>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`RoleDropdown renders a button with existing role if given for resource type file 1`] = `
<span class="oc-flex oc-flex-middle">
<oc-button-stub appearance="raw" class="files-recipient-role-select-btn" disabled="false" gapsize="none" id="files-collaborators-role-button-new" justifycontent="center" size="medium" submit="button" type="button" variation="passive">
<oc-button-stub appearance="raw" arialabel="Select permission" class="files-recipient-role-select-btn" disabled="false" gapsize="none" id="files-collaborators-role-button-new" justifycontent="center" size="medium" submit="button" type="button" variation="passive">
<span>Viewer</span>
<oc-icon-stub accessiblelabel="" color="" filltype="fill" name="arrow-down-s" size="medium" type="span" variation="passive"></oc-icon-stub>
</oc-button-stub>
Expand Down Expand Up @@ -72,7 +72,7 @@ exports[`RoleDropdown renders a button with existing role if given for resource

exports[`RoleDropdown renders a button with existing role if given for resource type folder 1`] = `
<span class="oc-flex oc-flex-middle">
<oc-button-stub appearance="raw" class="files-recipient-role-select-btn" disabled="false" gapsize="none" id="files-collaborators-role-button-new" justifycontent="center" size="medium" submit="button" type="button" variation="passive">
<oc-button-stub appearance="raw" arialabel="Select permission" class="files-recipient-role-select-btn" disabled="false" gapsize="none" id="files-collaborators-role-button-new" justifycontent="center" size="medium" submit="button" type="button" variation="passive">
<span>Viewer</span>
<oc-icon-stub accessiblelabel="" color="" filltype="fill" name="arrow-down-s" size="medium" type="span" variation="passive"></oc-icon-stub>
</oc-button-stub>
Expand Down Expand Up @@ -142,7 +142,7 @@ exports[`RoleDropdown renders a button with existing role if given for resource

exports[`RoleDropdown renders a button with invite text if no existing role given for resource type file 1`] = `
<span class="oc-flex oc-flex-middle">
<oc-button-stub appearance="raw" class="files-recipient-role-select-btn" disabled="false" gapsize="none" id="files-collaborators-role-button-new" justifycontent="center" size="medium" submit="button" type="button" variation="passive">
<oc-button-stub appearance="raw" arialabel="Select permission" class="files-recipient-role-select-btn" disabled="false" gapsize="none" id="files-collaborators-role-button-new" justifycontent="center" size="medium" submit="button" type="button" variation="passive">
<span>Invite as viewer</span>
<oc-icon-stub accessiblelabel="" color="" filltype="fill" name="arrow-down-s" size="medium" type="span" variation="passive"></oc-icon-stub>
</oc-button-stub>
Expand Down Expand Up @@ -206,7 +206,7 @@ exports[`RoleDropdown renders a button with invite text if no existing role give

exports[`RoleDropdown renders a button with invite text if no existing role given for resource type folder 1`] = `
<span class="oc-flex oc-flex-middle">
<oc-button-stub appearance="raw" class="files-recipient-role-select-btn" disabled="false" gapsize="none" id="files-collaborators-role-button-new" justifycontent="center" size="medium" submit="button" type="button" variation="passive">
<oc-button-stub appearance="raw" arialabel="Select permission" class="files-recipient-role-select-btn" disabled="false" gapsize="none" id="files-collaborators-role-button-new" justifycontent="center" size="medium" submit="button" type="button" variation="passive">
<span>Invite as viewer</span>
<oc-icon-stub accessiblelabel="" color="" filltype="fill" name="arrow-down-s" size="medium" type="span" variation="passive"></oc-icon-stub>
</oc-button-stub>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`ItemFilter can use a custom attribute as display name 1`] = `
<div class="item-filter oc-flex item-filter-users">
<div class="oc-filter-chip oc-flex">
<button class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-filter-chip-button" id="oc-filter-chip-5" type="button">
<button class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-filter-chip-button oc-pill" id="oc-filter-chip-5" type="button">
<!-- @slot Content of the button -->
<!--v-if-->
<span class="oc-text-truncate oc-filter-chip-label">Users</span>
Expand Down Expand Up @@ -49,7 +49,7 @@ exports[`ItemFilter can use a custom attribute as display name 1`] = `
exports[`ItemFilter renders all items 1`] = `
<div class="item-filter oc-flex item-filter-users">
<div class="oc-filter-chip oc-flex">
<button class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-filter-chip-button" id="oc-filter-chip-1" type="button">
<button class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-filter-chip-button oc-pill" id="oc-filter-chip-1" type="button">
<!-- @slot Content of the button -->
<!--v-if-->
<span class="oc-text-truncate oc-filter-chip-label">Users</span>
Expand Down