oceanhelm 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,10 +2,8 @@
2
2
  <!-- Fleet Summary -->
3
3
  <div class="row mb-3">
4
4
  <div class="col-md-4">
5
- <div class="card border-0 shadow-sm"
6
- @click="filterVessels('Active')"
7
- :class="{ 'border-primary border-2': activeFilter === 'Active' }"
8
- style="cursor: pointer;">
5
+ <div class="card border-0 shadow-sm" @click="filterVessels('Active')"
6
+ :class="{ 'border-primary border-2': activeFilter === 'Active' }" style="cursor: pointer;">
9
7
  <div class="card-body d-flex align-items-center">
10
8
  <div class="rounded-circle bg-primary bg-opacity-10 p-3 me-3">
11
9
  <i class="bi bi-check-circle-fill text-primary fs-4"></i>
@@ -18,10 +16,8 @@
18
16
  </div>
19
17
  </div>
20
18
  <div class="col-md-4">
21
- <div class="card border-0 shadow-sm"
22
- @click="filterVessels('Inactive')"
23
- :class="{ 'border-secondary border-2': activeFilter === 'Inactive' }"
24
- style="cursor: pointer;">
19
+ <div class="card border-0 shadow-sm" @click="filterVessels('Inactive')"
20
+ :class="{ 'border-secondary border-2': activeFilter === 'Inactive' }" style="cursor: pointer;">
25
21
  <div class="card-body d-flex align-items-center">
26
22
  <div class="rounded-circle bg-secondary bg-opacity-10 p-3 me-3">
27
23
  <i class="bi bi-pause-circle-fill text-secondary fs-4"></i>
@@ -50,10 +46,7 @@
50
46
 
51
47
  <div class="d-flex justify-content-between align-items-center mb-4">
52
48
  <h4 class="mb-0"><i class="bi bi-ship me-2"></i>Registered Vessels</h4>
53
- <button
54
- v-if="activeFilter !== 'All'"
55
- class="btn btn-sm btn-outline-secondary"
56
- @click="clearFilter">
49
+ <button v-if="activeFilter !== 'All'" class="btn btn-sm btn-outline-secondary" @click="clearFilter">
57
50
  <i class="bi bi-x-circle me-1"></i>Clear Filter
58
51
  </button>
59
52
  </div>
@@ -334,11 +327,17 @@ export default {
334
327
  },
335
328
 
336
329
  grantAccess(vessel) {
337
- const { role, vessel: userVessel } = this.userProfile;
330
+ const { role, vessel: userVessel, categories = [] } = this.userProfile;
331
+
332
+ // Assign marine-staff only
333
+ this.userRole = categories.includes('marine-staff') ? 'marine-staff' : 'staff';
334
+
335
+ return (
336
+ role === 'owner' ||
337
+ role === 'marine-staff' ||
338
+ (role === 'captain' && userVessel === vessel.name)
339
+ );
338
340
 
339
- return role === 'owner' ||
340
- role === 'staff' ||
341
- (role === 'captain' && userVessel === vessel.name);
342
341
  },
343
342
 
