Skip to content

Commit

Permalink
Merge branch 'release/0.17.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
polosson committed Jan 5, 2022
2 parents 9aeb4e9 + 0f67113 commit c6c5987
Show file tree
Hide file tree
Showing 123 changed files with 3,144 additions and 2,264 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@ jobs:
defaults : { run: { working-directory: ./client }}
steps :
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with: { node-version: '16' }
- run: yarn install --non-interactive --pure-lockfile
- run: yarn lint:js --max-warnings 42 --color
- run: yarn lint:js --max-warnings 29 --color

client-linting-scss:
name : "Client: Linting (SCSS)"
runs-on : ubuntu-latest
defaults : { run: { working-directory: ./client }}
steps :
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with: { node-version: '16' }
- run: yarn install --non-interactive --pure-lockfile
- run: yarn lint:scss --max-warnings 0 --color

Expand All @@ -31,7 +33,8 @@ jobs:
defaults : { run: { working-directory: ./client }}
steps :
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with: { node-version: '16' }
- run: yarn install --non-interactive --pure-lockfile
- run: yarn check-types

Expand All @@ -41,7 +44,8 @@ jobs:
defaults : { run: { working-directory: ./client }}
steps :
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with: { node-version: '16' }
- run: yarn install --non-interactive --pure-lockfile
- run: yarn test --colors --coverage --passWithNoTests

Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ Tous les changements notables sur le projet sont documentés dans ce fichier.

