@xh/hoist 60.1.0 → 60.1.1
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.
package/CHANGELOG.md
CHANGED
|
@@ -137,7 +137,7 @@ export class RoleFormModel extends HoistModel {
|
|
|
137
137
|
rules: [
|
|
138
138
|
required,
|
|
139
139
|
({value}) =>
|
|
140
|
-
this.invalidNames.
|
|
140
|
+
this.invalidNames.some(it => it.toLowerCase() === value?.toLowerCase())
|
|
141
141
|
? `Role "${value}" already exists.`
|
|
142
142
|
: null
|
|
143
143
|
]
|
|
@@ -159,7 +159,20 @@ export class RoleFormModel extends HoistModel {
|
|
|
159
159
|
},
|
|
160
160
|
columns: [
|
|
161
161
|
{
|
|
162
|
-
field: {
|
|
162
|
+
field: {
|
|
163
|
+
name: 'name',
|
|
164
|
+
rules: [
|
|
165
|
+
required,
|
|
166
|
+
({value, record}) =>
|
|
167
|
+
record.store.allRecords.some(
|
|
168
|
+
it =>
|
|
169
|
+
it !== record &&
|
|
170
|
+
it.get('name')?.toLowerCase() === value?.toLowerCase()
|
|
171
|
+
)
|
|
172
|
+
? `${value} already added.`
|
|
173
|
+
: null
|
|
174
|
+
]
|
|
175
|
+
},
|
|
163
176
|
flex: 1,
|
|
164
177
|
editable: true,
|
|
165
178
|
editor: props => {
|
|
@@ -15,7 +15,8 @@ export class RoleGraphModel extends HoistModel {
|
|
|
15
15
|
get relatedRoles(): EffectiveRoleMember[] {
|
|
16
16
|
const {role, relationship} = this;
|
|
17
17
|
if (!role) return [];
|
|
18
|
-
|
|
18
|
+
const ret = relationship === 'effective' ? role.effectiveRoles : role.inheritedRoles;
|
|
19
|
+
return ret.filter(it => it.name !== role.name);
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
get role(): HoistRole {
|