refactor: rebrand project assets and UI theme from Cargill-specific to generic naming
This commit is contained in:
@@ -14,7 +14,7 @@ android {
|
||||
compileSdk { version = release(36) { minorApiLevel = 1 } }
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.aistudio.cargillparadaos.xvyzwt"
|
||||
applicationId = "com.aistudio.paradaos.xvyzwt"
|
||||
minSdk = 24
|
||||
targetSdk = 36
|
||||
versionCode = 1
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:461441632355:android:8ea9121be8cf81b4ee5056",
|
||||
"android_client_info": {
|
||||
"package_name": "com.aistudio.cargillparadaos.xvyzwt"
|
||||
"package_name": "com.aistudio.paradaos.xvyzwt"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
@@ -17,7 +17,7 @@
|
||||
"client_id": "461441632355-rg9go0tcsr8ora2la83aat9pcekqo13p.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.aistudio.cargillparadaos.xvyzwt",
|
||||
"package_name": "com.aistudio.paradaos.xvyzwt",
|
||||
"certificate_hash": "6274d8aa0709c0454af47340ae8f223b8a0fbd61"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -27,8 +27,8 @@ import com.example.data.repository.MaintenanceRepository
|
||||
import com.example.ui.screens.AnalyticsScreen
|
||||
import com.example.ui.screens.MaintenanceDashboardScreen
|
||||
import com.example.ui.screens.SettingsScreen
|
||||
import com.example.ui.theme.CargillGreen
|
||||
import com.example.ui.theme.CargillLightGreen
|
||||
import com.example.ui.theme.BrandGreen
|
||||
import com.example.ui.theme.BrandLightGreen
|
||||
import com.example.ui.theme.MyApplicationTheme
|
||||
import com.example.ui.viewmodel.MaintenanceViewModel
|
||||
import com.example.ui.viewmodel.MaintenanceViewModelFactory
|
||||
@@ -72,11 +72,11 @@ class MainActivity : ComponentActivity() {
|
||||
icon = { Icon(Icons.Default.Dashboard, contentDescription = "Dashboard") },
|
||||
label = { Text("Dashboard", fontSize = 11.sp) },
|
||||
colors = NavigationBarItemDefaults.colors(
|
||||
selectedIconColor = CargillGreen,
|
||||
selectedTextColor = CargillGreen,
|
||||
selectedIconColor = BrandGreen,
|
||||
selectedTextColor = BrandGreen,
|
||||
unselectedIconColor = Color.Gray,
|
||||
unselectedTextColor = Color.Gray,
|
||||
indicatorColor = CargillLightGreen
|
||||
indicatorColor = BrandLightGreen
|
||||
)
|
||||
)
|
||||
|
||||
@@ -95,11 +95,11 @@ class MainActivity : ComponentActivity() {
|
||||
icon = { Icon(Icons.Default.Assignment, contentDescription = "Ordens") },
|
||||
label = { Text("Ordens", fontSize = 11.sp) },
|
||||
colors = NavigationBarItemDefaults.colors(
|
||||
selectedIconColor = CargillGreen,
|
||||
selectedTextColor = CargillGreen,
|
||||
selectedIconColor = BrandGreen,
|
||||
selectedTextColor = BrandGreen,
|
||||
unselectedIconColor = Color.Gray,
|
||||
unselectedTextColor = Color.Gray,
|
||||
indicatorColor = CargillLightGreen
|
||||
indicatorColor = BrandLightGreen
|
||||
)
|
||||
)
|
||||
|
||||
@@ -118,11 +118,11 @@ class MainActivity : ComponentActivity() {
|
||||
icon = { Icon(Icons.Default.Settings, contentDescription = "Configurações") },
|
||||
label = { Text("Configurações", fontSize = 11.sp) },
|
||||
colors = NavigationBarItemDefaults.colors(
|
||||
selectedIconColor = CargillGreen,
|
||||
selectedTextColor = CargillGreen,
|
||||
selectedIconColor = BrandGreen,
|
||||
selectedTextColor = BrandGreen,
|
||||
unselectedIconColor = Color.Gray,
|
||||
unselectedTextColor = Color.Gray,
|
||||
indicatorColor = CargillLightGreen
|
||||
indicatorColor = BrandLightGreen
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ abstract class AppDatabase : RoomDatabase() {
|
||||
val instance = Room.databaseBuilder(
|
||||
context.applicationContext,
|
||||
AppDatabase::class.java,
|
||||
"cargill_maintenance_db"
|
||||
"maintenance_db"
|
||||
)
|
||||
.fallbackToDestructiveMigration()
|
||||
.build()
|
||||
|
||||
@@ -389,7 +389,7 @@ class MaintenanceRepository(
|
||||
|
||||
suspend fun exportDatabaseBackup(context: Context, outputUri: Uri): Result<Unit> = withContext(Dispatchers.IO) {
|
||||
runCatching {
|
||||
val dbFile = context.getDatabasePath("cargill_maintenance_db")
|
||||
val dbFile = context.getDatabasePath("maintenance_db")
|
||||
if (!dbFile.exists()) {
|
||||
throw java.io.IOException("Banco de dados não encontrado localmente.")
|
||||
}
|
||||
|
||||
@@ -19,13 +19,11 @@ import androidx.compose.ui.text.font.FontStyle
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
// Official Cargill Colors for Theme Integration
|
||||
val CargillGreen = Color(0xFF005F40) // Beautiful forest/leaf green
|
||||
val CargillBlack = Color(0xFF1A1A1A) // High contrast premium charcoal-black
|
||||
import com.example.ui.theme.BrandBlack
|
||||
import com.example.ui.theme.BrandGreen
|
||||
|
||||
@Composable
|
||||
fun CargillLogo(
|
||||
fun AppLogo(
|
||||
modifier: Modifier = Modifier,
|
||||
showText: Boolean = true,
|
||||
lightMode: Boolean = true
|
||||
@@ -35,7 +33,7 @@ fun CargillLogo(
|
||||
horizontalArrangement = Arrangement.Start,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
// Draw the iconic curved leaf logo using Compose Canvas
|
||||
// Draw the curved leaf logo using Compose Canvas
|
||||
Canvas(
|
||||
modifier = Modifier
|
||||
.width(52.dp)
|
||||
@@ -45,7 +43,6 @@ fun CargillLogo(
|
||||
val w = size.width
|
||||
val h = size.height
|
||||
|
||||
// High precision path modeling Cargill's leaf swoosh
|
||||
val path = Path().apply {
|
||||
// Outer arch
|
||||
moveTo(w * 0.05f, h * 0.85f)
|
||||
@@ -54,10 +51,10 @@ fun CargillLogo(
|
||||
w * 0.80f, h * 0.05f, // Control 2
|
||||
w * 0.95f, h * 0.85f // End
|
||||
)
|
||||
// Bottom inner curve to create a leaf shape thickness
|
||||
// Bottom inner curve
|
||||
cubicTo(
|
||||
w * 0.75f, h * 0.35f, // Control 1 (tighter)
|
||||
w * 0.25f, h * 0.35f, // Control 2 (tighter)
|
||||
w * 0.75f, h * 0.35f, // Control 1
|
||||
w * 0.25f, h * 0.35f, // Control 2
|
||||
w * 0.05f, h * 0.85f // Back to start
|
||||
)
|
||||
close()
|
||||
@@ -65,18 +62,18 @@ fun CargillLogo(
|
||||
|
||||
drawPath(
|
||||
path = path,
|
||||
color = CargillGreen,
|
||||
color = BrandGreen,
|
||||
style = Fill
|
||||
)
|
||||
}
|
||||
|
||||
if (showText) {
|
||||
Text(
|
||||
text = "Cargill",
|
||||
color = if (lightMode) CargillBlack else Color.White,
|
||||
fontSize = 24.sp,
|
||||
text = "Parada OS",
|
||||
color = if (lightMode) BrandBlack else Color.White,
|
||||
fontSize = 22.sp,
|
||||
fontFamily = FontFamily.SansSerif,
|
||||
fontWeight = FontWeight.Black,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontStyle = FontStyle.Italic,
|
||||
modifier = Modifier.padding(start = 4.dp, bottom = 2.dp)
|
||||
)
|
||||
@@ -31,8 +31,8 @@ import com.example.data.model.MaintenanceActivity
|
||||
import com.example.data.model.OSUpdateHistory
|
||||
import com.example.data.model.parseDateOnly
|
||||
import com.example.data.model.AnalyticsState
|
||||
import com.example.ui.theme.CargillBlack
|
||||
import com.example.ui.theme.CargillGreen
|
||||
import com.example.ui.theme.BrandBlack
|
||||
import com.example.ui.theme.BrandGreen
|
||||
import com.example.ui.theme.LightGrey
|
||||
import com.example.ui.viewmodel.MaintenanceViewModel
|
||||
import java.text.SimpleDateFormat
|
||||
@@ -58,7 +58,7 @@ fun AnalyticsScreen(
|
||||
text = "Métricas Analíticas Avançadas",
|
||||
fontSize = 18.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
},
|
||||
navigationIcon = {
|
||||
@@ -71,12 +71,12 @@ fun AnalyticsScreen(
|
||||
Icon(
|
||||
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
||||
contentDescription = "Voltar",
|
||||
tint = CargillGreen
|
||||
tint = BrandGreen
|
||||
)
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
Text(
|
||||
text = "Voltar",
|
||||
color = CargillGreen,
|
||||
color = BrandGreen,
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Medium
|
||||
)
|
||||
@@ -148,7 +148,7 @@ fun TeamProductivityCard(teamMetrics: List<Pair<String, Int>>) {
|
||||
text = "Produtividade da Equipe",
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack,
|
||||
color = BrandBlack,
|
||||
modifier = Modifier.padding(bottom = 16.dp)
|
||||
)
|
||||
|
||||
@@ -177,7 +177,7 @@ fun TeamProductivityCard(teamMetrics: List<Pair<String, Int>>) {
|
||||
text = "$percentage%",
|
||||
fontSize = 12.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Box(
|
||||
@@ -222,7 +222,7 @@ fun SCurveCard(analyticsState: AnalyticsState) {
|
||||
text = "Progresso do Projeto: Planejado vs. Realizado",
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack,
|
||||
color = BrandBlack,
|
||||
textAlign = TextAlign.Center,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
@@ -381,7 +381,7 @@ fun OverdueByTagCard(overdueByTag: List<Pair<String, Int>>) {
|
||||
text = "Atrasados por TAG",
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack,
|
||||
color = BrandBlack,
|
||||
textAlign = TextAlign.Center,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
@@ -428,7 +428,7 @@ fun OverdueByTagCard(overdueByTag: List<Pair<String, Int>>) {
|
||||
text = tag,
|
||||
fontSize = 12.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack,
|
||||
color = BrandBlack,
|
||||
modifier = Modifier.width(90.dp),
|
||||
maxLines = 1
|
||||
)
|
||||
@@ -455,7 +455,7 @@ fun OverdueByTagCard(overdueByTag: List<Pair<String, Int>>) {
|
||||
text = count.toString(),
|
||||
fontSize = 12.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack,
|
||||
color = BrandBlack,
|
||||
modifier = Modifier.width(20.dp),
|
||||
textAlign = TextAlign.End
|
||||
)
|
||||
|
||||
@@ -17,8 +17,8 @@ import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.ui.theme.CargillBlack
|
||||
import com.example.ui.theme.CargillGreen
|
||||
import com.example.ui.theme.BrandBlack
|
||||
import com.example.ui.theme.BrandGreen
|
||||
import com.example.ui.theme.LightGrey
|
||||
|
||||
@Composable
|
||||
@@ -49,7 +49,7 @@ fun DashboardStubScreen(
|
||||
Icon(
|
||||
imageVector = Icons.Default.BarChart,
|
||||
contentDescription = "Analytics Icon",
|
||||
tint = CargillGreen,
|
||||
tint = BrandGreen,
|
||||
modifier = Modifier.size(72.dp)
|
||||
)
|
||||
|
||||
@@ -59,7 +59,7 @@ fun DashboardStubScreen(
|
||||
text = "Dashboard Analítico",
|
||||
fontSize = 22.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack,
|
||||
color = BrandBlack,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
|
||||
@@ -82,7 +82,7 @@ fun DashboardStubScreen(
|
||||
) {
|
||||
Text(
|
||||
text = "Recurso Planejado - Em Breve",
|
||||
color = CargillGreen,
|
||||
color = BrandGreen,
|
||||
fontSize = 12.sp,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
|
||||
@@ -54,9 +54,9 @@ import com.example.data.model.OSUpdateHistory
|
||||
import com.example.data.model.extractDateOnly
|
||||
import com.example.data.model.formatToShortDate
|
||||
import com.example.data.model.parseDateOnly
|
||||
import com.example.ui.components.CargillBlack
|
||||
import com.example.ui.components.CargillGreen
|
||||
import com.example.ui.components.CargillLogo
|
||||
import com.example.ui.theme.BrandBlack
|
||||
import com.example.ui.theme.BrandGreen
|
||||
import com.example.ui.components.AppLogo
|
||||
import com.example.ui.viewmodel.MaintenanceViewModel
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
@@ -236,7 +236,7 @@ fun MaintenanceDashboardScreen(
|
||||
text = "Gestão OS",
|
||||
style = MaterialTheme.typography.titleLarge.copy(
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
)
|
||||
},
|
||||
@@ -253,7 +253,7 @@ fun MaintenanceDashboardScreen(
|
||||
Icon(
|
||||
imageVector = if (internetAvailable) Icons.Default.Cloud else Icons.Default.CloudOff,
|
||||
contentDescription = "Online Atualizado",
|
||||
tint = if (internetAvailable) CargillGreen else StatusGrey,
|
||||
tint = if (internetAvailable) BrandGreen else StatusGrey,
|
||||
modifier = Modifier.size(18.dp)
|
||||
)
|
||||
}
|
||||
@@ -277,7 +277,7 @@ fun MaintenanceDashboardScreen(
|
||||
Icon(
|
||||
imageVector = Icons.Default.Sync,
|
||||
contentDescription = "Sincronizar dados",
|
||||
tint = CargillGreen,
|
||||
tint = BrandGreen,
|
||||
modifier = Modifier.rotate(if (isSyncing) angle else 0f)
|
||||
)
|
||||
}
|
||||
@@ -325,7 +325,7 @@ fun MaintenanceDashboardScreen(
|
||||
modifier = Modifier
|
||||
.size(24.dp)
|
||||
.clip(CircleShape)
|
||||
.background(CargillGreen),
|
||||
.background(BrandGreen),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(
|
||||
@@ -341,7 +341,7 @@ fun MaintenanceDashboardScreen(
|
||||
text = currentUser!!.displayName.substringBefore(" "),
|
||||
fontSize = 10.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
Text(
|
||||
text = currentUser!!.email,
|
||||
@@ -353,7 +353,7 @@ fun MaintenanceDashboardScreen(
|
||||
Icon(
|
||||
imageVector = Icons.Default.ArrowDropDown,
|
||||
contentDescription = "Menu de Usuário",
|
||||
tint = CargillBlack,
|
||||
tint = BrandBlack,
|
||||
modifier = Modifier.size(16.dp)
|
||||
)
|
||||
}
|
||||
@@ -436,13 +436,13 @@ fun MaintenanceDashboardScreen(
|
||||
modifier = Modifier
|
||||
.size(52.dp)
|
||||
.clip(RoundedCornerShape(12.dp))
|
||||
.background(if (showAdvancedFilters) CargillGreen else Color.White)
|
||||
.background(if (showAdvancedFilters) BrandGreen else Color.White)
|
||||
.testTag("toggle_filters_button")
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Tune,
|
||||
contentDescription = "Filtros avançados",
|
||||
tint = if (showAdvancedFilters) Color.White else CargillBlack
|
||||
tint = if (showAdvancedFilters) Color.White else BrandBlack
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -498,7 +498,7 @@ fun MaintenanceDashboardScreen(
|
||||
text = "Ordens de Serviço (${activities.size})",
|
||||
fontSize = 15.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
IconButton(
|
||||
onClick = { isListExpanded = !isListExpanded },
|
||||
@@ -507,7 +507,7 @@ fun MaintenanceDashboardScreen(
|
||||
Icon(
|
||||
imageVector = if (isListExpanded) Icons.Default.FullscreenExit else Icons.Default.Fullscreen,
|
||||
contentDescription = if (isListExpanded) "Recolher visualização" else "Expandir listagem",
|
||||
tint = CargillGreen,
|
||||
tint = BrandGreen,
|
||||
modifier = Modifier.size(20.dp)
|
||||
)
|
||||
}
|
||||
@@ -557,7 +557,7 @@ fun MaintenanceDashboardScreen(
|
||||
viewModel.setFilterRecurso("Todos")
|
||||
viewModel.setSearchQuery("")
|
||||
},
|
||||
colors = ButtonDefaults.buttonColors(containerColor = CargillBlack)
|
||||
colors = ButtonDefaults.buttonColors(containerColor = BrandBlack)
|
||||
) {
|
||||
Text("Limpar Todos os Filtros")
|
||||
}
|
||||
@@ -665,7 +665,7 @@ fun DashboardMetrics(activities: List<MaintenanceActivity>) {
|
||||
text = "Visão Geral de Campo",
|
||||
fontSize = 18.sp,
|
||||
fontWeight = FontWeight.Black,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
}
|
||||
|
||||
@@ -677,7 +677,7 @@ fun DashboardMetrics(activities: List<MaintenanceActivity>) {
|
||||
CircularProgressIndicator(
|
||||
progress = { avgProgress.toFloat() / 100f },
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
color = CargillGreen,
|
||||
color = BrandGreen,
|
||||
strokeWidth = 6.dp,
|
||||
trackColor = Color(0xFFE8F5E9)
|
||||
)
|
||||
@@ -685,7 +685,7 @@ fun DashboardMetrics(activities: List<MaintenanceActivity>) {
|
||||
text = "$avgProgress%",
|
||||
fontSize = 12.sp,
|
||||
fontWeight = FontWeight.Black,
|
||||
color = CargillGreen
|
||||
color = BrandGreen
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -701,8 +701,8 @@ fun DashboardMetrics(activities: List<MaintenanceActivity>) {
|
||||
) {
|
||||
MetricColumn(value = "$notStartedCount", label = "Não Inic.", color = StatusGrey, icon = Icons.Default.PlayArrow)
|
||||
MetricColumn(value = "$inProgressCount", label = "Em Andam.", color = StatusBlue, icon = Icons.Default.Speed)
|
||||
MetricColumn(value = "$completedCount", label = "Concluídas", color = CargillGreen, icon = Icons.Default.CheckCircle)
|
||||
MetricColumn(value = "$totalCount", label = "Total OSs", color = CargillBlack, icon = Icons.Default.Build)
|
||||
MetricColumn(value = "$completedCount", label = "Concluídas", color = BrandGreen, icon = Icons.Default.CheckCircle)
|
||||
MetricColumn(value = "$totalCount", label = "Total OSs", color = BrandBlack, icon = Icons.Default.Build)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -839,7 +839,7 @@ fun FilterChipWidget(text: String, isSelected: Boolean, onClick: () -> Unit) {
|
||||
Surface(
|
||||
onClick = onClick,
|
||||
shape = RoundedCornerShape(20.dp),
|
||||
color = if (isSelected) CargillGreen else Color.White,
|
||||
color = if (isSelected) BrandGreen else Color.White,
|
||||
border = BorderStroke(1.dp, if (isSelected) Color.Transparent else Color(0xFFE0E0E0)),
|
||||
modifier = Modifier.height(28.dp)
|
||||
) {
|
||||
@@ -849,7 +849,7 @@ fun FilterChipWidget(text: String, isSelected: Boolean, onClick: () -> Unit) {
|
||||
) {
|
||||
Text(
|
||||
text = text,
|
||||
color = if (isSelected) Color.White else CargillBlack,
|
||||
color = if (isSelected) Color.White else BrandBlack,
|
||||
fontSize = 11.sp,
|
||||
fontWeight = if (isSelected) FontWeight.Bold else FontWeight.Medium
|
||||
)
|
||||
@@ -892,14 +892,14 @@ fun OSListItemCard(
|
||||
text = activity.numeroOs,
|
||||
fontWeight = FontWeight.Black,
|
||||
fontSize = 15.sp,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
|
||||
// Sync Status Badge
|
||||
Icon(
|
||||
imageVector = if (activity.synced) Icons.Default.CloudDone else Icons.Default.CloudQueue,
|
||||
contentDescription = if (activity.synced) "Sincronizado" else "Salvo localmente offline",
|
||||
tint = if (activity.synced) CargillGreen else Color(0xFFFF9100),
|
||||
tint = if (activity.synced) BrandGreen else Color(0xFFFF9100),
|
||||
modifier = Modifier.size(16.dp)
|
||||
)
|
||||
}
|
||||
@@ -913,7 +913,7 @@ fun OSListItemCard(
|
||||
val badgeTextColor = when (activity.status) {
|
||||
ActivityStatus.NAO_INICIADO -> StatusGrey
|
||||
ActivityStatus.EM_ANDAMENTO -> StatusBlue
|
||||
ActivityStatus.CONCLUIDO -> CargillGreen
|
||||
ActivityStatus.CONCLUIDO -> BrandGreen
|
||||
}
|
||||
|
||||
Box(
|
||||
@@ -938,7 +938,7 @@ fun OSListItemCard(
|
||||
text = activity.descricao,
|
||||
fontSize = 13.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = CargillBlack,
|
||||
color = BrandBlack,
|
||||
maxLines = 2,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
@@ -963,7 +963,7 @@ fun OSListItemCard(
|
||||
text = activity.setor,
|
||||
fontSize = 10.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillGreen
|
||||
color = BrandGreen
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1028,7 +1028,7 @@ fun OSListItemCard(
|
||||
.fillMaxWidth(activity.percentualExecucao.toFloat() / 100f)
|
||||
.height(8.dp)
|
||||
.clip(CircleShape)
|
||||
.background(if (activity.percentualExecucao >= 100) CargillGreen else StatusBlue)
|
||||
.background(if (activity.percentualExecucao >= 100) BrandGreen else StatusBlue)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1037,7 +1037,7 @@ fun OSListItemCard(
|
||||
text = "${activity.percentualExecucao}%",
|
||||
fontSize = 12.sp,
|
||||
fontWeight = FontWeight.Black,
|
||||
color = if (activity.percentualExecucao >= 100) CargillGreen else StatusBlue
|
||||
color = if (activity.percentualExecucao >= 100) BrandGreen else StatusBlue
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1165,7 +1165,7 @@ fun EditActivityBottomSheet(
|
||||
text = activity.numeroOs,
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.Black,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1184,11 +1184,11 @@ fun EditActivityBottomSheet(
|
||||
text = activity.descricao,
|
||||
fontSize = 13.sp,
|
||||
fontWeight = FontWeight.Medium,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(16.dp)) {
|
||||
Text("Setor: ${activity.setor}", fontSize = 11.sp, fontWeight = FontWeight.Bold, color = CargillGreen)
|
||||
Text("Setor: ${activity.setor}", fontSize = 11.sp, fontWeight = FontWeight.Bold, color = BrandGreen)
|
||||
Text("Equipe: ${activity.equipe}", fontSize = 11.sp, fontWeight = FontWeight.Bold, color = StatusBlue)
|
||||
Text("Recurso: ${activity.recurso}", fontSize = 11.sp, color = StatusGrey)
|
||||
}
|
||||
@@ -1206,13 +1206,13 @@ fun EditActivityBottomSheet(
|
||||
text = "Percentual de Execução",
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 14.sp,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
Text(
|
||||
text = "${progressValue.toInt()}%",
|
||||
fontWeight = FontWeight.Black,
|
||||
fontSize = 18.sp,
|
||||
color = if (progressValue >= 100) CargillGreen else StatusBlue
|
||||
color = if (progressValue >= 100) BrandGreen else StatusBlue
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1222,8 +1222,8 @@ fun EditActivityBottomSheet(
|
||||
valueRange = 0f..100f,
|
||||
steps = 19, // Splits in 5% increments for rapid tactile field logging
|
||||
colors = SliderDefaults.colors(
|
||||
thumbColor = if (progressValue >= 100) CargillGreen else StatusBlue,
|
||||
activeTrackColor = if (progressValue >= 100) CargillGreen else StatusBlue
|
||||
thumbColor = if (progressValue >= 100) BrandGreen else StatusBlue,
|
||||
activeTrackColor = if (progressValue >= 100) BrandGreen else StatusBlue
|
||||
),
|
||||
enabled = currentUser != null
|
||||
)
|
||||
@@ -1258,7 +1258,7 @@ fun EditActivityBottomSheet(
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
enabled = currentUser != null
|
||||
) {
|
||||
Text("100% (Concluir)", color = CargillGreen, fontSize = 11.sp, fontWeight = FontWeight.Bold)
|
||||
Text("100% (Concluir)", color = BrandGreen, fontSize = 11.sp, fontWeight = FontWeight.Bold)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1269,7 +1269,7 @@ fun EditActivityBottomSheet(
|
||||
text = "Observações de Campo",
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 14.sp,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
OutlinedTextField(
|
||||
value = observationText,
|
||||
@@ -1291,7 +1291,7 @@ fun EditActivityBottomSheet(
|
||||
text = "Anexar Foto de Campo (Simulador de Câmera)",
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 14.sp,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
Text(
|
||||
text = "Selecione uma categoria de inspeção para simular o anexo fotográfico da atividade:",
|
||||
@@ -1309,7 +1309,7 @@ fun EditActivityBottomSheet(
|
||||
onClick = { if (currentUser != null) selectedMockPhotoPath = if (isSelected) null else mockName },
|
||||
shape = RoundedCornerShape(8.dp),
|
||||
color = if (isSelected) Color(0xFFE8F5E9) else Color(0xFFF5F5F5),
|
||||
border = BorderStroke(1.dp, if (isSelected) CargillGreen else Color(0xFFE0E0E0)),
|
||||
border = BorderStroke(1.dp, if (isSelected) BrandGreen else Color(0xFFE0E0E0)),
|
||||
modifier = Modifier.height(48.dp)
|
||||
) {
|
||||
Row(
|
||||
@@ -1320,14 +1320,14 @@ fun EditActivityBottomSheet(
|
||||
Icon(
|
||||
imageVector = Icons.Default.CameraAlt,
|
||||
contentDescription = label,
|
||||
tint = if (isSelected) CargillGreen else StatusGrey,
|
||||
tint = if (isSelected) BrandGreen else StatusGrey,
|
||||
modifier = Modifier.size(16.dp)
|
||||
)
|
||||
Text(
|
||||
text = label,
|
||||
fontSize = 11.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = if (isSelected) CargillGreen else CargillBlack
|
||||
color = if (isSelected) BrandGreen else BrandBlack
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1348,11 +1348,11 @@ fun EditActivityBottomSheet(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
Icon(Icons.Default.Check, contentDescription = "Foto vinculada", tint = CargillGreen)
|
||||
Icon(Icons.Default.Check, contentDescription = "Foto vinculada", tint = BrandGreen)
|
||||
Text(
|
||||
text = "Foto do componente '$selectedMockPhotoPath' anexada com sucesso à OS localmente!",
|
||||
fontSize = 11.sp,
|
||||
color = CargillGreen,
|
||||
color = BrandGreen,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
}
|
||||
@@ -1472,7 +1472,7 @@ fun EditActivityBottomSheet(
|
||||
.fillMaxWidth()
|
||||
.height(48.dp)
|
||||
.testTag("save_progress_button"),
|
||||
colors = ButtonDefaults.buttonColors(containerColor = CargillGreen),
|
||||
colors = ButtonDefaults.buttonColors(containerColor = BrandGreen),
|
||||
shape = RoundedCornerShape(10.dp)
|
||||
) {
|
||||
Icon(Icons.Default.Save, contentDescription = "Salvar")
|
||||
@@ -1489,12 +1489,12 @@ fun EditActivityBottomSheet(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(6.dp)
|
||||
) {
|
||||
Icon(Icons.Default.History, contentDescription = "Histórico", tint = CargillBlack, modifier = Modifier.size(18.dp))
|
||||
Icon(Icons.Default.History, contentDescription = "Histórico", tint = BrandBlack, modifier = Modifier.size(18.dp))
|
||||
Text(
|
||||
text = "Histórico de Atualizações da OS",
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 14.sp,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1554,7 +1554,7 @@ fun TimelineLogItem(log: OSUpdateHistory) {
|
||||
text = log.recurso,
|
||||
fontSize = 11.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
}
|
||||
Text(
|
||||
@@ -1580,7 +1580,7 @@ fun TimelineLogItem(log: OSUpdateHistory) {
|
||||
text = "${log.percentualAnterior}% ➜ ${log.percentualNovo}%",
|
||||
fontSize = 11.sp,
|
||||
fontWeight = FontWeight.Black,
|
||||
color = if (log.percentualNovo >= 100) CargillGreen else StatusBlue
|
||||
color = if (log.percentualNovo >= 100) BrandGreen else StatusBlue
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1597,7 +1597,7 @@ fun TimelineLogItem(log: OSUpdateHistory) {
|
||||
Text(
|
||||
text = "\"${log.observacao}\"",
|
||||
fontSize = 11.sp,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1613,8 +1613,8 @@ fun TimelineLogItem(log: OSUpdateHistory) {
|
||||
.background(Color(0xFFE8F5E9))
|
||||
.padding(horizontal = 6.dp, vertical = 2.dp)
|
||||
) {
|
||||
Icon(Icons.Default.CameraAlt, contentDescription = "Foto", tint = CargillGreen, modifier = Modifier.size(10.dp))
|
||||
Text("Foto Anexa: ${log.fotoPath}", fontSize = 9.sp, color = CargillGreen, fontWeight = FontWeight.Bold)
|
||||
Icon(Icons.Default.CameraAlt, contentDescription = "Foto", tint = BrandGreen, modifier = Modifier.size(10.dp))
|
||||
Text("Foto Anexa: ${log.fotoPath}", fontSize = 9.sp, color = BrandGreen, fontWeight = FontWeight.Bold)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1658,7 +1658,7 @@ fun ImporterConsoleSheet(
|
||||
text = "Importar Planilha do PCM",
|
||||
fontSize = 18.sp,
|
||||
fontWeight = FontWeight.Black,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
}
|
||||
IconButton(onClick = onDismiss) {
|
||||
@@ -1682,7 +1682,7 @@ fun ImporterConsoleSheet(
|
||||
modifier = Modifier.padding(12.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(4.dp)
|
||||
) {
|
||||
Text("Estrutura Esperada do Arquivo (Excel):", fontSize = 11.sp, fontWeight = FontWeight.Bold, color = CargillBlack)
|
||||
Text("Estrutura Esperada do Arquivo (Excel):", fontSize = 11.sp, fontWeight = FontWeight.Bold, color = BrandBlack)
|
||||
Text("• Colunas Obrigatórias: Número da OS, Descrição da Atividade", fontSize = 11.sp, color = StatusGrey)
|
||||
Text("• Colunas Opcionais: Setor, Equipe, Recurso, Início, Fim, %", fontSize = 11.sp, color = StatusGrey)
|
||||
Text("• Suporta separadores por Vírgula (,) ou Ponto e Vírgula (;)", fontSize = 11.sp, color = StatusGrey)
|
||||
@@ -1700,7 +1700,7 @@ fun ImporterConsoleSheet(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(48.dp),
|
||||
colors = ButtonDefaults.buttonColors(containerColor = CargillGreen)
|
||||
colors = ButtonDefaults.buttonColors(containerColor = BrandGreen)
|
||||
) {
|
||||
Icon(Icons.Default.UploadFile, contentDescription = "Upload CSV")
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
|
||||
@@ -41,9 +41,9 @@ import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import com.example.ui.theme.CargillBlack
|
||||
import com.example.ui.theme.CargillGreen
|
||||
import com.example.ui.theme.CargillLightGreen
|
||||
import com.example.ui.theme.BrandBlack
|
||||
import com.example.ui.theme.BrandGreen
|
||||
import com.example.ui.theme.BrandLightGreen
|
||||
import com.example.ui.theme.LightGrey
|
||||
import com.example.ui.viewmodel.MaintenanceViewModel
|
||||
|
||||
@@ -108,12 +108,12 @@ fun SettingsScreen(
|
||||
Icon(
|
||||
imageVector = Icons.Default.KeyboardArrowLeft,
|
||||
contentDescription = "Voltar",
|
||||
tint = CargillGreen,
|
||||
tint = BrandGreen,
|
||||
modifier = Modifier.size(28.dp)
|
||||
)
|
||||
Text(
|
||||
text = "Voltar",
|
||||
color = CargillGreen,
|
||||
color = BrandGreen,
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
@@ -122,7 +122,7 @@ fun SettingsScreen(
|
||||
text = "Configurações do Planejador PCM",
|
||||
fontSize = 18.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
}
|
||||
},
|
||||
@@ -215,7 +215,7 @@ fun SettingsScreen(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(8.dp),
|
||||
color = CargillGreen,
|
||||
color = BrandGreen,
|
||||
trackColor = Color(0xFFE0E0E0),
|
||||
strokeCap = androidx.compose.ui.graphics.StrokeCap.Round
|
||||
)
|
||||
@@ -230,19 +230,19 @@ fun SettingsScreen(
|
||||
text = apiLatency ?: "0ms",
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Black,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
Icon(
|
||||
imageVector = Icons.Default.DateRange,
|
||||
contentDescription = "Online",
|
||||
tint = CargillGreen,
|
||||
tint = BrandGreen,
|
||||
modifier = Modifier.size(14.dp)
|
||||
)
|
||||
Text(
|
||||
text = "Online",
|
||||
fontSize = 14.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillGreen
|
||||
color = BrandGreen
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -270,7 +270,7 @@ fun SettingsScreen(
|
||||
Icon(
|
||||
imageVector = Icons.Default.Info,
|
||||
contentDescription = "Cota",
|
||||
tint = CargillGreen,
|
||||
tint = BrandGreen,
|
||||
modifier = Modifier.size(14.dp)
|
||||
)
|
||||
}
|
||||
@@ -283,7 +283,7 @@ fun SettingsScreen(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(8.dp),
|
||||
color = CargillGreen,
|
||||
color = BrandGreen,
|
||||
trackColor = Color(0xFFE0E0E0),
|
||||
strokeCap = androidx.compose.ui.graphics.StrokeCap.Round
|
||||
)
|
||||
@@ -298,13 +298,13 @@ fun SettingsScreen(
|
||||
text = apiQuota ?: "0%",
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Black,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
Text(
|
||||
text = "Bom",
|
||||
fontSize = 14.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillGreen
|
||||
color = BrandGreen
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -352,7 +352,7 @@ fun SettingsScreen(
|
||||
text = "Exportar Backup do BD",
|
||||
icon = Icons.Default.Download,
|
||||
onClick = {
|
||||
backupLauncher.launch("cargill_maintenance_backup.db")
|
||||
backupLauncher.launch("maintenance_backup.db")
|
||||
}
|
||||
)
|
||||
|
||||
@@ -475,13 +475,13 @@ fun ConflictsDialog(
|
||||
Icon(
|
||||
imageVector = Icons.Default.CheckCircle,
|
||||
contentDescription = "Sem conflitos",
|
||||
tint = CargillGreen,
|
||||
tint = BrandGreen,
|
||||
modifier = Modifier.size(48.dp)
|
||||
)
|
||||
Text(
|
||||
text = "Nenhum conflito registrado.",
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack,
|
||||
color = BrandBlack,
|
||||
fontSize = 14.sp
|
||||
)
|
||||
}
|
||||
@@ -584,7 +584,7 @@ fun ConflictItemCard(log: com.example.data.model.SyncConflictLog) {
|
||||
) {
|
||||
Text(
|
||||
text = winnerLabel,
|
||||
color = CargillGreen,
|
||||
color = BrandGreen,
|
||||
fontSize = 11.sp,
|
||||
fontWeight = FontWeight.Bold
|
||||
)
|
||||
@@ -594,7 +594,7 @@ fun ConflictItemCard(log: com.example.data.model.SyncConflictLog) {
|
||||
Text(
|
||||
text = log.descricaoOs,
|
||||
fontSize = 13.sp,
|
||||
color = CargillBlack,
|
||||
color = BrandBlack,
|
||||
fontWeight = FontWeight.Normal
|
||||
)
|
||||
|
||||
@@ -629,12 +629,12 @@ fun ConflictItemCard(log: com.example.data.model.SyncConflictLog) {
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(4.dp)
|
||||
) {
|
||||
Text(text = "Local", fontWeight = FontWeight.Bold, fontSize = 12.sp, color = CargillBlack)
|
||||
Text(text = "Local", fontWeight = FontWeight.Bold, fontSize = 12.sp, color = BrandBlack)
|
||||
if (log.resolvidoPorLocal) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Check,
|
||||
contentDescription = "Vencedor",
|
||||
tint = CargillGreen,
|
||||
tint = BrandGreen,
|
||||
modifier = Modifier.size(12.dp)
|
||||
)
|
||||
}
|
||||
@@ -643,7 +643,7 @@ fun ConflictItemCard(log: com.example.data.model.SyncConflictLog) {
|
||||
text = "Progresso: ${log.localPercentual}%",
|
||||
fontSize = 12.sp,
|
||||
fontWeight = if (log.resolvidoPorLocal) FontWeight.Bold else FontWeight.Normal,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
Text(text = "Editor: ${log.localEditor?.substringBefore("@") ?: "Local"}", fontSize = 10.sp, color = Color.Gray)
|
||||
Text(text = dataLocal, fontSize = 10.sp, color = Color.Gray)
|
||||
@@ -668,12 +668,12 @@ fun ConflictItemCard(log: com.example.data.model.SyncConflictLog) {
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(4.dp)
|
||||
) {
|
||||
Text(text = "Servidor", fontWeight = FontWeight.Bold, fontSize = 12.sp, color = CargillBlack)
|
||||
Text(text = "Servidor", fontWeight = FontWeight.Bold, fontSize = 12.sp, color = BrandBlack)
|
||||
if (!log.resolvidoPorLocal) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Check,
|
||||
contentDescription = "Vencedor",
|
||||
tint = CargillGreen,
|
||||
tint = BrandGreen,
|
||||
modifier = Modifier.size(12.dp)
|
||||
)
|
||||
}
|
||||
@@ -682,7 +682,7 @@ fun ConflictItemCard(log: com.example.data.model.SyncConflictLog) {
|
||||
text = "Progresso: ${log.remotePercentual}%",
|
||||
fontSize = 12.sp,
|
||||
fontWeight = if (!log.resolvidoPorLocal) FontWeight.Bold else FontWeight.Normal,
|
||||
color = CargillBlack
|
||||
color = BrandBlack
|
||||
)
|
||||
Text(text = "Editor: ${log.remoteEditor?.substringBefore("@") ?: "Servidor"}", fontSize = 10.sp, color = Color.Gray)
|
||||
Text(text = dataRemote, fontSize = 10.sp, color = Color.Gray)
|
||||
@@ -718,13 +718,13 @@ fun AdminButton(
|
||||
CircularProgressIndicator(
|
||||
modifier = Modifier.size(20.dp),
|
||||
strokeWidth = 2.dp,
|
||||
color = CargillGreen
|
||||
color = BrandGreen
|
||||
)
|
||||
} else {
|
||||
Icon(
|
||||
imageVector = icon,
|
||||
contentDescription = text,
|
||||
tint = CargillBlack,
|
||||
tint = BrandBlack,
|
||||
modifier = Modifier.size(22.dp)
|
||||
)
|
||||
}
|
||||
@@ -733,7 +733,7 @@ fun AdminButton(
|
||||
text = text,
|
||||
fontSize = 16.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = CargillBlack,
|
||||
color = BrandBlack,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ package com.example.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
val CargillGreen = Color(0xFF005F40)
|
||||
val CargillBlack = Color(0xFF1A1A1A)
|
||||
val CargillLightGreen = Color(0xFFE8F5E9)
|
||||
val BrandGreen = Color(0xFF005F40)
|
||||
val BrandBlack = Color(0xFF1A1A1A)
|
||||
val BrandLightGreen = Color(0xFFE8F5E9)
|
||||
|
||||
val DarkGreen = Color(0xFF003D28)
|
||||
val Charcoal = Color(0xFF2C2C2C)
|
||||
|
||||
@@ -13,18 +13,18 @@ import androidx.compose.ui.platform.LocalContext
|
||||
|
||||
private val DarkColorScheme =
|
||||
darkColorScheme(
|
||||
primary = CargillGreen,
|
||||
primary = BrandGreen,
|
||||
secondary = Charcoal,
|
||||
tertiary = CargillLightGreen,
|
||||
background = CargillBlack,
|
||||
tertiary = BrandLightGreen,
|
||||
background = BrandBlack,
|
||||
surface = Charcoal
|
||||
)
|
||||
|
||||
private val LightColorScheme =
|
||||
lightColorScheme(
|
||||
primary = CargillGreen,
|
||||
secondary = CargillBlack,
|
||||
tertiary = CargillLightGreen,
|
||||
primary = BrandGreen,
|
||||
secondary = BrandBlack,
|
||||
tertiary = BrandLightGreen,
|
||||
background = LightGrey,
|
||||
surface = Color.White
|
||||
)
|
||||
@@ -32,7 +32,7 @@ private val LightColorScheme =
|
||||
@Composable
|
||||
fun MyApplicationTheme(
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
// Set dynamic color to false by default to strictly preserve our Cargill green identity
|
||||
// Set dynamic color to false by default to strictly preserve our brand green identity
|
||||
dynamicColor: Boolean = false,
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
|
||||
@@ -319,7 +319,7 @@ class MaintenanceViewModel(private val repository: MaintenanceRepository) : View
|
||||
|
||||
viewModelScope.launch {
|
||||
_isSyncing.value = true
|
||||
_syncStatusMessage.value = "Conectando ao servidor central da Cargill..."
|
||||
_syncStatusMessage.value = "Conectando ao servidor central..."
|
||||
|
||||
when (val result = repository.synchronizeWithBackend()) {
|
||||
is SyncResult.Success -> {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">Cargill Parada OS</string>
|
||||
<string name="app_name">Gestão Parada OS</string>
|
||||
</resources>
|
||||
|
||||
@@ -24,7 +24,7 @@ class ExampleRobolectricTest {
|
||||
fun `read string from context`() {
|
||||
val context = ApplicationProvider.getApplicationContext<Context>()
|
||||
val appName = context.getString(R.string.app_name)
|
||||
assertEquals("Cargill Parada OS", appName)
|
||||
assertEquals("Gestão Parada OS", appName)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -274,9 +274,9 @@ class ExampleRobolectricTest {
|
||||
.build()
|
||||
val repository = com.example.data.repository.MaintenanceRepository(db.maintenanceDao(), context)
|
||||
|
||||
val userAdmin = com.example.data.model.UserAccess("admin@cargill.com", "total")
|
||||
val userEditor = com.example.data.model.UserAccess("editor@cargill.com", "editor")
|
||||
val userViewer = com.example.data.model.UserAccess("viewer@cargill.com", "leitor")
|
||||
val userAdmin = com.example.data.model.UserAccess("admin@empresa.com", "total")
|
||||
val userEditor = com.example.data.model.UserAccess("editor@empresa.com", "editor")
|
||||
val userViewer = com.example.data.model.UserAccess("viewer@empresa.com", "leitor")
|
||||
|
||||
kotlinx.coroutines.runBlocking {
|
||||
db.maintenanceDao().insertUserAccessList(listOf(userAdmin, userEditor, userViewer))
|
||||
@@ -310,28 +310,28 @@ class ExampleRobolectricTest {
|
||||
// Access level should be null
|
||||
assertEquals(null, viewModel.userAccessLevel.value)
|
||||
|
||||
// Test 2: Log in as viewer (viewer@cargill.com)
|
||||
viewModel.loginUser("viewer@cargill.com", "Viewer User")
|
||||
// Test 2: Log in as viewer (viewer@empresa.com)
|
||||
viewModel.loginUser("viewer@empresa.com", "Viewer User")
|
||||
Thread.sleep(100)
|
||||
org.robolectric.shadows.ShadowLooper.idleMainLooper()
|
||||
assertEquals("leitor", viewModel.userAccessLevel.value)
|
||||
|
||||
// Attempt to edit progress (should fail because access level is leitor, which is not total or editor)
|
||||
viewModel.updateProgress("OS-ACCESS", 50, "Tentando editar", null, "Viewer User", "viewer@cargill.com")
|
||||
viewModel.updateProgress("OS-ACCESS", 50, "Tentando editar", null, "Viewer User", "viewer@empresa.com")
|
||||
Thread.sleep(100)
|
||||
org.robolectric.shadows.ShadowLooper.idleMainLooper()
|
||||
// OS percentualExecucao should remain 0
|
||||
val actAfterViewer = db.maintenanceDao().getActivityByOsOneShot("OS-ACCESS")
|
||||
assertEquals(0, actAfterViewer?.percentualExecucao)
|
||||
|
||||
// Test 3: Log in as editor (editor@cargill.com)
|
||||
viewModel.loginUser("editor@cargill.com", "Editor User")
|
||||
// Test 3: Log in as editor (editor@empresa.com)
|
||||
viewModel.loginUser("editor@empresa.com", "Editor User")
|
||||
Thread.sleep(100)
|
||||
org.robolectric.shadows.ShadowLooper.idleMainLooper()
|
||||
assertEquals("editor", viewModel.userAccessLevel.value)
|
||||
|
||||
// Attempt to edit progress (should succeed because access level is editor)
|
||||
viewModel.updateProgress("OS-ACCESS", 80, "Editando com editor", null, "Editor User", "editor@cargill.com")
|
||||
viewModel.updateProgress("OS-ACCESS", 80, "Editando com editor", null, "Editor User", "editor@empresa.com")
|
||||
Thread.sleep(100)
|
||||
org.robolectric.shadows.ShadowLooper.idleMainLooper()
|
||||
// OS percentualExecucao should now be 80
|
||||
|
||||
@@ -177,17 +177,17 @@ class ExampleUnitTest {
|
||||
@Test
|
||||
fun testConflictResolutionComputation() {
|
||||
val localHistory = listOf(
|
||||
com.example.data.model.OSUpdateHistory(id = 1, numeroOs = "OS1", timestamp = 1000L, percentualAnterior = 0, percentualNovo = 20, recurso = "Mecânico", emailEditor = "local@cargill.com"),
|
||||
com.example.data.model.OSUpdateHistory(id = 2, numeroOs = "OS2", timestamp = 1500L, percentualAnterior = 0, percentualNovo = 50, recurso = "Elétrico", emailEditor = "local@cargill.com"),
|
||||
com.example.data.model.OSUpdateHistory(id = 4, numeroOs = "OS4", timestamp = 3000L, percentualAnterior = 0, percentualNovo = 90, recurso = "Mecânico", emailEditor = "local@cargill.com"),
|
||||
com.example.data.model.OSUpdateHistory(id = 5, numeroOs = "OS5", timestamp = 4000L, percentualAnterior = 0, percentualNovo = 10, recurso = "Elétrico", emailEditor = "local@cargill.com")
|
||||
com.example.data.model.OSUpdateHistory(id = 1, numeroOs = "OS1", timestamp = 1000L, percentualAnterior = 0, percentualNovo = 20, recurso = "Mecânico", emailEditor = "local@empresa.com"),
|
||||
com.example.data.model.OSUpdateHistory(id = 2, numeroOs = "OS2", timestamp = 1500L, percentualAnterior = 0, percentualNovo = 50, recurso = "Elétrico", emailEditor = "local@empresa.com"),
|
||||
com.example.data.model.OSUpdateHistory(id = 4, numeroOs = "OS4", timestamp = 3000L, percentualAnterior = 0, percentualNovo = 90, recurso = "Mecânico", emailEditor = "local@empresa.com"),
|
||||
com.example.data.model.OSUpdateHistory(id = 5, numeroOs = "OS5", timestamp = 4000L, percentualAnterior = 0, percentualNovo = 10, recurso = "Elétrico", emailEditor = "local@empresa.com")
|
||||
)
|
||||
|
||||
val remoteHistory = listOf(
|
||||
com.example.data.model.OSUpdateHistory(id = 10, numeroOs = "OS1", timestamp = 1200L, percentualAnterior = 0, percentualNovo = 30, recurso = "Mecânico", emailEditor = "remote@cargill.com"),
|
||||
com.example.data.model.OSUpdateHistory(id = 11, numeroOs = "OS3", timestamp = 2000L, percentualAnterior = 0, percentualNovo = 70, recurso = "Elétrico", emailEditor = "remote@cargill.com"),
|
||||
com.example.data.model.OSUpdateHistory(id = 12, numeroOs = "OS4", timestamp = 2500L, percentualAnterior = 0, percentualNovo = 80, recurso = "Mecânico", emailEditor = "remote@cargill.com"),
|
||||
com.example.data.model.OSUpdateHistory(id = 13, numeroOs = "OS5", timestamp = 4500L, percentualAnterior = 0, percentualNovo = 40, recurso = "Elétrico", emailEditor = "remote@cargill.com")
|
||||
com.example.data.model.OSUpdateHistory(id = 10, numeroOs = "OS1", timestamp = 1200L, percentualAnterior = 0, percentualNovo = 30, recurso = "Mecânico", emailEditor = "remote@empresa.com"),
|
||||
com.example.data.model.OSUpdateHistory(id = 11, numeroOs = "OS3", timestamp = 2000L, percentualAnterior = 0, percentualNovo = 70, recurso = "Elétrico", emailEditor = "remote@empresa.com"),
|
||||
com.example.data.model.OSUpdateHistory(id = 12, numeroOs = "OS4", timestamp = 2500L, percentualAnterior = 0, percentualNovo = 80, recurso = "Mecânico", emailEditor = "remote@empresa.com"),
|
||||
com.example.data.model.OSUpdateHistory(id = 13, numeroOs = "OS5", timestamp = 4500L, percentualAnterior = 0, percentualNovo = 40, recurso = "Elétrico", emailEditor = "remote@empresa.com")
|
||||
)
|
||||
|
||||
val localHistoryKeys = localHistory.map { "${it.numeroOs}_${it.timestamp}" }.toSet()
|
||||
@@ -271,10 +271,10 @@ class ExampleUnitTest {
|
||||
// Simulate user access lists matching dynamic headers
|
||||
val rows = listOf(
|
||||
listOf("E-mail", "Nível de Acesso"),
|
||||
listOf("admin@cargill.com", "total"),
|
||||
listOf("editor@cargill.com", "editor"),
|
||||
listOf("viewer@cargill.com", "leitor"),
|
||||
listOf("random@cargill.com", "outro")
|
||||
listOf("admin@empresa.com", "total"),
|
||||
listOf("editor@empresa.com", "editor"),
|
||||
listOf("viewer@empresa.com", "leitor"),
|
||||
listOf("random@empresa.com", "outro")
|
||||
)
|
||||
|
||||
val headers = rows[0].map { it.trim().lowercase() }
|
||||
@@ -292,9 +292,9 @@ class ExampleUnitTest {
|
||||
accessMap[email] = nivel
|
||||
}
|
||||
|
||||
assertEquals("total", accessMap["admin@cargill.com"])
|
||||
assertEquals("editor", accessMap["editor@cargill.com"])
|
||||
assertEquals("leitor", accessMap["viewer@cargill.com"])
|
||||
assertEquals("total", accessMap["admin@empresa.com"])
|
||||
assertEquals("editor", accessMap["editor@empresa.com"])
|
||||
assertEquals("leitor", accessMap["viewer@empresa.com"])
|
||||
|
||||
// Function to check write permission
|
||||
val hasWriteAccess = { email: String ->
|
||||
@@ -302,10 +302,10 @@ class ExampleUnitTest {
|
||||
level == "total" || level == "editor"
|
||||
}
|
||||
|
||||
assertTrue(hasWriteAccess("admin@cargill.com"))
|
||||
assertTrue(hasWriteAccess("editor@cargill.com"))
|
||||
assertFalse(hasWriteAccess("viewer@cargill.com"))
|
||||
assertFalse(hasWriteAccess("random@cargill.com"))
|
||||
assertFalse(hasWriteAccess("nonexistent@cargill.com"))
|
||||
assertTrue(hasWriteAccess("admin@empresa.com"))
|
||||
assertTrue(hasWriteAccess("editor@empresa.com"))
|
||||
assertFalse(hasWriteAccess("viewer@empresa.com"))
|
||||
assertFalse(hasWriteAccess("random@empresa.com"))
|
||||
assertFalse(hasWriteAccess("nonexistent@empresa.com"))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.example
|
||||
|
||||
import androidx.compose.ui.test.junit4.createComposeRule
|
||||
import androidx.compose.ui.test.onRoot
|
||||
import com.example.ui.components.CargillLogo
|
||||
import com.example.ui.components.AppLogo
|
||||
import com.example.ui.theme.MyApplicationTheme
|
||||
import com.github.takahirom.roborazzi.RobolectricDeviceQualifiers
|
||||
import com.github.takahirom.roborazzi.captureRoboImage
|
||||
@@ -24,7 +24,7 @@ class GreetingScreenshotTest {
|
||||
fun greeting_screenshot() {
|
||||
composeTestRule.setContent {
|
||||
MyApplicationTheme {
|
||||
CargillLogo()
|
||||
AppLogo()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user