Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into chore/noid/merge-master-next
Browse files Browse the repository at this point in the history
  • Loading branch information
raimund-schluessler committed Nov 1, 2023
2 parents 120d960 + daaec86 commit a6f09b8
Show file tree
Hide file tree
Showing 112 changed files with 151 additions and 88 deletions.
3 changes: 2 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ export default defineConfig({
env: {
failSilently: false,
type: 'actual',
screenshotsFolder: './cypress/snapshots/actual',
SNAPSHOT_BASE_DIRECTORY: './cypress/snapshots/base',
SNAPSHOT_DIFF_DIRECTORY: './cypress/snapshots/diff',
INTEGRATION_FOLDER: 'cypress/visual/',
trashAssetsBeforeRuns: true,
},

screenshotsFolder: './cypress/snapshots/actual',

component: {
setupNodeEvents(on, config) {
getCompareSnapshotsPlugin(on, config)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion src/assets/action.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
&__longtext {
cursor: pointer;
// allow the use of `\n`
white-space: pre-wrap;
white-space: pre-wrap !important;
}

&__name {
Expand All @@ -126,5 +126,13 @@
max-width: 100%;
display: inline-block;
}

&__menu-icon {
// Push to the right
margin-left: auto;
// Align with right end of the button
// This is the padding-right
margin-right: -$icon-margin;
}
}
}
75 changes: 43 additions & 32 deletions src/components/NcActionButton/NcActionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,32 @@ This component is made to be used inside of the [NcActions](#NcActions) componen

```vue
<template>
<div style="display: flex; align-items: center;">
<NcActions>
<NcActionButton @click="showMessage('Delete')">
<template #icon>
<Delete :size="20" />
</template>
Delete
</NcActionButton>
<NcActionButton :close-after-click="true" @click="showMessage('Delete and close menu')">
<template #icon>
<Delete :size="20" />
</template>
Delete and close
</NcActionButton>
<NcActionButton :close-after-click="true" @click="focusInput">
<template #icon>
<Plus :size="20" />
</template>
Create
</NcActionButton>
<NcActionButton :disabled="true" @click="showMessage('Disabled')">
<template #icon>
<Delete :size="20" />
</template>
Disabled button
</NcActionButton>
</NcActions>
<input ref="input" />
</div>
<NcActions>
<NcActionButton @click="showMessage('Delete')">
<template #icon>
<Delete :size="20" />
</template>
Delete
</NcActionButton>
<NcActionButton :close-after-click="true" @click="showMessage('Delete and close menu')">
<template #icon>
<Delete :size="20" />
</template>
Delete and close
</NcActionButton>
<NcActionButton :is-menu="true">
<template #icon>
<Plus :size="20" />
</template>
Create
</NcActionButton>
<NcActionButton :disabled="true" @click="showMessage('Disabled')">
<template #icon>
<Delete :size="20" />
</template>
Disabled button
</NcActionButton>
</NcActions>
</template>
<script>
import Delete from 'vue-material-design-icons/Delete'
Expand All @@ -69,9 +66,6 @@ This component is made to be used inside of the [NcActions](#NcActions) componen
showMessage(msg) {
alert(msg)
},
focusInput() {
this.$nextTick(() => this.$refs.input.focus())
},
},
}
</script>
Expand Down Expand Up @@ -217,13 +211,17 @@ export default {
<!-- default text display -->
<span v-else class="action-button__text">{{ text }}</span>

<!-- right arrow icon when there is a sub-menu -->
<ChevronRightIcon v-if="isMenu" class="action-button__menu-icon" />

<!-- fake slot to gather inner text -->
<slot v-if="false" />
</button>
</li>
</template>

<script>
import ChevronRightIcon from 'vue-material-design-icons/ChevronRight.vue'
import ActionTextMixin from '../../mixins/actionText.js'
/**
Expand All @@ -232,6 +230,9 @@ import ActionTextMixin from '../../mixins/actionText.js'
export default {
name: 'NcActionButton',
components: {
ChevronRightIcon,
},
mixins: [ActionTextMixin],
props: {
Expand All @@ -242,13 +243,23 @@ export default {
type: Boolean,
default: false,
},
/**
* aria-hidden attribute for the icon slot
*/
ariaHidden: {
type: Boolean,
default: null,
},
/**
* If this is a menu, a chevron icon will
* be added at the end of the line
*/
isMenu: {
type: Boolean,
default: false,
},
},
computed: {
/**
Expand Down
7 changes: 4 additions & 3 deletions src/components/NcActions/NcActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -989,10 +989,11 @@ export default {
})
const isNavLink = (action) => {
const componentName = action?.componentOptions?.Ctor?.extendOptions?.name ?? action?.componentOptions?.tag
const href = action?.props?.href
return (
componentName === 'NcActionLink'
&& action?.componentOptions?.propsData?.href?.startsWith(window.location.origin)
action?.type?.name === 'NcActionLink'
&& !href?.startsWith('#')
&& new URL(href, window.location.origin).origin === window.location.origin
)
}
// Automatically detect whether all actions are website navigation links
Expand Down
2 changes: 2 additions & 0 deletions src/components/NcAppContent/NcAppContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ export default {
:deep(.splitpanes.default-theme) {
.app-content-list {
max-width: none;
/* Thin scrollbar is hard to catch on resizable columns */
scrollbar-width: auto;
}
.splitpanes__pane {
Expand Down
10 changes: 7 additions & 3 deletions src/components/NcEmptyContent/NcEmptyContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Providing an icon, name, and a description is strongly advised.

```
<template>
<NcEmptyContent
name="No comments">
<NcEmptyContent name="No comments"
description="Start writing comments and they will appear here.">
<template #icon>
<Comment />
</template>
Expand Down Expand Up @@ -150,7 +150,7 @@ export default {
{{ name }}
</span>
</slot>
<p v-if="description !== '' || $slots.description">
<p v-if="description !== '' || $slots.description" class="empty-content__description">
<!-- @slot Optional formatted description rendered inside a paragraph -->
<slot name="description">
{{ description }}
Expand Down Expand Up @@ -231,6 +231,10 @@ export default {
line-height: 30px;
}
&__description {
color: var(--color-text-maxcontrast);
}
&__action {
margin-top: 8px;
Expand Down
20 changes: 15 additions & 5 deletions src/components/NcRelatedResourcesPanel/NcRelatedResourcesPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Use this component to display the related resources of a given item.
```
<template>
<NcRelatedResourcesPanel provider-id="talk"
header="Related resources for talk"
header="Related resources for talk"
:item-id="conversationId" />
</template>

Expand All @@ -48,7 +48,7 @@ export default {
<div v-if="appEnabled && isVisible" class="related-resources">
<div class="related-resources__header">
<h5>{{ header }}</h5>
<p>{{ description }}</p>
<p>{{ subline }}</p>
</div>

<NcResource v-for="resource in resources"
Expand Down Expand Up @@ -120,6 +120,17 @@ export default {
type: String,
default: t('Related resources'),
},
description: {
type: String,
default: t('Anything shared with the same group of people will show up here'),
},
/**
* If this element is used on a primary element set to true for primary styling.
*/
primary: {
type: Boolean,
default: false,
},
},
emits: [
Expand All @@ -143,12 +154,11 @@ export default {
}
return this.error ?? this.resources.length > 0
},
description() {
subline() {
if (this.error) {
return t('Error getting related resources. Please contact your system administrator if you have any questions.')
}
return t('Anything shared with the same group of people will show up here')
return this.description
},
hasResourceInfo() {
Expand Down
28 changes: 19 additions & 9 deletions src/components/NcRichContenteditable/NcRichContenteditable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ export default {
'submit',
'paste',
'update:value',
'smart-picker-submit',
],
data() {
Expand Down Expand Up @@ -585,21 +586,30 @@ export default {
// there is no way to get a tribute result asynchronously
// so we immediately insert a node and replace it when the result comes
getLinkWithPicker(item.original.id)
.then(link => {
// replace dummy temp element by a text node which contains the link
const tmpElem = document.getElementById('tmp-link-result-node')
const newElem = document.createTextNode(link)
tmpElem.replaceWith(newElem)
this.setCursorAfter(newElem)
this.updateValue(this.$refs.contenteditable.innerHTML)
.then(result => {
// replace dummy temp element by a text node which contains the picker result
const tmpElem = document.getElementById('tmp-smart-picker-result-node')
const eventData = {
result,
insertText: true,
}
this.$emit('smart-picker-submit', eventData)
if (eventData.insertText) {
const newElem = document.createTextNode(result)
tmpElem.replaceWith(newElem)
this.setCursorAfter(newElem)
this.updateValue(this.$refs.contenteditable.innerHTML)
} else {
tmpElem.remove()
}
})
.catch((error) => {
console.debug('Smart picker promise rejected:', error)
const tmpElem = document.getElementById('tmp-link-result-node')
const tmpElem = document.getElementById('tmp-smart-picker-result-node')
this.setCursorAfter(tmpElem)
tmpElem.remove()
})
return '<span id="tmp-link-result-node"></span>'
return '<span id="tmp-smart-picker-result-node"></span>'
},
setCursorAfter(element) {
const range = document.createRange()
Expand Down
3 changes: 3 additions & 0 deletions src/components/NcSelect/NcSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,9 @@ body {
.vs__selected {
// Fix `max-width` for `position: absolute`
max-width: 100%;
// Fix color to be accessible
opacity: 1;
color: var(--color-text-maxcontrast);
}
}
.vs__selected-options {
Expand Down
11 changes: 10 additions & 1 deletion src/components/NcTimezonePicker/NcTimezonePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export default {
</docs>

<template>
<NcSelect :model-value="selectedTimezone"
<NcSelect :uid="uid"
:model-value="selectedTimezone"
:options="options"
:multiple="false"
:clearable="false"
Expand All @@ -59,6 +60,7 @@ import {
getSortedTimezoneList,
} from './timezone.js'
import getTimezoneManager from './timezoneDataProviderService.js'
import GenRandomId from '../../utils/GenRandomId.js'
import NcSelect from '../NcSelect/index.js'
import { t } from '../../l10n.js'
Expand All @@ -82,6 +84,13 @@ export default {
type: String,
default: 'floating',
},
/**
* ID of the inner vue-select element, can be used for labels like: `vs-${uid}__combobox`
*/
uid: {
type: [String, Number],
default: () => `tz-${GenRandomId(5)}`,
},
},
emits: ['update:modelValue'],
computed: {
Expand Down
Loading

0 comments on commit a6f09b8

Please sign in to comment.