Update 'deploy.yaml'
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-01-19 14:05:57 +00:00
parent 5bbb9eba11
commit 3e6afc2671

View File

@@ -12,49 +12,92 @@ areas:
grow: 1 grow: 1
properties: properties:
content: Deploy content: Deploy
- id: new_brand_button # Create a Button block to add a new brand. - id: macaddress # The name text input for the brand. The value of this input is the value of the name field in the page state context.
type: TextInput
properties:
title: MAC Address
placeholder: 00:00:00:00:00:00
- id: projectname # The description text area input for the brand. The value of this input is the value of the description field in the page state context.
type: TextArea
properties:
title: Project name
# placeholder: ...
# Again use the grow (css flex-grow) layout property to lay out the buttons.
- id: back # Create a back button that will link back to the brands page without making any changes.
type: Button type: Button
layout: layout:
grow: 0 # Because the grow of the button is 0, it will not expand but remain in the same row as the title block. grow: 1 # Because the button has a grow of 1, it will expand to take up available space.
properties: properties:
title: New Brand # Button text. title: Back
icon: PlusOutlined # Ant Design icon on the button. icon: ArrowLeftOutlined
type: default # Change the type of the button to default.
block: true # Makes the button fill the maximum defined width instead of only the with of its contents (title and icon).
events: events:
onClick: # All the actions to complete when the button is clicked. onClick:
- id: link_to_new_brand # Link to the page where we will add a new brand. - id: link_to_brands # When clicked, link back to the brands page.
type: Link type: Link
params: params:
pageId: new-brand # The page id of the new brand page. pageId: brands
# A List block to render the following brands. - id: update_brand
# The list block will render a content area all items in the "brands_list" array in state. type: Button
# The "brands_list" array is populated by the "set_brands" onEnter action. layout:
- id: brands_list grow: 3 # Because the button has a grow of 3, which is 3 times as large as the
type: List # grow value of the back and delete buttons, it will expand "3 times bigger",
blocks: # and occupy more space in the row. It will be laid out in the same row as the other
- id: brands_list.$.container # Wrap all the blocks for a brands item in a box. # buttons, unless there is not enough space for all three buttons, in which case it will
type: Box # drop down to the next row by following css flex layout behavior.
style: properties:
background: '#fff' # Give the box a white background and some spacing. title: Save
margin: 10 icon: SaveOutlined
padding: 10 block: true
blocks: requests:
- id: brands_list.$.name # Show the item name as a title in the list. - id: update_brand
type: Title type: MongoDBUpdateOne # MongoDb updateOne request to update the brand.
properties: connectionId: brands
content: properties:
_state: brands_list.$.name filter:
level: 3 _id:
- id: brands_list.$.description # Show the item description as a paragraph in the list. _state: _id # Select the document that matches the document's _id that is in state.
type: Paragraph update:
properties: $set:
content: name:
_state: brands_list.$.description _state: name # Insert the brand name we set in state.
events: description:
onClick: _state: description # Insert the description name we set in state.
- id: link_to_edit_brand # Link to the page where we will edit the clicked brand. updated_at:
type: Link _date: now # Set the updated_at date as current time.
params: events:
pageId: edit-brand # The page id of the edit brand page. onClick:
urlQuery: - id: update_brand # Call the update_brand request.
brand_id: type: Request
_state: brands_list.$._id # Set the brand_id in the url query on the edit-brand page to the _id field of the clicked list item. params: update_brand
- id: link_to_brands # Link back to the brands page.
type: Link
params:
pageId: brands
- id: delete_modal
type: ConfirmModal
properties:
content: Are you sure you want to delete this brand? # The text inside the modal.
okText: Yes # Change the default text of the ok button to 'Yes'.
okButton:
type: danger # Change the default type of the ok button to danger.
cancelText: No # Change the default text of the cancel button to 'No'.
requests:
- id: delete_brand
type: MongoDBDeleteOne # MongoDb Delete One request to delete the brand's document from the collection.
connectionId: brands
properties:
filter:
_id:
_state: _id # Filter the document that matches the document's _id.
events:
onOk:
- id: delete_brand # Call the delete_brand request.
type: Request
params: delete_brand
- id: link_to_brands
type: Link
params:
pageId: brands