Ce projet adhère au principe du [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.17.0 (2022-01-05)

- Enlève la limite de caractères du champ "lieu" des événements (#300).
- Google Maps est maintenant utilisé à la place de OpenStreetMap pour ouvrir les adresses (#300).
- Utilise une période plutôt qu'une simple date pour le calcul des quantités disponibles du matériel (#301).
- Il est maintenant possible de choisir ce qui est affiché ou non dans les événements sur le calendrier (#302).
- Affiche le nom de l'utilisateur qui a créé l'événement dans la fenêtre d'événement.
- Supprime automatiquement la sous-catégorie quand la catégorie change lors de la sauvegarde du matériel (#306).
- Permet la création des inventaires de retour dès le premier jour des événements, sans pouvoir les terminer avant leur dernier jour (#307).
- Ajoute un paramètre permettant d'afficher ou non les numéros légaux sur les fiches de sortie (#310).
- Ajoute une colonne vide "Qté retour" dans la liste du matériel des fiches de sortie (#313).
- Trie les listes de matériel imprimées selon la catégorie (en affichant leur nom) en plus des sous-catégories (#315).
- Améliore les performances du chargement des événements du calendrier (de ~4 secondes à ~150 millisecondes sur un calendrier rempli) (#32).

## 0.16.2 (2021-11-04)

- Corrige la normalisation des horaires d'assignation des techniciens.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.16.2
0.17.0
14 changes: 14 additions & 0 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,22 @@

module.exports = {
extends: '@pulsanova/vue',

// - Parseur
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
babelOptions: {
configFile: './babel.config.js',
},
},

// - Configuration
settings: {
'import/resolver': {
webpack: {
config: require.resolve('@vue/cli-service/webpack.config.js'),
},
},
},
};
13 changes: 7 additions & 6 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"scripts": {
"start": "vue-cli-service serve ./src/index.js",
"build": "vue-cli-service build ./src/index.js",
"lint:js": "eslint './**/*.{js,vue,ts,tsx}'",
"lint:js": "eslint './**/*.{js,vue,ts,tsx}' --report-unused-disable-directives",
"lint:scss": "stylelint 'src/**/*.scss'",
"check-types": "tsc",
"test": "npx cross-env TZ=UTC vue-cli-service test:unit"
Expand Down Expand Up @@ -41,8 +41,8 @@
"devDependencies": {
"@babel/core": "7.14.8",
"@babel/preset-typescript": "7.15.0",
"@pulsanova/eslint-config-vue": "1.3.2",
"@pulsanova/stylelint-config-scss": "1.2.2",
"@pulsanova/eslint-config-vue": "2.0.4",
"@pulsanova/stylelint-config-scss": "2.0.1",
"@types/debounce": "1.2.1",
"@types/lodash.times": "4.3.6",
"@vue/cli-plugin-babel": "4.5.13",
Expand All @@ -54,11 +54,12 @@
"babel-jest": "27.0.6",
"babel-loader": "8.2.2",
"babel-preset-vca-jsx": "0.3.6",
"eslint": "7.32.0",
"eslint": "8.3.0",
"eslint-import-resolver-webpack": "0.13.2",
"sass": "1.36.0",
"sass-loader": "10.2.0",
"stylelint": "13.13.1",
"typescript": "4.4.3",
"stylelint": "14.1.0",
"typescript": "4.5.2",
"vue-cli-plugin-svg": "0.1.3",
"vue-template-compiler": "2.6.14"
}
Expand Down
5 changes: 3 additions & 2 deletions client/src/components/Datepicker/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import './index.scss';
import moment from 'moment';
import { defineComponent } from '@vue/composition-api';
import Datepicker from 'vue2-datepicker';
import * as langs from './locale';

// @vue/component
export default {
export default defineComponent({
name: 'Datepicker',
props: {
value: { type: [Date, Array], default: undefined },
Expand Down Expand Up @@ -83,4 +84,4 @@ export default {
/>
);
},
};
});
16 changes: 10 additions & 6 deletions client/src/components/EventBeneficiaries/Item/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import './index.scss';
import { Fragment } from 'vue-fragment';

// @vue/component
export default {
Expand All @@ -15,12 +16,15 @@ export default {
{beneficiary.full_name}
</router-link>
{beneficiary.company && (
<router-link
to={`/companies/${beneficiary.company_id}`}
title={__('action-edit')}
>
({beneficiary.company.legal_name})
</router-link>
<Fragment>
{' '}
<router-link
to={`/companies/${beneficiary.company_id}`}
title={__('action-edit')}
>
({beneficiary.company.legal_name})
</router-link>
</Fragment>
)}
</div>
);
Expand Down
5 changes: 2 additions & 3 deletions client/src/components/EventBeneficiaries/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ export default {
)}
{beneficiaries.length > 0 && (
<div class="EventBeneficiaries__list">
<span>
<i class="fas fa-address-book" /> {__('for')}
</span>
<i class="fas fa-address-book EventBeneficiaries__icon" />
{__('for')}
{beneficiaries.map((beneficiary) => (
<EventBeneficiaryItem key={beneficiary.id} beneficiary={beneficiary} />
))}
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/EventBeneficiaries/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

&__icon {
width: 1.5rem;
margin-right: 0.5rem;
margin-right: 0.3rem;
text-align: center;
}
}
8 changes: 2 additions & 6 deletions client/src/components/EventDetails/Header/Actions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const EventDetailsHeaderActions: Component<Props> = (props: Props, { root, emit
const isDeleting = ref<boolean>(false);
const hasMaterials = computed(() => event.value.materials.length > 0);
const isConfirmable = computed(() => event.value.materials?.length === 0);
const isEndToday = computed(() => event.value.endDate.isSame(new Date(), 'day'));
const hasStarted = computed(() => event.value.startDate.isSameOrBefore(new Date(), 'day'));

const isPrintable = computed(() => (
event.value.materials &&
Expand Down Expand Up @@ -66,7 +66,6 @@ const EventDetailsHeaderActions: Component<Props> = (props: Props, { root, emit
} catch (error) {
emit('error', error);
} finally {
// eslint-disable-next-line require-atomic-updates
isConfirming.value = false;
}
};
Expand All @@ -85,7 +84,6 @@ const EventDetailsHeaderActions: Component<Props> = (props: Props, { root, emit
} catch (error) {
emit('error', error);
} finally {
// eslint-disable-next-line require-atomic-updates
isArchiving.value = false;
}
};
Expand All @@ -104,7 +102,6 @@ const EventDetailsHeaderActions: Component<Props> = (props: Props, { root, emit
if (!isConfirmed) {
return;
}
// eslint-disable-next-line require-atomic-updates
isDeleting.value = true;

const { id } = event.value;
Expand All @@ -115,7 +112,6 @@ const EventDetailsHeaderActions: Component<Props> = (props: Props, { root, emit
} catch (error) {
emit('error', error);
} finally {
// eslint-disable-next-line require-atomic-updates
isDeleting.value = false;
}
};
Expand Down Expand Up @@ -153,7 +149,7 @@ const EventDetailsHeaderActions: Component<Props> = (props: Props, { root, emit
<i class="fas fa-edit" /> {__('action-edit')}
</router-link>
)}
{(isPast || isEndToday.value) && !isArchived && (
{(isPast || hasStarted.value) && !isArchived && (
<router-link to={`/event-return/${id}`} class="button info">
<i class="fas fa-tasks" /> {__('return-inventory')}
</router-link>
Expand Down
12 changes: 12 additions & 0 deletions client/src/components/EventDetails/Infos/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ export default {
warningEmptyText={__('page-events.warning-no-beneficiary')}
/>
<EventTechnicians eventTechnicians={event.technicians} />
{event.user?.person && (
<p class="EventDetailsInfos__base-infos__creator">
<i class="fas fa-user EventDetailsInfos__base-infos__creator__icon" />
{__('created-by')}
<router-link
to={`/users/${event.user.person.id}`}
class="EventDetailsInfos__base-infos__creator__link"
>
{event.user.person.full_name}
</router-link>
</p>
)}
</div>
{event.description && (
<p class="EventDetailsInfos__description">
Expand Down
18 changes: 15 additions & 3 deletions client/src/components/EventDetails/Infos/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,23 @@

.LocationText,
.EventBeneficiaries,
.EventTechnicians {
.EventTechnicians,
&__creator {
flex: 1 0 auto;
max-width: 100%;
margin-right: globals.$content-padding-small-horizontal;
margin-bottom: globals.$content-padding-large-vertical;
margin: 0 globals.$content-padding-small-horizontal globals.$content-padding-large-vertical 0;
}

&__creator {
font-size: 1rem;

&__icon {
margin-right: 0.3rem;
}

&__link {
margin-left: 0.3rem;
}
}
}

Expand Down
31 changes: 20 additions & 11 deletions client/src/components/FormField/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,27 @@ const ALLOWED_TYPES = [
export default defineComponent({
name: 'FormField',
props: {
label: String,
name: String,
label: { type: String, default: null },
name: { type: String, default: null },
type: {
validator: (value) => ALLOWED_TYPES.includes(value),
default: 'text',
},
required: { type: Boolean, default: false },
disabled: { type: Boolean, default: false },
disabledReason: String,
disabledReason: { type: String, default: null },
placeholder: { type: [String, Boolean], default: false },
value: [String, Number, Date, Array, Boolean],
step: Number,
min: Number,
max: Number,
addon: String,
options: Array,
errors: Array,
datepickerOptions: Object,
value: {
type: [String, Number, Date, Array, Boolean],
default: '',
},
step: { type: Number, default: 0.01 },
min: { type: Number, default: null },
max: { type: Number, default: null },
addon: { type: String, default: null },
options: { type: Array, default: () => [] },
errors: { type: Array, default: null },
datepickerOptions: { type: Object, default: null },
},
data() {
return {
Expand Down Expand Up @@ -191,6 +194,12 @@ export default defineComponent({
lockedReason={disabledReason}
onInput={handleSwitchChange}
/>
<input
type="hidden"
name={name}
value={value ? '1' : '0'}
readonly
/>
</div>
)}
{errors && (
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/LocationText/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export default defineComponent({
{' '}
<a
rel="noopener noreferrer nofollow"
href={`https://www.openstreetmap.org/search?query=${location}`}
title={__('open-in-openstreetmap')}
href={`https://maps.google.com/?q=${location}`}
title={__('open-in-google-maps')}
target="_blank"
>
<i class="fas fa-external-link-alt" />
Expand Down
2 changes: 0 additions & 2 deletions client/src/components/MaterialsListEditor/_utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable import/prefer-default-export */

import isValidInteger from '@/utils/isValidInteger';

import type { MaterialWithPivot } from '@/stores/api/materials';
Expand Down

0 comments on commit c6c5987

Please sign in to comment.