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

Mediacentre UI completed #105

Open
wants to merge 57 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
da3ca08
build(mediacentre): replace compiled info-modal files by a yarn depen…
EwannRoux Sep 25, 2024
d45a1b9
fix(mediacentre): add missing key to .env.schema and remove unused k…
EwannRoux Sep 25, 2024
24cfbb9
fix(mediacentre): replace hardcoded target of getConfig request with …
EwannRoux Sep 25, 2024
6fd5c44
fix(mediacentre): add try/catch to flushMediacentreFavorites put request
EwannRoux Sep 25, 2024
9721569
fix(mediacentre): remove space char at start of string in en.json lo…
EwannRoux Sep 25, 2024
b13dd48
feat(mediacentre): change getResources to support multiples group reg…
EwannRoux Sep 27, 2024
2219b8d
fix(mediacentre): prevent method call with invalid parameter from get…
EwannRoux Sep 27, 2024
c0a6821
fix(mediacentre): replace hardcoded filter names by locales keys
EwannRoux Sep 27, 2024
b12f0ae
refactor(mediacentre): change parent SCSS property of icone info for …
EwannRoux Sep 27, 2024
0394b42
fix(mediacentre): change menu border from top to left
EwannRoux Sep 30, 2024
033269c
fix(mediacentre): move modal events definitions in PageMediacentre fr…
EwannRoux Oct 2, 2024
724c778
fix(mediacentre): increase fav and info icons clic aera and change o…
EwannRoux Oct 2, 2024
ae9c2cd
fix(mediacentre): fix mediacentre menu display on mobile
EwannRoux Oct 2, 2024
504c176
fix(mediacentre): swap opacity of cards icons for hover and normal st…
EwannRoux Oct 2, 2024
4ea6e49
feat(mediacentre): create .env.prod
EwannRoux Oct 2, 2024
4acb630
fix(mediacentre): eslint 9 errors
Quentin-Guillemin Nov 6, 2024
c19dafc
refactor(mediacentre): move getGroups logic into its own method from …
EwannRoux Nov 14, 2024
e6b5c73
style(mediacentre): fix import order
EwannRoux Jan 6, 2025
4fe728f
fix(mediacentre): fix properties definition in PageMediacentre
EwannRoux Jan 7, 2025
73d8031
feat(mediacentre): export dececoded soffit in soffitUtils
EwannRoux Feb 6, 2025
2ea0416
feat(mediacentre): create EtablissementsData class
EwannRoux Feb 6, 2025
c336c3e
feat(mediacentre): create a store for future uses in refactor
EwannRoux Feb 6, 2025
f6d5ed2
chore(mediacentre): add vueform/multiselect to project
EwannRoux Feb 7, 2025
d290b72
feat(mediacentre): separate all resources based on school and add a s…
EwannRoux Feb 7, 2025
1d24d47
feat(mediacentre): add help link
EwannRoux Feb 7, 2025
d15e0ba
chore(info-modal): add tgz to gitignore
EwannRoux Jan 8, 2025
013ba44
chore(info-modal): add sourcemap to vite config
EwannRoux Jan 8, 2025
4fe74de
fix(mediacentre): fix info-modal import
EwannRoux Jan 8, 2025
8a1da8f
chore: update yarn.lock
EwannRoux Feb 7, 2025
bcf52da
chore(mediacentre): set allowedHosts property
EwannRoux Feb 7, 2025
e8f7d5b
fix(mediacentre): fix shared resources displays
EwannRoux Feb 10, 2025
a248c66
refactor(mediacentre): replace method updating a variable by a getter
EwannRoux Feb 10, 2025
3ee3402
refactor(mediacentre): rename method for disambiguation and rename re…
EwannRoux Feb 10, 2025
af36934
style(mediacentre): rename events from kebab case to camel case
EwannRoux Feb 10, 2025
f61e531
fix(mediacentre): use corrects env variables to define props
EwannRoux Feb 10, 2025
4633f11
style(mediacentre): remove commented code
EwannRoux Feb 10, 2025
4327a91
chore(mediacentre): rename env properties and put them in .env files
EwannRoux Feb 10, 2025
e23022c
style(mediacentre): fix propertie names
EwannRoux Feb 10, 2025
7f36d11
style(mediacentre): cleaned unused code and imports
EwannRoux Feb 12, 2025
69577e0
feat(mediacentre): hide school select when resources available to eve…
EwannRoux Feb 12, 2025
0413c21
feat(mediacentre): prevent school select to close when selecting a sc…
EwannRoux Feb 12, 2025
4b88adb
fix(mediacentre): prevent imcard image title to be displayed when hov…
EwannRoux Feb 12, 2025
d6b6a1c
fix(mediacentre): remove alt text from card image
EwannRoux Feb 12, 2025
af520d4
fix(mediacentre): change style
EwannRoux Feb 12, 2025
f2aa0d1
fix(mediacentre): fix school l select label syntax and display
EwannRoux Feb 12, 2025
3c75817
fix(mediacentre): fix styles imports and add new styles
EwannRoux Feb 13, 2025
496a97a
feat(mediacentre): add gar assignments menu
EwannRoux Feb 13, 2025
c4514cf
fix(mediacentre): rename isLink to link
EwannRoux Feb 14, 2025
23c7628
chore(mediacentre): update README.md
EwannRoux Feb 18, 2025
8e1c1e9
fix(mediacentre): change modal z-index to put it on top of everything
EwannRoux Feb 18, 2025
21b000e
fix(mediacentre): fix mobile display
EwannRoux Feb 18, 2025
969507b
style(mediacentre): remove commented style
EwannRoux Feb 18, 2025
8fa37c9
refactor(mediacentre): use uai instead of siren and rename variables …
EwannRoux Feb 19, 2025
b6755d1
feat(mediacentre): add redirect from url params
EwannRoux Feb 21, 2025
09354ee
fix(mediacentre): fix link color
EwannRoux Feb 21, 2025
8f7cfd5
fix(mediacentre): fix menu display
EwannRoux Feb 21, 2025
8df8d5e
chore(mediacentre): remove unused css variable and update README
EwannRoux Feb 21, 2025
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
3 changes: 3 additions & 0 deletions packages/info-modal/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# Archives
*.tgz
1 change: 1 addition & 0 deletions packages/info-modal/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default ({ mode }: { mode: string }) => {

return defineConfig({
build: {
sourcemap: true,
lib: {
entry: './src/info-modal.ts',
formats: ['es'],
Expand Down
15 changes: 15 additions & 0 deletions packages/mediacentre/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
VITE_BASE_URI="/"
VITE_AXIOS_TIMEOUT=10000
VITE_APP_MEDIACENTRE_CONTEXT="/portail"
VITE_APP_MEDIACENTRE_API_URI="/mediacentre-api/api/resources"
VITE_APP_MEDIACENTRE_CONFIG_API_URI="/mediacentre-api/api/config"
VITE_APP_MEDIACENTRE_FNAME="Mediacentre"
VITE_APP_MEDIACENTRE_USER_INFO_API_URI="/api/v5-1/userinfo?claims=&groups="
VITE_APP_MEDIACENTRE_USER_RIGHTS_API_URI="/api/groups"
VITE_APP_MEDIACENTRE_USER_GET_USER_FAVORITE_RESOURCES_API_URI="/api/prefs/getentityonlyprefs/"
VITE_APP_MEDIACENTRE_USER_PUT_USER_FAVORITE_RESOURCES_API_URI="/api/prefs/putprefs?fname="
VITE_APP_MEDIACENTRE_CLAIM_UAI=""
VITE_APP_MEDIACENTRE_CLAIM_UAI_CURRENT=""
VITE_APP_MEDIACENTRE_HELP_PAGE_LOCATION=""
VITE_APP_MEDIACENTRE_GESTION_API_URI="/mediacentre-api/api/resources/gestion"
VITE_APP_MEDIACENTRE_REDIRECTION_REGEX="\?[\w-]*redirect=([^&]+)(?:&[^&]*base64=(true|false))?"
9 changes: 7 additions & 2 deletions packages/mediacentre/.env.schema
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@

VITE_APP_MEDIACENTRE_BASE_URI="/"
VITE_BASE_URI="/"
VITE_AXIOS_TIMEOUT=10000
VITE_APP_MEDIACENTRE_CONTEXT=""
VITE_APP_MEDIACENTRE_API_URI=""
VITE_APP_MEDIACENTRE_CONFIG_API_URI=""
VITE_APP_MEDIACENTRE_FNAME=""
VITE_APP_MEDIACENTRE_USER_INFO_API_URI=""
VITE_APP_MEDIACENTRE_USER_RIGHTS_API_URI=""
VITE_APP_MEDIACENTRE_USER_GET_USER_FAVORITE_RESOURCES_API_URI=""
VITE_APP_MEDIACENTRE_USER_PUT_USER_FAVORITE_RESOURCES_API_URI=""

VITE_APP_MEDIACENTRE_CLAIM_UAI=""
VITE_APP_MEDIACENTRE_CLAIM_UAI_CURRENT=""
VITE_APP_MEDIACENTRE_HELP_PAGE_LOCATION=""
VITE_APP_MEDIACENTRE_GESTION_API_URI=""
VITE_APP_MEDIACENTRE_REDIRECTION_REGEX=""
18 changes: 14 additions & 4 deletions packages/mediacentre/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ npm install @gip-recia/mediacentre-ui
Dans un module JavaScript :

```js
import '@gip-recia/mediacentre-ui';
import '@gip-recia/mediacentre-ui'
```

Dans une page HTML :
Expand All @@ -31,8 +31,8 @@ Dans une page HTML :
3. Ajout du composant sur une page HTML :

```js
const component = document.createElement('mediacentre-ui');
document.body.appendChild(component);
const component = document.createElement('mediacentre-ui')
document.body.appendChild(component)
```

## Paramètres
Expand All @@ -41,13 +41,17 @@ Propriétés disponibles :

| Nom | Type | Obligatoire | Default | Description |
| --------------------------------- | :------: | :---------: | :-----: | ---------------------------------------------------------------------------------------------------------- |
| `mediacentre-context-url` | `string` | `non` | | contexte de l'URL. |
| `base-api-url` | `string` | `non` | | URL de l'API REST MediaCentre. |
| `config-api-url` | `string` | `non` | | URL de la configuration de l'API REST MediaCentre. |
| `gestion-api-url` | `string` | `non` | | URL des informations de gestion du GAR de de l'API REST MediaCentre. |
| `user-info-api-url` | `string` | `non` | | URL de l'API des informations utilisateurs. |
| `user-rights-api-url` | `string` | `non` | | URL de l'API des droits utilisateurs. |
| `get-user-favorite-resources-url` | `string` | `non` | | URL de l'API pour récupèrer la liste des identifiants des ressources favorites de l'utilisateur. |
| `put-user-favorite-resources-url` | `string` | `non` | | URL de l'API pour modifier la liste des identifiants des ressources favorites de l'utilisateur. |
| `fname-mediacentre-ui` | `string` | `non` | | Fname de la portlet du Mediacentre-UI (utilisé pour la gestion des ressources favorites de l'utilisateur). |
| `uai-current` | `string` | `non` | | Clé de la soffit pour obtenir la valeur de l'UAI de l'établissement courant. |
| `uai` | `string` | `non` | | Clé de la soffit pour obtenir la valeur de la liste des UAI des établissements de l'utilisateur. |
| `help-location` | `string` | `non` | | URL de la page d'aide du Médiacentre. |

<br/>

Expand Down Expand Up @@ -78,3 +82,9 @@ Plusieurs variables CSS peuvent être définis pour personnaliser le webcomponen
| `--ui-mediacentre-menu-title-background-color` | Couleur de fond du titre du menu et de l'icône infos. |
| `--ui-mediacentre-category-hover-background-color` | Couleur de fond au survol d'une catégorie. |
| `--ui-mediacentre-category-active-background-color` | Couleur de fond d'une catégorie sélectionnée. |
| `--recia-btn-primary-bg` | Couleur de fond des boutons et des selects. |
| `--recia-btn-primary-color` | Couleur du texte des boutons et des selectse. |
| `--mediacentre-menu-bg` | Couleur de fond du menu. |
| `--primary-transparent` | Couleur de fond des boutons. |
| `--ui-mediacentre-category-active-background-color` | Couleur de fond d'une catégorie sélectionnée. |
| `--ui-mediacentre-blue-link` | Couleur des hyperliens. |
6 changes: 3 additions & 3 deletions packages/mediacentre/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@gip-recia/mediacentre-ui</title>
<script type="text/javascript">
<!-- <script type="text/javascript">
let triggerElement
document.addEventListener('openModale', (event) => {
triggerElement = event.detail.originalEvent
const modalElement = document.querySelector('info-modal')
modalElement.isOpen = !modalElement.isOpen
modalElement.titleModal = event.detail.title
modalElement.mainElement = document.getElementsByTagName('main')[0]
modalElement.mainElement = document.querySelector('body > div')[0]
})

document.addEventListener('closeModale', (event) => {
Expand All @@ -20,7 +20,7 @@
event.preventDefault()
}
})
</script>
</script> -->
</head>
<body>
<main id="app"></main>
Expand Down
2 changes: 2 additions & 0 deletions packages/mediacentre/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"@fortawesome/free-regular-svg-icons": "^6.7.2",
"@fortawesome/free-solid-svg-icons": "^6.7.2",
"@fortawesome/vue-fontawesome": "^3.0.8",
"@gip-recia/info-modal": "file:../info-modal/package.tgz",
"@intlify/unplugin-vue-i18n": "^6.0.3",
"@tsconfig/node22": "^22.0.0",
"@types/lodash.debounce": "^4",
Expand All @@ -59,6 +60,7 @@
"@uportal/open-id-connect": "^1.40.2",
"@vitejs/plugin-vue": "^5.2.1",
"@vue/tsconfig": "^0.7.0",
"@vueform/multiselect": "^2.6.11",
"@vueuse/core": "^12.5.0",
"axios": "^1.7.9",
"dotenv-checker": "^1.1.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/mediacentre/src/AppDev.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ mediacentre-ui {
}
/* Variables */
:root {
--ui-mediacentre-background-color: #ffffff;
--ui-mediacentre-background-color: #f3f3f3;
--ui-mediacentre-font-color: #000000;
--ui-mediacentre-border-color: #d35959;
--ui-mediacentre-menu-title-background-color: #ededed;
Expand Down
191 changes: 191 additions & 0 deletions packages/mediacentre/src/assets/scss/_buttons.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
/**
* Copyright (C) 2023 GIP-RECIA, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

@use 'variables' as *;

%tag-and-button {
display: inline-flex;
align-items: center;
justify-content: center;
column-gap: 8px;
text-align: center;
vertical-align: middle;
cursor: pointer;
user-select: none;
border-radius: 50px;
text-decoration: none;
color: unset;
}

%disabled {
opacity: 0.33;
pointer-events: none;
}

%tag {
@extend %tag-and-button;
padding: 8px 16px;
font-family: $dm-sans;
font-weight: 500;
font-size: 14px;

&.active {
background-color: $standard-colour-black;
color: white;

&:hover {
background-color: $primary;
}

&:focus-visible {
background-color: $primary;
color: $standard-colour-white;
outline: 3px solid #0062bc4d;
}
}

&:not(.active) {
&:hover {
background-color: $primary-transparent;
color: $primary;
}

&:focus-visible {
background-color: $primary-transparent;
color: $primary;
outline: 3px solid $primary;
}
}

&:disabled,
&.disabled {
opacity: 0.33;
pointer-events: none;
}
}

%tag-circle {
@extend %tag;
border-radius: 50%;
width: 34px;
height: 34px;
padding: 8px;
}

%tag-small {
@extend %tag;
padding: 4px 12px;
}

%tag-small-circle {
@extend %tag;
border-radius: 50%;
width: 26px;
height: 26px;
padding: 4px;
}

%button {
@extend %tag-and-button;
padding: 12px 24px;
font-family: $sora;
font-weight: 600;
font-size: 16px;
}

%button-primary {
@extend %button;
background-color: $basic-black;
color: $standard-colour-white;

&:hover {
background-color: $primary;
}

&:focus-visible {
background-color: $primary;
outline: 4px solid #0062bc4d;
}

&:disabled,
&.disabled {
@extend %disabled;
}
}

%button-primary-circle {
@extend %button-primary;
border-radius: 50%;
width: 44px;
height: 44px;
padding: 12px;
}

%button-secondary {
@extend %button;
background-color: $basic-grey;
color: $basic-black;

&:hover {
background-color: $secondary-hover;
color: $primary;
}

&:focus-visible {
background-color: $secondary-hover;
color: $primary;
outline: 4px solid $primary;
}

&:disabled,
&.disabled {
@extend %disabled;
}
}

%button-tertiary {
@extend %button;
padding: 8px 16px;
font-family: $dm-sans;
font-weight: 600;
font-size: 14px;
border-radius: 17px;
color: $basic-black;

&:hover {
color: $primary;
text-decoration: underline;
}

&:focus-visible {
color: $primary;
text-decoration: underline;
outline: 4px solid $primary;
}

&:disabled,
&.disabled {
@extend %disabled;
}
}

%button-tertiary-circle {
@extend %button-tertiary;
border-radius: 50%;
width: 34px;
height: 34px;
padding: 8px;
}
18 changes: 17 additions & 1 deletion packages/mediacentre/src/assets/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,25 @@
*/

$border-color: var(--ui-mediacentre-border-color, #25b2f3);
$background-color: var(--ui-mediacentre-background-color, #beb2b2);
$background-color: var(--ui-mediacentre-background-color, #ffffff);
$card-background-color: var(--ui-mediacentre-card-background-color, #ffffff);
$font-color: var(--ui-mediacentre-font-color, #000000);
$menu-title-background-color: var(--ui-mediacentre-menu-title-background-color, #ededed);
$category-hover-background-color: var(--ui-mediacentre-category-hover-background-color, #f3f3f3);
$category-active-background-color: var(--ui-mediacentre-category-active-background-color, #f8f8f8);
$vueform-option-selected-background: var(--recia-btn-primary-bg, #0d9eff);
$vueform-option-selected: var(--recia-btn-primary-color, #fff);
$background-color-menu: var(--mediacentre-menu-bg, #f4f4f4);

$dm-sans: 'DM Sans', 'sans-serif';
$sora: 'Sora', 'sans-serif';
$standard-colour-white: #fff;
$standard-colour-black: #1e1e1e;
$primary: var(--primary, #0062bc);
$primary-transparent: var(--primary-transparent, #0062bc0d);
$basic-black: #1e1e1e;
$basic-grey: #f4f4f4;
//unused, but declared beacause an unused button requires it
$secondary-hover: var(--secondary-hover, #e6eff8);

$blue-link: var(--ui-mediacentre-blue-link, #005099);
10 changes: 10 additions & 0 deletions packages/mediacentre/src/assets/scss/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@
*/

@forward 'variables';
@use 'variables' as *;
@use 'buttons';

* {
box-sizing: border-box;
}

a {
color: $blue-link;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
Loading