344
343
  getDaysToExpiry(expiry_date) {
@@ -49,14 +49,17 @@ export const defaultMenuItems = [
49
49
  {
50
50
  type: 'dropdown',
51
51
  label: 'Compliance',
52
- roles: ['owner', 'super-staff', 'staff', 'captain'],
52
+ roles: ['owner', 'staff', 'captain'],
53
53
  icon: 'bi bi-list-ul',
54
54
  children: [
55
55
  { label: 'Vessel Certification', action: 'vessel-cert' },
56
- { label: 'Reports', action: 'reports' },
57
- { label: 'Crew Certification', action: 'crew-cert' },
58
- { label: 'QHSE Compliance', action: 'qhse' },
59
- { label: 'Track Garbage', action: 'garbage' },
56
+ {
57
+ label: 'Reports', action: 'reports', roles: ['owner', 'staff', 'captain'],
58
+ categories: ['marine-staff']
59
+ }, // only visible to staff who also have the 'marine-staff' category
60
+ { label: 'Crew Certification', action: 'crew-cert', roles: ['owner', 'staff', 'captain'], categories: ['marine-staff'] },
61
+ { label: 'QHSE Compliance', action: 'qhse', roles: ['owner', 'staff', 'captain'], categories: ['marine-staff'] },
62
+ { label: 'Track Garbage', action: 'garbage', roles: ['owner', 'staff', 'captain'], categories: ['marine-staff'] },
60
63
  ]
61
64
  },
62
65
  {
@@ -66,37 +69,38 @@ export const defaultMenuItems = [
66
69
  type: 'dropdown',
67
70
  label: 'HR',
68
71
  icon: 'bi bi-people-fill',
69
- roles: ['owner', 'super-staff', 'staff'],
72
+ roles: ['owner', 'captain', 'staff'],
70
73
  categories: ['hr'], // staff must also have this category
71
74
  children: [
72
75
  {
73
76
  label: 'Attendance',
74
77
  action: 'hr-attendance',
75
- roles: ['owner', 'super-staff', 'staff'],
76
- categories: ['hr'],
78
+ roles: ['owner', 'captain', 'staff'],
79
+ categories: ['hr', 'marine-staff'],
77
80
  },
78
81
  {
79
82
  label: 'Payroll',
80
83
  action: 'hr-payroll',
81
- roles: ['owner', 'super-staff', 'staff'],
84
+ roles: ['owner', 'staff'],
82
85
  categories: ['hr'],
83
86
  },
84
87
  {
85
88
  label: 'Appraisals',
86
89
  action: 'hr-appraisals',
87
- roles: ['owner', 'super-staff', 'staff'],
90
+ roles: ['owner', 'captain', 'staff'],
88
91
  categories: ['hr'],
89
92
  },
90
93
  {
91
94
  label: 'Leave Management',
92
95
  action: 'hr-leave',
93
- roles: ['owner', 'super-staff', 'staff'],
96
+ roles: ['owner', 'staff'],
94
97
  categories: ['hr'],
95
98
  },
96
99
  {
97
100
  label: 'Disciplinary Log',
98
101
  action: 'hr-disciplinary',
99
- roles: ['owner'], // owner-only, no category gate needed
102
+ roles: ['owner', 'staff'], // owner-only, no category gate needed
103
+ categories: ['hr'],
100
104
  },
101
105
  ]
102
106
  },
@@ -123,17 +127,18 @@ export const defaultMenuItems = [
123
127
  label: 'Maintenance',
124
128
  icon: 'bi bi-tools',
125
129
  action: 'maintenance',
126
- roles: ['owner', 'super-staff', 'staff', 'captain']
130
+ roles: ['owner', 'staff', 'captain'],
131
+ categories: ['marine-staff']
127
132
  },
128
133
  {
129
134
  type: 'dropdown',
130
135
  label: 'Crew Management',
131
136
  icon: 'bi bi-people',
132
- roles: ['owner', 'super-staff', 'staff', 'captain'],
137
+ roles: ['owner','staff', 'captain'],
133
138
  children: [
134
- { label: 'All Crew', action: 'crew-all', roles: ['owner', 'super-staff', 'staff'] },
135
- { label: 'Get Crew by Vessel', action: 'crew-by-vessel' },
136
- { label: 'Schedule', action: 'schedule' },
139
+ { label: 'All Crew', action: 'crew-all', roles: ['owner', 'staff'], categories: ['marine-staff'] },
140
+ { label: 'Get Crew by Vessel', action: 'crew-by-vessel', roles: ['owner', 'captain', 'staff'], categories: ['marine-staff'] },
141
+ { label: 'Schedule', action: 'schedule', roles: ['owner', 'captain'] },
137
142
  ]
138
143
  },
139
144
  {
@@ -142,8 +147,8 @@ export const defaultMenuItems = [
142
147
  icon: 'bi bi-clipboard-data',
143
148
  roles: ['owner', 'super-staff', 'staff', 'captain'],
144
149
  children: [
145
- { label: 'Parts Inventory', action: 'inventory', roles: ['owner', 'super-staff', 'staff', 'captain'] },
146
- { label: 'Bunkering', action: 'fuel', roles: ['owner', 'super-staff', 'staff', 'captain'] },
150
+ { label: 'Parts Inventory', action: 'inventory', roles: ['owner', 'staff', 'captain'], categories: ['controller', 'marine-staff'] },
151
+ { label: 'Bunkering', action: 'fuel', roles: ['owner', 'staff', 'captain'], categories: ['controller', 'marine-staff'] },
147
152
  ]
148
153
  },
149
154
  {
@@ -151,21 +156,25 @@ export const defaultMenuItems = [
151
156
  label: 'Requisition Processing',
152
157
  icon: 'bi bi-calendar-check',
153
158
  href: '/app/requisition',
154
- roles: ['owner', 'super-staff', 'staff', 'captain']
159
+ roles: ['owner', 'staff', 'captain'],
160
+ categories: ['controller', 'marine-staff', 'requisitor', 'purchaser']
155
161
  },
156
162
  {
157
163
  type: 'button',
158
164
  label: 'Voyage Manager',
159
165
  icon: 'fas fa-ship',
160
166
  action: 'coming-soon',
161
- roles: ['owner', 'super-staff', 'staff', 'captain']
167
+ roles: ['owner', 'staff', 'captain'],
168
+ categories: ['marine-staff']
162
169
  },
163
170
  {
164
171
  type: 'button',
165
172
  label: 'Vessel Log',
166
173
  icon: 'bi bi-file-ruled',
167
174
  action: 'coming-soon',
168
- roles: ['owner', 'super-staff', 'staff', 'captain']
175
+ roles: ['owner', 'staff', 'captain'],
176
+ categories: ['marine-staff']
177
+
169
178
  },
170
179
  {
171
180
  type: 'button',