Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GGCE
GGCE Web
Commits
8af78184
Commit
8af78184
authored
May 27, 2022
by
Matija Obreza
Browse files
Fix: Disabled "Assign barcode" button for system inventories
parent
5a7f3c42
Changes
2
Hide whitespace changes
Inline
Side-by-side
workspaces/ui-express/src/inventory/ui/InventoryBrowsePage.tsx
View file @
8af78184
...
@@ -102,7 +102,7 @@ class BrowsePage extends React.Component<PropsFromRedux & WithTranslation & With
...
@@ -102,7 +102,7 @@ class BrowsePage extends React.Component<PropsFromRedux & WithTranslation & With
inventoryDialogIsOpen
:
false
,
inventoryDialogIsOpen
:
false
,
inventoryActionDialogIsOpen
:
false
,
inventoryActionDialogIsOpen
:
false
,
error
:
null
,
error
:
null
,
selected
:
[],
selected
:
[]
as
Inventory
[]
,
};
};
protected
static
needs
=
[
protected
static
needs
=
[
...
@@ -138,7 +138,7 @@ class BrowsePage extends React.Component<PropsFromRedux & WithTranslation & With
...
@@ -138,7 +138,7 @@ class BrowsePage extends React.Component<PropsFromRedux & WithTranslation & With
};
};
private
handleScheduleAction
=
(
actionData
:
InventoryAction
)
=>
{
private
handleScheduleAction
=
(
actionData
:
InventoryAction
)
=>
{
const
{
selected
}:
{
selected
:
Inventory
[]
}
=
this
.
state
;
const
{
selected
}
=
this
.
state
;
this
.
setState
({
error
:
null
});
this
.
setState
({
error
:
null
});
const
{
id
:
ignoreId
,
...
usableActionData
}
=
actionData
;
const
{
id
:
ignoreId
,
...
usableActionData
}
=
actionData
;
...
...
workspaces/ui-express/src/inventory/ui/InventoryDetailsPage.tsx
View file @
8af78184
...
@@ -489,7 +489,7 @@ class InventoryDetailsPage extends React.Component<PropsFromRedux & IWithTabs &
...
@@ -489,7 +489,7 @@ class InventoryDetailsPage extends React.Component<PropsFromRedux & IWithTabs &
<
GridContainer
>
<
GridContainer
>
<
GridItem
>
<
GridItem
>
<
Card
>
<
Card
>
{
inventory
.
barcode
&&
{
(
inventory
.
barcode
&&
!
inventory
.
systemInventory
)
&&
<
div
style
=
{
{
float
:
'
left
'
}
}
>
<
div
style
=
{
{
float
:
'
left
'
}
}
>
<
QRCode
width
=
"100px"
value
=
{
inventory
.
barcode
}
/>
<
QRCode
width
=
"100px"
value
=
{
inventory
.
barcode
}
/>
</
div
>
</
div
>
...
@@ -501,14 +501,12 @@ class InventoryDetailsPage extends React.Component<PropsFromRedux & IWithTabs &
...
@@ -501,14 +501,12 @@ class InventoryDetailsPage extends React.Component<PropsFromRedux & IWithTabs &
/>
/>
<
CardActions
>
<
CardActions
>
<
ButtonBar
>
<
ButtonBar
>
{
{
(
inventory
.
barcode
&&
!
inventory
.
systemInventory
)
&&
<
Button
variant
=
"outlined"
color
=
"secondary"
onClick
=
{
()
=>
showDialog
(
printDialogKey
)
}
>
!
inventory
.
barcode
&&
<
Button
onClick
=
{
this
.
assignBarcode
}
variant
=
"contained"
>
{
t
(
'
common:action.assignBarcode
'
)
}
</
Button
>
}
<
Button
variant
=
"outlined"
color
=
"secondary"
onClick
=
{
()
=>
showDialog
(
printDialogKey
)
}
>
{
t
(
'
common:action.printLabel
'
)
}
{
t
(
'
common:action.printLabel
'
)
}
</
Button
>
</
Button
>
}
<
P
.
HasAccess
action
=
{
P
.
InventoryData
}
permission
=
{
P
.
write
}
siteId
=
{
inventory
.
site
.
id
}
>
<
P
.
HasAccess
action
=
{
P
.
InventoryData
}
permission
=
{
P
.
write
}
siteId
=
{
inventory
.
site
.
id
}
>
<
Button
onClick
=
{
this
.
openInventoryDialog
}
variant
=
"contained"
color
=
"primary"
>
{
t
(
'
common:action.edit
'
)
}
</
Button
>
<
Button
onClick
=
{
this
.
openInventoryDialog
}
variant
=
"contained"
color
=
"primary"
>
{
t
(
'
common:action.edit
'
)
}
</
Button
>
{
(
!
inventory
.
barcode
&&
!
inventory
.
systemInventory
)
&&
<
Button
onClick
=
{
this
.
assignBarcode
}
variant
=
"contained"
>
{
t
(
'
common:action.assignBarcode
'
)
}
</
Button
>
}
</
P
.
HasAccess
>
</
P
.
HasAccess
>
{
!
inventory
.
systemInventory
&&
<
P
.
HasAccess
action
=
{
P
.
InventoryData
}
permission
=
{
P
.
delete
}
siteId
=
{
inventory
.
site
.
id
}
>
{
!
inventory
.
systemInventory
&&
<
P
.
HasAccess
action
=
{
P
.
InventoryData
}
permission
=
{
P
.
delete
}
siteId
=
{
inventory
.
site
.
id
}
>
<
Button
onClick
=
{
this
.
handleRemove
}
variant
=
"text"
color
=
"secondary"
>
{
t
(
'
common:action.delete
'
)
}
</
Button
>
<
Button
onClick
=
{
this
.
handleRemove
}
variant
=
"text"
color
=
"secondary"
>
{
t
(
'
common:action.delete
'
)
}
</
Button
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment