Skip to content

Commit

Permalink
Experimentation : activate spaces for DINUM users on tchap lab (#691)
Browse files Browse the repository at this point in the history
* add space to dinum in lab
* make visible the add button
  • Loading branch information
odelcroi authored Sep 8, 2023
1 parent 545a143 commit 3c46bf4
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion config.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"agent1.tchap.incubateur.net",
"agent2.tchap.incubateur.net",
"externe.tchap.incubateur.net"
]
],
"feature_space": ["agent1.tchap.incubateur.net", "agent2.tchap.incubateur.net", "externe.tchap.incubateur.net"]
}
}
3 changes: 2 additions & 1 deletion config.preprod.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"custom_translations_url_comments": "To add translations, edit /src/i18n/strings/tchap_translations.json. It gets copied over to webapp/i18n for serving.",
"custom_translations_url": "/i18n/tchap_translations.json",
"tchap_features": {
"feature_email_notification": ["i.tchap.gouv.fr", "e.tchap.gouv.fr"]
"feature_email_notification": ["i.tchap.gouv.fr", "e.tchap.gouv.fr"],
"feature_space": ["i.tchap.gouv.fr", "e.tchap.gouv.fr"]
}
}
3 changes: 2 additions & 1 deletion config.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
"custom_translations_url_comments": "To add translations, edit /src/i18n/strings/tchap_translations.json. It gets copied over to webapp/i18n for serving.",
"custom_translations_url": "/i18n/tchap_translations.json",
"tchap_features": {
"feature_email_notification": []
"feature_email_notification": [],
"feature_space": []
}
}
3 changes: 2 additions & 1 deletion config.prod.lab.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
"custom_translations_url_comments": "To add translations, edit /src/i18n/strings/tchap_translations.json. It gets copied over to webapp/i18n for serving.",
"custom_translations_url": "/i18n/tchap_translations.json",
"tchap_features": {
"feature_email_notification": []
"feature_email_notification": [],
"feature_space": ["https://matrix.agent.dinum.tchap.gouv.fr"]
}
}
5 changes: 5 additions & 0 deletions res/themes/tchap-light/css/_tchap_custom.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,9 @@ $border-color_1: #7e7ec4;
}
.mx_ForwardDialog>.mx_ForwardList .mx_ForwardList_results .mx_ForwardList_entry:hover {
background-color: $hover;
}

/* Add space button should be white */
.mx_SpacePanel .mx_SpaceButton.mx_SpaceButton_new .mx_SpaceButton_icon {
background-color: white;
}
3 changes: 2 additions & 1 deletion src/tchap/customisations/TchapComponentVisibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ File copied from ComponentVisibility.ts in matrix-react-sdk v3.46.0
// Populate this class with the details of your customisations when copying it.

import { UIComponent } from "matrix-react-sdk/src/settings/UIFeature";
import TchapUIFeature from "../util/TchapUIFeature";

/**
* Determines whether or not the active MatrixClient user should be able to use
Expand All @@ -24,7 +25,7 @@ import { UIComponent } from "matrix-react-sdk/src/settings/UIFeature";
*/
function shouldShowComponent(component: UIComponent): boolean {
if (component === UIComponent.CreateSpaces) {
return false;
return TchapUIFeature.isFeatureActiveForHomeserver("feature_space");
}
return true; // default to visible
}
Expand Down

0 comments on commit 3c46bf4

Please sign in to comment.