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

ci: create stylelint workflow #5976

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
51 changes: 51 additions & 0 deletions .github/workflows/lint-stylelint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Lint stylelint

on: pull_request

permissions:
contents: read

concurrency:
group: lint-stylelint-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest

name: stylelint

steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
id: versions
with:
fallbackNode: '^20'
fallbackNpm: '^10'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"

- name: Install dependencies
env:
CYPRESS_INSTALL_BINARY: 0
run: npm ci

- name: Lint
run: npm run stylelint
4 changes: 3 additions & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
src/fonts
src/fonts
*.json
*.orig
2 changes: 1 addition & 1 deletion css/app-navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@

.multiselect {
width: 100%;
border-radius: var(--border-radius-large);
border-radius: var(--border-radius-large);

&__content-wrapper {
z-index: 200 !important;
Expand Down
15 changes: 6 additions & 9 deletions css/app-sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,6 @@
flex: 1 auto;
}

&--timed {
}

&--all-day {
flex-wrap: wrap;
margin-bottom: 5px;
Expand Down Expand Up @@ -518,6 +515,10 @@
}

&__icon {
flex-shrink: 0;
margin-left: -5px;
margin-right: 5px;

&--hidden {
visibility: hidden;
}
Expand All @@ -534,12 +535,6 @@
opacity: 1;
}

&__icon {
flex-shrink: 0;
margin-left: -5px;
margin-right: 5px;
}

&__input {
flex-grow: 2;

Expand Down Expand Up @@ -702,6 +697,7 @@

}

/* stylelint-disable-next-line no-duplicate-selectors */
.event-popover .event-popover__inner {
.event-popover__response-buttons {
margin-top: 8px;
Expand Down Expand Up @@ -736,6 +732,7 @@
overflow: unset !important;
}

/* stylelint-disable-next-line no-duplicate-selectors */
.event-popover__inner {
text-align: left;
max-width: 480px;
Expand Down
22 changes: 11 additions & 11 deletions css/calendar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
@import 'app-navigation.scss';
@import 'app-sidebar.scss';
@import 'app-settings.scss';
@import 'app-modal.scss';
@import 'freebusy.scss';
@import 'fullcalendar.scss';
@import 'global.scss';
@import 'import.scss';
@import 'print.scss';
@import 'public.scss';
@import 'props-linkify-links.scss';
@import 'app-navigation';
@import 'app-sidebar';
@import 'app-settings';
@import 'app-modal';
@import 'freebusy';
@import 'fullcalendar';
@import 'global';
@import 'import';
@import 'print';
@import 'public';
@import 'props-linkify-links';
2 changes: 1 addition & 1 deletion css/dashboard.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.app-icon-calendar {
background-image: url('../img/calendar-dark.svg');
filter: var(--background-invert-if-dark);
filter: var(--background-invert-if-dark);
}
14 changes: 6 additions & 8 deletions css/fullcalendar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

/** Override some FullCalendar CSS vars: */
.fc {
font-family: var(--font-face) !important;

--fc-small-font-size: 0.875em;
--fc-page-bg-color: var(--color-main-background) !important;
--fc-neutral-bg-color: var(--color-background-dark) !important;
Expand All @@ -49,10 +51,6 @@
--fc-list-event-hover-bg-color: var(--color-background-hover) !important;
}

.fc {
font-family: var(--font-face) !important;
}

// ### FullCalendar Grid adjustments
// Make the labels lighter
.fc-timegrid-axis-frame,
Expand Down Expand Up @@ -241,6 +239,9 @@
.fc-col-header-cell {
word-break: break-word;
white-space: normal;

// Fix week button overlapping with the toggle
padding-top: 10px !important;
}

.fc-timeGridWeek-view {
Expand Down Expand Up @@ -276,14 +277,11 @@
min-height: 150px !important;
}
}

.fc-daygrid-day-events {
position:relative !important;
}

// Fix week button overlapping with the toggle
.fc-col-header-cell {
padding-top: 10px !important;
}
.fc-timegrid-axis-cushion {
margin-top: 44px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,6 @@ export default {
<style lang="scss">
.datepicker-widget{
width: 135px;
margin: 2px 5px 5px 5px;
margin: 2px 5px 5px 5px;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@
/**
* Function to filter results in NcSelect
*
* @param {object} option

Check warning on line 119 in src/components/AppNavigation/EditCalendarModal/SharingSearch.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Missing JSDoc @param "option" description
* @param {string} label

Check warning on line 120 in src/components/AppNavigation/EditCalendarModal/SharingSearch.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Missing JSDoc @param "label" description
* @param {string} search

Check warning on line 121 in src/components/AppNavigation/EditCalendarModal/SharingSearch.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Missing JSDoc @param "search" description
*/
filterResults(option, label, search) {
return true
Expand Down Expand Up @@ -283,8 +283,8 @@
gap: 10px;
width: 100%;

&__group-icon,
&__team-icon {
&__group-icon,
&__team-icon {

Check warning on line 287 in src/components/AppNavigation/EditCalendarModal/SharingSearch.vue

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/EditCalendarModal/SharingSearch.vue#L286-L287

Added lines #L286 - L287 were not covered by tests
width: 32px;
height: 32px;
border-radius: 16px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,3 @@ export default {
},
}
</script>

<style scoped>

</style>
6 changes: 3 additions & 3 deletions src/components/AppointmentConfigModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ export default {

<style lang="scss" scoped>
.appointment-config-modal {
&__talk-room-description {
color: var(--color-text-maxcontrast);
}
&__talk-room-description {
color: var(--color-text-maxcontrast);
}
}
</style>
1 change: 1 addition & 0 deletions src/components/CalendarGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
type: Boolean,
default: false,
},
url: {

Check warning on line 81 in src/components/CalendarGrid.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Prop 'url' requires default value to be set
type: String,
required: false,
},
Expand Down Expand Up @@ -178,7 +178,7 @@
/**
* FullCalendar Plugins
*
* @return {(PluginDef)[]}

Check warning on line 181 in src/components/CalendarGrid.vue

View workflow job for this annotation

GitHub Actions / NPM lint

The type 'PluginDef' is undefined
*/
plugins() {
return [
Expand Down Expand Up @@ -345,6 +345,7 @@
height: 16px;
width: 16px;
}

.fullcalendar-widget{
min-height: 500px;
:deep(.fc-col-header-cell-cushion){
Expand Down
3 changes: 3 additions & 0 deletions src/components/Editor/Attachments/AttachmentsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
type: 'primary',
callback: () => {
window.open(url.href, '_blank', 'noopener noreferrer')
}

Check warning on line 239 in src/components/Editor/Attachments/AttachmentsList.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Missing trailing comma
},
]
this.showOpenConfirmation = true
Expand All @@ -249,6 +249,7 @@
.attachments-input {
display: none;
}

.attachments-summary {
display:flex;
align-items: center;
Expand Down Expand Up @@ -300,6 +301,7 @@
margin-top: 1rem;
text-align: center;
}

.button-group {
display: flex;
align-content: center;
Expand All @@ -309,6 +311,7 @@
margin-right: 6px;
}
}

.attachment-icon {
width: 24px;
height: 24px;
Expand Down
3 changes: 3 additions & 0 deletions src/components/Editor/FreeBusy/FreeBusy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</template>
</NcButton>
</template>
<template>

Check warning on line 85 in src/components/Editor/FreeBusy/FreeBusy.vue

View workflow job for this annotation

GitHub Actions / NPM lint

`<template>` require directive
<div class="freebusy-caption">
<div class="freebusy-caption__calendar-user-types" />
<div class="freebusy-caption__colors">
Expand Down Expand Up @@ -218,7 +218,7 @@
type: Date,
required: true,
},
eventTitle: {

Check warning on line 221 in src/components/Editor/FreeBusy/FreeBusy.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Prop 'eventTitle' requires default value to be set
type: String,
required: false,
},
Expand Down Expand Up @@ -527,6 +527,7 @@
display: block;
height: 100%;
}

.modal__content {
padding: 50px;
//when the calendar is open, it's cut at the bottom, adding a margin fixes it
Expand Down Expand Up @@ -574,9 +575,11 @@
}
}
}

:deep(.vs__search ) {
text-overflow: ellipsis;
}

:deep(.mx-input) {
height: 38px !important;
}
Expand Down
1 change: 1 addition & 0 deletions src/components/Editor/Invitees/InviteesListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ export default {
.invitees-list-item {
flex-wrap: wrap;
}

.invitees-list-item__actions {
display: flex;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Editor/Resources/ResourceRoomType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ export default {

<style scoped>
:deep(#value) {
width: 0;
width: 0;
}
</style>
2 changes: 1 addition & 1 deletion src/components/Shared/CalendarPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default {
</script>

<style lang="scss" scoped>
::v-deep .multiselect__tags {
:deep(.multiselect__tags) {
margin: 3px 0;
}

Expand Down
2 changes: 2 additions & 0 deletions src/components/Shared/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,11 @@
.highlighted-timezone-icon {
opacity: .7;
}

:deep(.mx-icon-calendar) {
right: 0;
}

Check warning on line 434 in src/components/Shared/DatePicker.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Shared/DatePicker.vue#L434

Added line #L434 was not covered by tests
:deep(.multiselect__content-wrapper) {
border: none !important;
position: relative !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ export default {
color: var(--color-text-maxcontrast)
}
}

&__subscribe {}
}
}
</style>
2 changes: 1 addition & 1 deletion src/views/Appointments/Booking.vue
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export default {
}

&__time-zone {
max-width: 250px;
max-width: 250px;
}

&__slot-selection .material-design-icon.loading-icon.animation-rotate {
Expand Down
10 changes: 5 additions & 5 deletions src/views/Appointments/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ export default {

<style lang="scss">
#content.app-calendar {
// Enable scrolling
overflow: auto;
// Enable scrolling
overflow: auto;

// Fix box being cutoff at the bottom
margin-bottom: 0;
height: calc(var(--body-height) + var(--body-container-margin));
// Fix box being cutoff at the bottom
margin-bottom: 0;
height: calc(var(--body-height) + var(--body-container-margin));
}
</style>
Loading
Loading