Show deactivated like debug and support re-deactivating
This commit is contained in:
parent
f169dffc53
commit
1ddb7bb7de
|
|
@ -232,7 +232,7 @@ class MenuDrawer extends StatelessWidget {
|
||||||
color: Theme.of(context).cardColor,
|
color: Theme.of(context).cardColor,
|
||||||
child: ScrollableListView(
|
child: ScrollableListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (kReleaseMode && state.account.debugEnabled)
|
if (state.account.debugEnabled && kReleaseMode)
|
||||||
if (state.isMenuCollapsed)
|
if (state.isMenuCollapsed)
|
||||||
Tooltip(
|
Tooltip(
|
||||||
message: localization.debugModeIsEnabled,
|
message: localization.debugModeIsEnabled,
|
||||||
|
|
@ -261,6 +261,43 @@ class MenuDrawer extends StatelessWidget {
|
||||||
),
|
),
|
||||||
onTap: () => launch(kDebugModeUrl),
|
onTap: () => launch(kDebugModeUrl),
|
||||||
),
|
),
|
||||||
|
if (state.company.isDisabled)
|
||||||
|
if (state.isMenuCollapsed)
|
||||||
|
Tooltip(
|
||||||
|
message: localization.companyDisabledWarning,
|
||||||
|
child: ListTile(
|
||||||
|
contentPadding:
|
||||||
|
const EdgeInsets.only(left: 20),
|
||||||
|
onTap: () {
|
||||||
|
store.dispatch(ViewSettings(
|
||||||
|
navigator: Navigator.of(context),
|
||||||
|
section: kSettingsAccountManagement));
|
||||||
|
},
|
||||||
|
leading:
|
||||||
|
Icon(Icons.warning, color: Colors.orange),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
else
|
||||||
|
ListTile(
|
||||||
|
tileColor: Colors.orange.shade800,
|
||||||
|
title: Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 6),
|
||||||
|
child: IconText(
|
||||||
|
icon: Icons.warning,
|
||||||
|
text: localization.warning,
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle: Text(
|
||||||
|
localization.companyDisabledWarning,
|
||||||
|
style: TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
store.dispatch(ViewSettings(
|
||||||
|
navigator: Navigator.of(context),
|
||||||
|
section: kSettingsAccountManagement));
|
||||||
|
},
|
||||||
|
),
|
||||||
DrawerTile(
|
DrawerTile(
|
||||||
company: company,
|
company: company,
|
||||||
icon: getEntityIcon(EntityType.dashboard),
|
icon: getEntityIcon(EntityType.dashboard),
|
||||||
|
|
@ -604,28 +641,6 @@ class SidebarFooter extends StatelessWidget {
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
else if (state.company.isDisabled)
|
|
||||||
IconButton(
|
|
||||||
tooltip: localization.warning,
|
|
||||||
icon: Icon(
|
|
||||||
Icons.warning,
|
|
||||||
color: Colors.orange,
|
|
||||||
),
|
|
||||||
onPressed: () => showMessageDialog(
|
|
||||||
context: context,
|
|
||||||
message: localization.companyDisabledWarning,
|
|
||||||
secondaryActions: [
|
|
||||||
TextButton(
|
|
||||||
child: Text(localization.viewSettings.toUpperCase()),
|
|
||||||
onPressed: () {
|
|
||||||
store.dispatch(ViewSettings(
|
|
||||||
navigator: Navigator.of(context),
|
|
||||||
section: kSettingsAccountManagement));
|
|
||||||
Navigator.of(context).pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
)
|
|
||||||
else if (state.credentials.token.isEmpty)
|
else if (state.credentials.token.isEmpty)
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: localization.error,
|
tooltip: localization.error,
|
||||||
|
|
|
||||||
|
|
@ -157,8 +157,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
'project_name': 'Project Name',
|
'project_name': 'Project Name',
|
||||||
'warning': 'Warning',
|
'warning': 'Warning',
|
||||||
'view_settings': 'View Settings',
|
'view_settings': 'View Settings',
|
||||||
'company_disabled_warning':
|
'company_disabled_warning': 'Company is not activated',
|
||||||
'Warning: this company has not yet been activated',
|
|
||||||
'late_invoice': 'Late Invoice',
|
'late_invoice': 'Late Invoice',
|
||||||
'expired_quote': 'Expired Quote',
|
'expired_quote': 'Expired Quote',
|
||||||
'remind_invoice': 'Remind Invoice',
|
'remind_invoice': 'Remind Invoice',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue