TF-1018 Add Configuration guide for App Grid

This commit is contained in:
Dat PHAM HOANG
2022-10-19 15:07:28 +07:00
committed by Dat H. Pham
parent 0943e18552
commit 3c54b3946e
3 changed files with 57 additions and 10 deletions
@@ -0,0 +1,48 @@
## Configuration for App Grid
### Context
- Team Mail is a service inside Twake Workspace which include other services
- User need to access other services from Team Mail
### How to config
1. Add services to configuration file
- Each service have the information:
```
{
"appName": "Contacts",
"icon": "ic_contacts_app.svg",
"appLink": "https://openpaas.linagora.com/contacts/"
}
```
- All services must be added to the configuration file [configurations\app_dashboard.json](https://github.com/linagora/tmail-flutter/blob/master/configurations/app_dashboard.json)
For example:
```
{
"apps": [
{
"appName": "Twake",
"icon": "ic_twake_app.svg",
"appLink": "http://twake.linagora.com/"
},
{
"appName": "App 1",
"icon": "ic_twake_app.svg",
"appLink": "http://twake.linagora.com/"
},
...
]
}
```
- `appName`: The name will be showed in App Grid
- `icon`: Name of icon was added in `configurations\icons` folder
- `appLink`: Service URL
2. Enable it in [env.file](https://github.com/linagora/tmail-flutter/blob/master/env.file)
```
APP_GRID_AVAILABLE=supported
```
If you want to disable it, please change the value to `unsupported` or remove this from `env.file`
@@ -162,11 +162,13 @@ class MailboxView extends GetWidget<MailboxController> with AppLoaderMixin, Popu
}),
_buildLoadingView(),
AppConfig.appGridDashboardAvailable && _responsiveUtils.isWebNotDesktop(context)
? _buildAppGridDashboard(context)
? Column(children: [
_buildAppGridDashboard(context),
const SizedBox(height: 8),
const Divider(color: AppColor.colorDividerMailbox, height: 0.5, thickness: 0.2),
const SizedBox(height: 8),
])
: const SizedBox.shrink(),
const SizedBox(height: 8),
const Divider(color: AppColor.colorDividerMailbox, height: 0.5, thickness: 0.2),
const SizedBox(height: 8),
Obx(() => controller.defaultMailboxHasChild
? _buildMailboxCategory(context, MailboxCategories.exchange, controller.defaultRootNode)
: const SizedBox.shrink()),
@@ -547,15 +549,12 @@ class MailboxView extends GetWidget<MailboxController> with AppLoaderMixin, Popu
return Obx(() {
final linagoraApps = controller.mailboxDashBoardController.appGridDashboardController.linagoraApplications.value;
if (linagoraApps != null && linagoraApps.apps.isNotEmpty) {
return ListView.separated(
return ListView.builder(
shrinkWrap: true,
itemCount: linagoraApps.apps.length,
itemBuilder: (context, index) {
return AppListDashboardItem(linagoraApps.apps[index]);
},
separatorBuilder: (context, index) {
return const SizedBox.shrink();
},
}
);
}
return const SizedBox.shrink();
@@ -28,7 +28,7 @@ class _AppListDashboardItemState extends State<AppListDashboardItem> {
onHover: (value) => setState(() => _isHoverItem = value),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
borderRadius: const BorderRadius.all(Radius.circular(10)),
color: _backgroundColorItem(context)),
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 18),
margin: const EdgeInsets.symmetric(horizontal: 16),