@@ -15,7 +15,8 @@ You will also see any lint errors in the console.
|
||||
### `yarn test`
|
||||
|
||||
Launches the test runner in the interactive watch mode.<br />
|
||||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
||||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more
|
||||
information.
|
||||
|
||||
### `yarn build`
|
||||
|
||||
@@ -31,15 +32,21 @@ See the section about [deployment](https://facebook.github.io/create-react-app/d
|
||||
|
||||
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
|
||||
|
||||
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
|
||||
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will
|
||||
remove the single build dependency from your project.
|
||||
|
||||
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
|
||||
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right
|
||||
into your project so you have full control over them. All of the commands except `eject` will still work, but they will
|
||||
point to the copied scripts so you can tweak them. At this point you’re on your own.
|
||||
|
||||
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
|
||||
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you
|
||||
shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t
|
||||
customize it when you are ready for it.
|
||||
|
||||
## Learn More
|
||||
|
||||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
||||
You can learn more in
|
||||
the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
||||
|
||||
To learn React, check out the [React documentation](https://reactjs.org/).
|
||||
|
||||
@@ -65,4 +72,5 @@ This section has moved here: https://facebook.github.io/create-react-app/docs/de
|
||||
|
||||
### `yarn build` fails to minify
|
||||
|
||||
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
|
||||
This section has moved
|
||||
here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
const { defineConfig } = require('cypress')
|
||||
const {defineConfig} = require('cypress')
|
||||
|
||||
module.exports = defineConfig({
|
||||
experimentalStudio: true,
|
||||
env: {
|
||||
FIREBASE_USERNAME: 'cypress@imex.test',
|
||||
FIREBASE_PASSWORD: 'cypress',
|
||||
},
|
||||
e2e: {
|
||||
// We've imported your old cypress plugins here.
|
||||
// You may want to clean this up later by importing these.
|
||||
setupNodeEvents(on, config) {
|
||||
return require('./cypress/plugins/index.js')(on, config)
|
||||
experimentalStudio: true,
|
||||
env: {
|
||||
FIREBASE_USERNAME: 'cypress@imex.test',
|
||||
FIREBASE_PASSWORD: 'cypress',
|
||||
},
|
||||
e2e: {
|
||||
// We've imported your old cypress plugins here.
|
||||
// You may want to clean this up later by importing these.
|
||||
setupNodeEvents(on, config) {
|
||||
return require('./cypress/plugins/index.js')(on, config)
|
||||
},
|
||||
baseUrl: 'http://localhost:3000',
|
||||
},
|
||||
baseUrl: 'http://localhost:3000',
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
/// <reference types="Cypress" />
|
||||
const { FIREBASE_USERNAME, FIREBASE_PASSWORcD } = Cypress.env();
|
||||
const {FIREBASE_USERNAME, FIREBASE_PASSWORcD} = Cypress.env();
|
||||
describe("Renders the General Page", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit("/");
|
||||
});
|
||||
it("Renders Correctly", () => {});
|
||||
it("Has the Slogan", () => {
|
||||
cy.findByText("A whole x22new kind of shop management system.").should(
|
||||
"exist"
|
||||
);
|
||||
/* ==== Generated with Cypress Studio ==== */
|
||||
cy.get(
|
||||
".ant-menu-item-active > .ant-menu-title-content > .header0-item-block"
|
||||
).click();
|
||||
cy.get("#email").clear();
|
||||
cy.get("#email").type("patrick@imex.dev");
|
||||
cy.get("#password").clear();
|
||||
cy.get("#password").type("patrick123{enter}");
|
||||
cy.get(".ant-form > .ant-btn").click();
|
||||
/* ==== End Cypress Studio ==== */
|
||||
});
|
||||
beforeEach(() => {
|
||||
cy.visit("/");
|
||||
});
|
||||
it("Renders Correctly", () => {
|
||||
});
|
||||
it("Has the Slogan", () => {
|
||||
cy.findByText("A whole x22new kind of shop management system.").should(
|
||||
"exist"
|
||||
);
|
||||
/* ==== Generated with Cypress Studio ==== */
|
||||
cy.get(
|
||||
".ant-menu-item-active > .ant-menu-title-content > .header0-item-block"
|
||||
).click();
|
||||
cy.get("#email").clear();
|
||||
cy.get("#email").type("patrick@imex.dev");
|
||||
cy.get("#password").clear();
|
||||
cy.get("#password").type("patrick123{enter}");
|
||||
cy.get(".ant-form > .ant-btn").click();
|
||||
/* ==== End Cypress Studio ==== */
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,132 +12,132 @@
|
||||
// https://on.cypress.io/introduction-to-cypress
|
||||
|
||||
describe('example to-do app', () => {
|
||||
beforeEach(() => {
|
||||
// Cypress starts out with a blank slate for each test
|
||||
// so we must tell it to visit our website with the `cy.visit()` command.
|
||||
// Since we want to visit the same URL at the start of all our tests,
|
||||
// we include it in our beforeEach function so that it runs before each test
|
||||
cy.visit('https://example.cypress.io/todo')
|
||||
})
|
||||
|
||||
it('displays two todo items by default', () => {
|
||||
// We use the `cy.get()` command to get all elements that match the selector.
|
||||
// Then, we use `should` to assert that there are two matched items,
|
||||
// which are the two default items.
|
||||
cy.get('.todo-list li').should('have.length', 2)
|
||||
|
||||
// We can go even further and check that the default todos each contain
|
||||
// the correct text. We use the `first` and `last` functions
|
||||
// to get just the first and last matched elements individually,
|
||||
// and then perform an assertion with `should`.
|
||||
cy.get('.todo-list li').first().should('have.text', 'Pay electric bill')
|
||||
cy.get('.todo-list li').last().should('have.text', 'Walk the dog')
|
||||
})
|
||||
|
||||
it('can add new todo items', () => {
|
||||
// We'll store our item text in a variable so we can reuse it
|
||||
const newItem = 'Feed the cat'
|
||||
|
||||
// Let's get the input element and use the `type` command to
|
||||
// input our new list item. After typing the content of our item,
|
||||
// we need to type the enter key as well in order to submit the input.
|
||||
// This input has a data-test attribute so we'll use that to select the
|
||||
// element in accordance with best practices:
|
||||
// https://on.cypress.io/selecting-elements
|
||||
cy.get('[data-test=new-todo]').type(`${newItem}{enter}`)
|
||||
|
||||
// Now that we've typed our new item, let's check that it actually was added to the list.
|
||||
// Since it's the newest item, it should exist as the last element in the list.
|
||||
// In addition, with the two default items, we should have a total of 3 elements in the list.
|
||||
// Since assertions yield the element that was asserted on,
|
||||
// we can chain both of these assertions together into a single statement.
|
||||
cy.get('.todo-list li')
|
||||
.should('have.length', 3)
|
||||
.last()
|
||||
.should('have.text', newItem)
|
||||
})
|
||||
|
||||
it('can check off an item as completed', () => {
|
||||
// In addition to using the `get` command to get an element by selector,
|
||||
// we can also use the `contains` command to get an element by its contents.
|
||||
// However, this will yield the <label>, which is lowest-level element that contains the text.
|
||||
// In order to check the item, we'll find the <input> element for this <label>
|
||||
// by traversing up the dom to the parent element. From there, we can `find`
|
||||
// the child checkbox <input> element and use the `check` command to check it.
|
||||
cy.contains('Pay electric bill')
|
||||
.parent()
|
||||
.find('input[type=checkbox]')
|
||||
.check()
|
||||
|
||||
// Now that we've checked the button, we can go ahead and make sure
|
||||
// that the list element is now marked as completed.
|
||||
// Again we'll use `contains` to find the <label> element and then use the `parents` command
|
||||
// to traverse multiple levels up the dom until we find the corresponding <li> element.
|
||||
// Once we get that element, we can assert that it has the completed class.
|
||||
cy.contains('Pay electric bill')
|
||||
.parents('li')
|
||||
.should('have.class', 'completed')
|
||||
})
|
||||
|
||||
context('with a checked task', () => {
|
||||
beforeEach(() => {
|
||||
// We'll take the command we used above to check off an element
|
||||
// Since we want to perform multiple tests that start with checking
|
||||
// one element, we put it in the beforeEach hook
|
||||
// so that it runs at the start of every test.
|
||||
cy.contains('Pay electric bill')
|
||||
.parent()
|
||||
.find('input[type=checkbox]')
|
||||
.check()
|
||||
// Cypress starts out with a blank slate for each test
|
||||
// so we must tell it to visit our website with the `cy.visit()` command.
|
||||
// Since we want to visit the same URL at the start of all our tests,
|
||||
// we include it in our beforeEach function so that it runs before each test
|
||||
cy.visit('https://example.cypress.io/todo')
|
||||
})
|
||||
|
||||
it('can filter for uncompleted tasks', () => {
|
||||
// We'll click on the "active" button in order to
|
||||
// display only incomplete items
|
||||
cy.contains('Active').click()
|
||||
it('displays two todo items by default', () => {
|
||||
// We use the `cy.get()` command to get all elements that match the selector.
|
||||
// Then, we use `should` to assert that there are two matched items,
|
||||
// which are the two default items.
|
||||
cy.get('.todo-list li').should('have.length', 2)
|
||||
|
||||
// After filtering, we can assert that there is only the one
|
||||
// incomplete item in the list.
|
||||
cy.get('.todo-list li')
|
||||
.should('have.length', 1)
|
||||
.first()
|
||||
.should('have.text', 'Walk the dog')
|
||||
|
||||
// For good measure, let's also assert that the task we checked off
|
||||
// does not exist on the page.
|
||||
cy.contains('Pay electric bill').should('not.exist')
|
||||
// We can go even further and check that the default todos each contain
|
||||
// the correct text. We use the `first` and `last` functions
|
||||
// to get just the first and last matched elements individually,
|
||||
// and then perform an assertion with `should`.
|
||||
cy.get('.todo-list li').first().should('have.text', 'Pay electric bill')
|
||||
cy.get('.todo-list li').last().should('have.text', 'Walk the dog')
|
||||
})
|
||||
|
||||
it('can filter for completed tasks', () => {
|
||||
// We can perform similar steps as the test above to ensure
|
||||
// that only completed tasks are shown
|
||||
cy.contains('Completed').click()
|
||||
it('can add new todo items', () => {
|
||||
// We'll store our item text in a variable so we can reuse it
|
||||
const newItem = 'Feed the cat'
|
||||
|
||||
cy.get('.todo-list li')
|
||||
.should('have.length', 1)
|
||||
.first()
|
||||
.should('have.text', 'Pay electric bill')
|
||||
// Let's get the input element and use the `type` command to
|
||||
// input our new list item. After typing the content of our item,
|
||||
// we need to type the enter key as well in order to submit the input.
|
||||
// This input has a data-test attribute so we'll use that to select the
|
||||
// element in accordance with best practices:
|
||||
// https://on.cypress.io/selecting-elements
|
||||
cy.get('[data-test=new-todo]').type(`${newItem}{enter}`)
|
||||
|
||||
cy.contains('Walk the dog').should('not.exist')
|
||||
// Now that we've typed our new item, let's check that it actually was added to the list.
|
||||
// Since it's the newest item, it should exist as the last element in the list.
|
||||
// In addition, with the two default items, we should have a total of 3 elements in the list.
|
||||
// Since assertions yield the element that was asserted on,
|
||||
// we can chain both of these assertions together into a single statement.
|
||||
cy.get('.todo-list li')
|
||||
.should('have.length', 3)
|
||||
.last()
|
||||
.should('have.text', newItem)
|
||||
})
|
||||
|
||||
it('can delete all completed tasks', () => {
|
||||
// First, let's click the "Clear completed" button
|
||||
// `contains` is actually serving two purposes here.
|
||||
// First, it's ensuring that the button exists within the dom.
|
||||
// This button only appears when at least one task is checked
|
||||
// so this command is implicitly verifying that it does exist.
|
||||
// Second, it selects the button so we can click it.
|
||||
cy.contains('Clear completed').click()
|
||||
it('can check off an item as completed', () => {
|
||||
// In addition to using the `get` command to get an element by selector,
|
||||
// we can also use the `contains` command to get an element by its contents.
|
||||
// However, this will yield the <label>, which is lowest-level element that contains the text.
|
||||
// In order to check the item, we'll find the <input> element for this <label>
|
||||
// by traversing up the dom to the parent element. From there, we can `find`
|
||||
// the child checkbox <input> element and use the `check` command to check it.
|
||||
cy.contains('Pay electric bill')
|
||||
.parent()
|
||||
.find('input[type=checkbox]')
|
||||
.check()
|
||||
|
||||
// Then we can make sure that there is only one element
|
||||
// in the list and our element does not exist
|
||||
cy.get('.todo-list li')
|
||||
.should('have.length', 1)
|
||||
.should('not.have.text', 'Pay electric bill')
|
||||
|
||||
// Finally, make sure that the clear button no longer exists.
|
||||
cy.contains('Clear completed').should('not.exist')
|
||||
// Now that we've checked the button, we can go ahead and make sure
|
||||
// that the list element is now marked as completed.
|
||||
// Again we'll use `contains` to find the <label> element and then use the `parents` command
|
||||
// to traverse multiple levels up the dom until we find the corresponding <li> element.
|
||||
// Once we get that element, we can assert that it has the completed class.
|
||||
cy.contains('Pay electric bill')
|
||||
.parents('li')
|
||||
.should('have.class', 'completed')
|
||||
})
|
||||
|
||||
context('with a checked task', () => {
|
||||
beforeEach(() => {
|
||||
// We'll take the command we used above to check off an element
|
||||
// Since we want to perform multiple tests that start with checking
|
||||
// one element, we put it in the beforeEach hook
|
||||
// so that it runs at the start of every test.
|
||||
cy.contains('Pay electric bill')
|
||||
.parent()
|
||||
.find('input[type=checkbox]')
|
||||
.check()
|
||||
})
|
||||
|
||||
it('can filter for uncompleted tasks', () => {
|
||||
// We'll click on the "active" button in order to
|
||||
// display only incomplete items
|
||||
cy.contains('Active').click()
|
||||
|
||||
// After filtering, we can assert that there is only the one
|
||||
// incomplete item in the list.
|
||||
cy.get('.todo-list li')
|
||||
.should('have.length', 1)
|
||||
.first()
|
||||
.should('have.text', 'Walk the dog')
|
||||
|
||||
// For good measure, let's also assert that the task we checked off
|
||||
// does not exist on the page.
|
||||
cy.contains('Pay electric bill').should('not.exist')
|
||||
})
|
||||
|
||||
it('can filter for completed tasks', () => {
|
||||
// We can perform similar steps as the test above to ensure
|
||||
// that only completed tasks are shown
|
||||
cy.contains('Completed').click()
|
||||
|
||||
cy.get('.todo-list li')
|
||||
.should('have.length', 1)
|
||||
.first()
|
||||
.should('have.text', 'Pay electric bill')
|
||||
|
||||
cy.contains('Walk the dog').should('not.exist')
|
||||
})
|
||||
|
||||
it('can delete all completed tasks', () => {
|
||||
// First, let's click the "Clear completed" button
|
||||
// `contains` is actually serving two purposes here.
|
||||
// First, it's ensuring that the button exists within the dom.
|
||||
// This button only appears when at least one task is checked
|
||||
// so this command is implicitly verifying that it does exist.
|
||||
// Second, it selects the button so we can click it.
|
||||
cy.contains('Clear completed').click()
|
||||
|
||||
// Then we can make sure that there is only one element
|
||||
// in the list and our element does not exist
|
||||
cy.get('.todo-list li')
|
||||
.should('have.length', 1)
|
||||
.should('not.have.text', 'Pay electric bill')
|
||||
|
||||
// Finally, make sure that the clear button no longer exists.
|
||||
cy.contains('Clear completed').should('not.exist')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,299 +1,299 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Actions', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/actions')
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/actions')
|
||||
})
|
||||
|
||||
// https://on.cypress.io/interacting-with-elements
|
||||
// https://on.cypress.io/interacting-with-elements
|
||||
|
||||
it('.type() - type into a DOM element', () => {
|
||||
// https://on.cypress.io/type
|
||||
cy.get('.action-email')
|
||||
.type('fake@email.com').should('have.value', 'fake@email.com')
|
||||
it('.type() - type into a DOM element', () => {
|
||||
// https://on.cypress.io/type
|
||||
cy.get('.action-email')
|
||||
.type('fake@email.com').should('have.value', 'fake@email.com')
|
||||
|
||||
// .type() with special character sequences
|
||||
.type('{leftarrow}{rightarrow}{uparrow}{downarrow}')
|
||||
.type('{del}{selectall}{backspace}')
|
||||
// .type() with special character sequences
|
||||
.type('{leftarrow}{rightarrow}{uparrow}{downarrow}')
|
||||
.type('{del}{selectall}{backspace}')
|
||||
|
||||
// .type() with key modifiers
|
||||
.type('{alt}{option}') //these are equivalent
|
||||
.type('{ctrl}{control}') //these are equivalent
|
||||
.type('{meta}{command}{cmd}') //these are equivalent
|
||||
.type('{shift}')
|
||||
// .type() with key modifiers
|
||||
.type('{alt}{option}') //these are equivalent
|
||||
.type('{ctrl}{control}') //these are equivalent
|
||||
.type('{meta}{command}{cmd}') //these are equivalent
|
||||
.type('{shift}')
|
||||
|
||||
// Delay each keypress by 0.1 sec
|
||||
.type('slow.typing@email.com', { delay: 100 })
|
||||
.should('have.value', 'slow.typing@email.com')
|
||||
// Delay each keypress by 0.1 sec
|
||||
.type('slow.typing@email.com', {delay: 100})
|
||||
.should('have.value', 'slow.typing@email.com')
|
||||
|
||||
cy.get('.action-disabled')
|
||||
// Ignore error checking prior to type
|
||||
// like whether the input is visible or disabled
|
||||
.type('disabled error checking', { force: true })
|
||||
.should('have.value', 'disabled error checking')
|
||||
})
|
||||
cy.get('.action-disabled')
|
||||
// Ignore error checking prior to type
|
||||
// like whether the input is visible or disabled
|
||||
.type('disabled error checking', {force: true})
|
||||
.should('have.value', 'disabled error checking')
|
||||
})
|
||||
|
||||
it('.focus() - focus on a DOM element', () => {
|
||||
// https://on.cypress.io/focus
|
||||
cy.get('.action-focus').focus()
|
||||
.should('have.class', 'focus')
|
||||
.prev().should('have.attr', 'style', 'color: orange;')
|
||||
})
|
||||
it('.focus() - focus on a DOM element', () => {
|
||||
// https://on.cypress.io/focus
|
||||
cy.get('.action-focus').focus()
|
||||
.should('have.class', 'focus')
|
||||
.prev().should('have.attr', 'style', 'color: orange;')
|
||||
})
|
||||
|
||||
it('.blur() - blur off a DOM element', () => {
|
||||
// https://on.cypress.io/blur
|
||||
cy.get('.action-blur').type('About to blur').blur()
|
||||
.should('have.class', 'error')
|
||||
.prev().should('have.attr', 'style', 'color: red;')
|
||||
})
|
||||
it('.blur() - blur off a DOM element', () => {
|
||||
// https://on.cypress.io/blur
|
||||
cy.get('.action-blur').type('About to blur').blur()
|
||||
.should('have.class', 'error')
|
||||
.prev().should('have.attr', 'style', 'color: red;')
|
||||
})
|
||||
|
||||
it('.clear() - clears an input or textarea element', () => {
|
||||
// https://on.cypress.io/clear
|
||||
cy.get('.action-clear').type('Clear this text')
|
||||
.should('have.value', 'Clear this text')
|
||||
.clear()
|
||||
.should('have.value', '')
|
||||
})
|
||||
it('.clear() - clears an input or textarea element', () => {
|
||||
// https://on.cypress.io/clear
|
||||
cy.get('.action-clear').type('Clear this text')
|
||||
.should('have.value', 'Clear this text')
|
||||
.clear()
|
||||
.should('have.value', '')
|
||||
})
|
||||
|
||||
it('.submit() - submit a form', () => {
|
||||
// https://on.cypress.io/submit
|
||||
cy.get('.action-form')
|
||||
.find('[type="text"]').type('HALFOFF')
|
||||
it('.submit() - submit a form', () => {
|
||||
// https://on.cypress.io/submit
|
||||
cy.get('.action-form')
|
||||
.find('[type="text"]').type('HALFOFF')
|
||||
|
||||
cy.get('.action-form').submit()
|
||||
.next().should('contain', 'Your form has been submitted!')
|
||||
})
|
||||
cy.get('.action-form').submit()
|
||||
.next().should('contain', 'Your form has been submitted!')
|
||||
})
|
||||
|
||||
it('.click() - click on a DOM element', () => {
|
||||
// https://on.cypress.io/click
|
||||
cy.get('.action-btn').click()
|
||||
it('.click() - click on a DOM element', () => {
|
||||
// https://on.cypress.io/click
|
||||
cy.get('.action-btn').click()
|
||||
|
||||
// You can click on 9 specific positions of an element:
|
||||
// -----------------------------------
|
||||
// | topLeft top topRight |
|
||||
// | |
|
||||
// | |
|
||||
// | |
|
||||
// | left center right |
|
||||
// | |
|
||||
// | |
|
||||
// | |
|
||||
// | bottomLeft bottom bottomRight |
|
||||
// -----------------------------------
|
||||
// You can click on 9 specific positions of an element:
|
||||
// -----------------------------------
|
||||
// | topLeft top topRight |
|
||||
// | |
|
||||
// | |
|
||||
// | |
|
||||
// | left center right |
|
||||
// | |
|
||||
// | |
|
||||
// | |
|
||||
// | bottomLeft bottom bottomRight |
|
||||
// -----------------------------------
|
||||
|
||||
// clicking in the center of the element is the default
|
||||
cy.get('#action-canvas').click()
|
||||
// clicking in the center of the element is the default
|
||||
cy.get('#action-canvas').click()
|
||||
|
||||
cy.get('#action-canvas').click('topLeft')
|
||||
cy.get('#action-canvas').click('top')
|
||||
cy.get('#action-canvas').click('topRight')
|
||||
cy.get('#action-canvas').click('left')
|
||||
cy.get('#action-canvas').click('right')
|
||||
cy.get('#action-canvas').click('bottomLeft')
|
||||
cy.get('#action-canvas').click('bottom')
|
||||
cy.get('#action-canvas').click('bottomRight')
|
||||
cy.get('#action-canvas').click('topLeft')
|
||||
cy.get('#action-canvas').click('top')
|
||||
cy.get('#action-canvas').click('topRight')
|
||||
cy.get('#action-canvas').click('left')
|
||||
cy.get('#action-canvas').click('right')
|
||||
cy.get('#action-canvas').click('bottomLeft')
|
||||
cy.get('#action-canvas').click('bottom')
|
||||
cy.get('#action-canvas').click('bottomRight')
|
||||
|
||||
// .click() accepts an x and y coordinate
|
||||
// that controls where the click occurs :)
|
||||
// .click() accepts an x and y coordinate
|
||||
// that controls where the click occurs :)
|
||||
|
||||
cy.get('#action-canvas')
|
||||
.click(80, 75) // click 80px on x coord and 75px on y coord
|
||||
.click(170, 75)
|
||||
.click(80, 165)
|
||||
.click(100, 185)
|
||||
.click(125, 190)
|
||||
.click(150, 185)
|
||||
.click(170, 165)
|
||||
cy.get('#action-canvas')
|
||||
.click(80, 75) // click 80px on x coord and 75px on y coord
|
||||
.click(170, 75)
|
||||
.click(80, 165)
|
||||
.click(100, 185)
|
||||
.click(125, 190)
|
||||
.click(150, 185)
|
||||
.click(170, 165)
|
||||
|
||||
// click multiple elements by passing multiple: true
|
||||
cy.get('.action-labels>.label').click({ multiple: true })
|
||||
// click multiple elements by passing multiple: true
|
||||
cy.get('.action-labels>.label').click({multiple: true})
|
||||
|
||||
// Ignore error checking prior to clicking
|
||||
cy.get('.action-opacity>.btn').click({ force: true })
|
||||
})
|
||||
// Ignore error checking prior to clicking
|
||||
cy.get('.action-opacity>.btn').click({force: true})
|
||||
})
|
||||
|
||||
it('.dblclick() - double click on a DOM element', () => {
|
||||
// https://on.cypress.io/dblclick
|
||||
it('.dblclick() - double click on a DOM element', () => {
|
||||
// https://on.cypress.io/dblclick
|
||||
|
||||
// Our app has a listener on 'dblclick' event in our 'scripts.js'
|
||||
// that hides the div and shows an input on double click
|
||||
cy.get('.action-div').dblclick().should('not.be.visible')
|
||||
cy.get('.action-input-hidden').should('be.visible')
|
||||
})
|
||||
// Our app has a listener on 'dblclick' event in our 'scripts.js'
|
||||
// that hides the div and shows an input on double click
|
||||
cy.get('.action-div').dblclick().should('not.be.visible')
|
||||
cy.get('.action-input-hidden').should('be.visible')
|
||||
})
|
||||
|
||||
it('.rightclick() - right click on a DOM element', () => {
|
||||
// https://on.cypress.io/rightclick
|
||||
it('.rightclick() - right click on a DOM element', () => {
|
||||
// https://on.cypress.io/rightclick
|
||||
|
||||
// Our app has a listener on 'contextmenu' event in our 'scripts.js'
|
||||
// that hides the div and shows an input on right click
|
||||
cy.get('.rightclick-action-div').rightclick().should('not.be.visible')
|
||||
cy.get('.rightclick-action-input-hidden').should('be.visible')
|
||||
})
|
||||
// Our app has a listener on 'contextmenu' event in our 'scripts.js'
|
||||
// that hides the div and shows an input on right click
|
||||
cy.get('.rightclick-action-div').rightclick().should('not.be.visible')
|
||||
cy.get('.rightclick-action-input-hidden').should('be.visible')
|
||||
})
|
||||
|
||||
it('.check() - check a checkbox or radio element', () => {
|
||||
// https://on.cypress.io/check
|
||||
it('.check() - check a checkbox or radio element', () => {
|
||||
// https://on.cypress.io/check
|
||||
|
||||
// By default, .check() will check all
|
||||
// matching checkbox or radio elements in succession, one after another
|
||||
cy.get('.action-checkboxes [type="checkbox"]').not('[disabled]')
|
||||
.check().should('be.checked')
|
||||
// By default, .check() will check all
|
||||
// matching checkbox or radio elements in succession, one after another
|
||||
cy.get('.action-checkboxes [type="checkbox"]').not('[disabled]')
|
||||
.check().should('be.checked')
|
||||
|
||||
cy.get('.action-radios [type="radio"]').not('[disabled]')
|
||||
.check().should('be.checked')
|
||||
cy.get('.action-radios [type="radio"]').not('[disabled]')
|
||||
.check().should('be.checked')
|
||||
|
||||
// .check() accepts a value argument
|
||||
cy.get('.action-radios [type="radio"]')
|
||||
.check('radio1').should('be.checked')
|
||||
// .check() accepts a value argument
|
||||
cy.get('.action-radios [type="radio"]')
|
||||
.check('radio1').should('be.checked')
|
||||
|
||||
// .check() accepts an array of values
|
||||
cy.get('.action-multiple-checkboxes [type="checkbox"]')
|
||||
.check(['checkbox1', 'checkbox2']).should('be.checked')
|
||||
// .check() accepts an array of values
|
||||
cy.get('.action-multiple-checkboxes [type="checkbox"]')
|
||||
.check(['checkbox1', 'checkbox2']).should('be.checked')
|
||||
|
||||
// Ignore error checking prior to checking
|
||||
cy.get('.action-checkboxes [disabled]')
|
||||
.check({ force: true }).should('be.checked')
|
||||
// Ignore error checking prior to checking
|
||||
cy.get('.action-checkboxes [disabled]')
|
||||
.check({force: true}).should('be.checked')
|
||||
|
||||
cy.get('.action-radios [type="radio"]')
|
||||
.check('radio3', { force: true }).should('be.checked')
|
||||
})
|
||||
cy.get('.action-radios [type="radio"]')
|
||||
.check('radio3', {force: true}).should('be.checked')
|
||||
})
|
||||
|
||||
it('.uncheck() - uncheck a checkbox element', () => {
|
||||
// https://on.cypress.io/uncheck
|
||||
it('.uncheck() - uncheck a checkbox element', () => {
|
||||
// https://on.cypress.io/uncheck
|
||||
|
||||
// By default, .uncheck() will uncheck all matching
|
||||
// checkbox elements in succession, one after another
|
||||
cy.get('.action-check [type="checkbox"]')
|
||||
.not('[disabled]')
|
||||
.uncheck().should('not.be.checked')
|
||||
// By default, .uncheck() will uncheck all matching
|
||||
// checkbox elements in succession, one after another
|
||||
cy.get('.action-check [type="checkbox"]')
|
||||
.not('[disabled]')
|
||||
.uncheck().should('not.be.checked')
|
||||
|
||||
// .uncheck() accepts a value argument
|
||||
cy.get('.action-check [type="checkbox"]')
|
||||
.check('checkbox1')
|
||||
.uncheck('checkbox1').should('not.be.checked')
|
||||
// .uncheck() accepts a value argument
|
||||
cy.get('.action-check [type="checkbox"]')
|
||||
.check('checkbox1')
|
||||
.uncheck('checkbox1').should('not.be.checked')
|
||||
|
||||
// .uncheck() accepts an array of values
|
||||
cy.get('.action-check [type="checkbox"]')
|
||||
.check(['checkbox1', 'checkbox3'])
|
||||
.uncheck(['checkbox1', 'checkbox3']).should('not.be.checked')
|
||||
// .uncheck() accepts an array of values
|
||||
cy.get('.action-check [type="checkbox"]')
|
||||
.check(['checkbox1', 'checkbox3'])
|
||||
.uncheck(['checkbox1', 'checkbox3']).should('not.be.checked')
|
||||
|
||||
// Ignore error checking prior to unchecking
|
||||
cy.get('.action-check [disabled]')
|
||||
.uncheck({ force: true }).should('not.be.checked')
|
||||
})
|
||||
// Ignore error checking prior to unchecking
|
||||
cy.get('.action-check [disabled]')
|
||||
.uncheck({force: true}).should('not.be.checked')
|
||||
})
|
||||
|
||||
it('.select() - select an option in a <select> element', () => {
|
||||
// https://on.cypress.io/select
|
||||
it('.select() - select an option in a <select> element', () => {
|
||||
// https://on.cypress.io/select
|
||||
|
||||
// at first, no option should be selected
|
||||
cy.get('.action-select')
|
||||
.should('have.value', '--Select a fruit--')
|
||||
// at first, no option should be selected
|
||||
cy.get('.action-select')
|
||||
.should('have.value', '--Select a fruit--')
|
||||
|
||||
// Select option(s) with matching text content
|
||||
cy.get('.action-select').select('apples')
|
||||
// confirm the apples were selected
|
||||
// note that each value starts with "fr-" in our HTML
|
||||
cy.get('.action-select').should('have.value', 'fr-apples')
|
||||
// Select option(s) with matching text content
|
||||
cy.get('.action-select').select('apples')
|
||||
// confirm the apples were selected
|
||||
// note that each value starts with "fr-" in our HTML
|
||||
cy.get('.action-select').should('have.value', 'fr-apples')
|
||||
|
||||
cy.get('.action-select-multiple')
|
||||
.select(['apples', 'oranges', 'bananas'])
|
||||
// when getting multiple values, invoke "val" method first
|
||||
.invoke('val')
|
||||
.should('deep.equal', ['fr-apples', 'fr-oranges', 'fr-bananas'])
|
||||
cy.get('.action-select-multiple')
|
||||
.select(['apples', 'oranges', 'bananas'])
|
||||
// when getting multiple values, invoke "val" method first
|
||||
.invoke('val')
|
||||
.should('deep.equal', ['fr-apples', 'fr-oranges', 'fr-bananas'])
|
||||
|
||||
// Select option(s) with matching value
|
||||
cy.get('.action-select').select('fr-bananas')
|
||||
// can attach an assertion right away to the element
|
||||
.should('have.value', 'fr-bananas')
|
||||
// Select option(s) with matching value
|
||||
cy.get('.action-select').select('fr-bananas')
|
||||
// can attach an assertion right away to the element
|
||||
.should('have.value', 'fr-bananas')
|
||||
|
||||
cy.get('.action-select-multiple')
|
||||
.select(['fr-apples', 'fr-oranges', 'fr-bananas'])
|
||||
.invoke('val')
|
||||
.should('deep.equal', ['fr-apples', 'fr-oranges', 'fr-bananas'])
|
||||
cy.get('.action-select-multiple')
|
||||
.select(['fr-apples', 'fr-oranges', 'fr-bananas'])
|
||||
.invoke('val')
|
||||
.should('deep.equal', ['fr-apples', 'fr-oranges', 'fr-bananas'])
|
||||
|
||||
// assert the selected values include oranges
|
||||
cy.get('.action-select-multiple')
|
||||
.invoke('val').should('include', 'fr-oranges')
|
||||
})
|
||||
// assert the selected values include oranges
|
||||
cy.get('.action-select-multiple')
|
||||
.invoke('val').should('include', 'fr-oranges')
|
||||
})
|
||||
|
||||
it('.scrollIntoView() - scroll an element into view', () => {
|
||||
// https://on.cypress.io/scrollintoview
|
||||
it('.scrollIntoView() - scroll an element into view', () => {
|
||||
// https://on.cypress.io/scrollintoview
|
||||
|
||||
// normally all of these buttons are hidden,
|
||||
// because they're not within
|
||||
// the viewable area of their parent
|
||||
// (we need to scroll to see them)
|
||||
cy.get('#scroll-horizontal button')
|
||||
.should('not.be.visible')
|
||||
// normally all of these buttons are hidden,
|
||||
// because they're not within
|
||||
// the viewable area of their parent
|
||||
// (we need to scroll to see them)
|
||||
cy.get('#scroll-horizontal button')
|
||||
.should('not.be.visible')
|
||||
|
||||
// scroll the button into view, as if the user had scrolled
|
||||
cy.get('#scroll-horizontal button').scrollIntoView()
|
||||
.should('be.visible')
|
||||
// scroll the button into view, as if the user had scrolled
|
||||
cy.get('#scroll-horizontal button').scrollIntoView()
|
||||
.should('be.visible')
|
||||
|
||||
cy.get('#scroll-vertical button')
|
||||
.should('not.be.visible')
|
||||
cy.get('#scroll-vertical button')
|
||||
.should('not.be.visible')
|
||||
|
||||
// Cypress handles the scroll direction needed
|
||||
cy.get('#scroll-vertical button').scrollIntoView()
|
||||
.should('be.visible')
|
||||
// Cypress handles the scroll direction needed
|
||||
cy.get('#scroll-vertical button').scrollIntoView()
|
||||
.should('be.visible')
|
||||
|
||||
cy.get('#scroll-both button')
|
||||
.should('not.be.visible')
|
||||
cy.get('#scroll-both button')
|
||||
.should('not.be.visible')
|
||||
|
||||
// Cypress knows to scroll to the right and down
|
||||
cy.get('#scroll-both button').scrollIntoView()
|
||||
.should('be.visible')
|
||||
})
|
||||
// Cypress knows to scroll to the right and down
|
||||
cy.get('#scroll-both button').scrollIntoView()
|
||||
.should('be.visible')
|
||||
})
|
||||
|
||||
it('.trigger() - trigger an event on a DOM element', () => {
|
||||
// https://on.cypress.io/trigger
|
||||
it('.trigger() - trigger an event on a DOM element', () => {
|
||||
// https://on.cypress.io/trigger
|
||||
|
||||
// To interact with a range input (slider)
|
||||
// we need to set its value & trigger the
|
||||
// event to signal it changed
|
||||
// To interact with a range input (slider)
|
||||
// we need to set its value & trigger the
|
||||
// event to signal it changed
|
||||
|
||||
// Here, we invoke jQuery's val() method to set
|
||||
// the value and trigger the 'change' event
|
||||
cy.get('.trigger-input-range')
|
||||
.invoke('val', 25)
|
||||
.trigger('change')
|
||||
.get('input[type=range]').siblings('p')
|
||||
.should('have.text', '25')
|
||||
})
|
||||
// Here, we invoke jQuery's val() method to set
|
||||
// the value and trigger the 'change' event
|
||||
cy.get('.trigger-input-range')
|
||||
.invoke('val', 25)
|
||||
.trigger('change')
|
||||
.get('input[type=range]').siblings('p')
|
||||
.should('have.text', '25')
|
||||
})
|
||||
|
||||
it('cy.scrollTo() - scroll the window or element to a position', () => {
|
||||
// https://on.cypress.io/scrollto
|
||||
it('cy.scrollTo() - scroll the window or element to a position', () => {
|
||||
// https://on.cypress.io/scrollto
|
||||
|
||||
// You can scroll to 9 specific positions of an element:
|
||||
// -----------------------------------
|
||||
// | topLeft top topRight |
|
||||
// | |
|
||||
// | |
|
||||
// | |
|
||||
// | left center right |
|
||||
// | |
|
||||
// | |
|
||||
// | |
|
||||
// | bottomLeft bottom bottomRight |
|
||||
// -----------------------------------
|
||||
// You can scroll to 9 specific positions of an element:
|
||||
// -----------------------------------
|
||||
// | topLeft top topRight |
|
||||
// | |
|
||||
// | |
|
||||
// | |
|
||||
// | left center right |
|
||||
// | |
|
||||
// | |
|
||||
// | |
|
||||
// | bottomLeft bottom bottomRight |
|
||||
// -----------------------------------
|
||||
|
||||
// if you chain .scrollTo() off of cy, we will
|
||||
// scroll the entire window
|
||||
cy.scrollTo('bottom')
|
||||
// if you chain .scrollTo() off of cy, we will
|
||||
// scroll the entire window
|
||||
cy.scrollTo('bottom')
|
||||
|
||||
cy.get('#scrollable-horizontal').scrollTo('right')
|
||||
cy.get('#scrollable-horizontal').scrollTo('right')
|
||||
|
||||
// or you can scroll to a specific coordinate:
|
||||
// (x axis, y axis) in pixels
|
||||
cy.get('#scrollable-vertical').scrollTo(250, 250)
|
||||
// or you can scroll to a specific coordinate:
|
||||
// (x axis, y axis) in pixels
|
||||
cy.get('#scrollable-vertical').scrollTo(250, 250)
|
||||
|
||||
// or you can scroll to a specific percentage
|
||||
// of the (width, height) of the element
|
||||
cy.get('#scrollable-both').scrollTo('75%', '25%')
|
||||
// or you can scroll to a specific percentage
|
||||
// of the (width, height) of the element
|
||||
cy.get('#scrollable-both').scrollTo('75%', '25%')
|
||||
|
||||
// control the easing of the scroll (default is 'swing')
|
||||
cy.get('#scrollable-vertical').scrollTo('center', { easing: 'linear' })
|
||||
// control the easing of the scroll (default is 'swing')
|
||||
cy.get('#scrollable-vertical').scrollTo('center', {easing: 'linear'})
|
||||
|
||||
// control the duration of the scroll (in ms)
|
||||
cy.get('#scrollable-both').scrollTo('center', { duration: 2000 })
|
||||
})
|
||||
// control the duration of the scroll (in ms)
|
||||
cy.get('#scrollable-both').scrollTo('center', {duration: 2000})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Aliasing', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/aliasing')
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/aliasing')
|
||||
})
|
||||
|
||||
it('.as() - alias a DOM element for later use', () => {
|
||||
// https://on.cypress.io/as
|
||||
it('.as() - alias a DOM element for later use', () => {
|
||||
// https://on.cypress.io/as
|
||||
|
||||
// Alias a DOM element for use later
|
||||
// We don't have to traverse to the element
|
||||
// later in our code, we reference it with @
|
||||
// Alias a DOM element for use later
|
||||
// We don't have to traverse to the element
|
||||
// later in our code, we reference it with @
|
||||
|
||||
cy.get('.as-table').find('tbody>tr')
|
||||
.first().find('td').first()
|
||||
.find('button').as('firstBtn')
|
||||
cy.get('.as-table').find('tbody>tr')
|
||||
.first().find('td').first()
|
||||
.find('button').as('firstBtn')
|
||||
|
||||
// when we reference the alias, we place an
|
||||
// @ in front of its name
|
||||
cy.get('@firstBtn').click()
|
||||
// when we reference the alias, we place an
|
||||
// @ in front of its name
|
||||
cy.get('@firstBtn').click()
|
||||
|
||||
cy.get('@firstBtn')
|
||||
.should('have.class', 'btn-success')
|
||||
.and('contain', 'Changed')
|
||||
})
|
||||
cy.get('@firstBtn')
|
||||
.should('have.class', 'btn-success')
|
||||
.and('contain', 'Changed')
|
||||
})
|
||||
|
||||
it('.as() - alias a route for later use', () => {
|
||||
// Alias the route to wait for its response
|
||||
cy.intercept('GET', '**/comments/*').as('getComment')
|
||||
it('.as() - alias a route for later use', () => {
|
||||
// Alias the route to wait for its response
|
||||
cy.intercept('GET', '**/comments/*').as('getComment')
|
||||
|
||||
// we have code that gets a comment when
|
||||
// the button is clicked in scripts.js
|
||||
cy.get('.network-btn').click()
|
||||
// we have code that gets a comment when
|
||||
// the button is clicked in scripts.js
|
||||
cy.get('.network-btn').click()
|
||||
|
||||
// https://on.cypress.io/wait
|
||||
cy.wait('@getComment').its('response.statusCode').should('eq', 200)
|
||||
})
|
||||
// https://on.cypress.io/wait
|
||||
cy.wait('@getComment').its('response.statusCode').should('eq', 200)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,177 +1,177 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Assertions', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/assertions')
|
||||
})
|
||||
|
||||
describe('Implicit Assertions', () => {
|
||||
it('.should() - make an assertion about the current subject', () => {
|
||||
// https://on.cypress.io/should
|
||||
cy.get('.assertion-table')
|
||||
.find('tbody tr:last')
|
||||
.should('have.class', 'success')
|
||||
.find('td')
|
||||
.first()
|
||||
// checking the text of the <td> element in various ways
|
||||
.should('have.text', 'Column content')
|
||||
.should('contain', 'Column content')
|
||||
.should('have.html', 'Column content')
|
||||
// chai-jquery uses "is()" to check if element matches selector
|
||||
.should('match', 'td')
|
||||
// to match text content against a regular expression
|
||||
// first need to invoke jQuery method text()
|
||||
// and then match using regular expression
|
||||
.invoke('text')
|
||||
.should('match', /column content/i)
|
||||
|
||||
// a better way to check element's text content against a regular expression
|
||||
// is to use "cy.contains"
|
||||
// https://on.cypress.io/contains
|
||||
cy.get('.assertion-table')
|
||||
.find('tbody tr:last')
|
||||
// finds first <td> element with text content matching regular expression
|
||||
.contains('td', /column content/i)
|
||||
.should('be.visible')
|
||||
|
||||
// for more information about asserting element's text
|
||||
// see https://on.cypress.io/using-cypress-faq#How-do-I-get-an-element’s-text-contents
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/assertions')
|
||||
})
|
||||
|
||||
it('.and() - chain multiple assertions together', () => {
|
||||
// https://on.cypress.io/and
|
||||
cy.get('.assertions-link')
|
||||
.should('have.class', 'active')
|
||||
.and('have.attr', 'href')
|
||||
.and('include', 'cypress.io')
|
||||
})
|
||||
})
|
||||
describe('Implicit Assertions', () => {
|
||||
it('.should() - make an assertion about the current subject', () => {
|
||||
// https://on.cypress.io/should
|
||||
cy.get('.assertion-table')
|
||||
.find('tbody tr:last')
|
||||
.should('have.class', 'success')
|
||||
.find('td')
|
||||
.first()
|
||||
// checking the text of the <td> element in various ways
|
||||
.should('have.text', 'Column content')
|
||||
.should('contain', 'Column content')
|
||||
.should('have.html', 'Column content')
|
||||
// chai-jquery uses "is()" to check if element matches selector
|
||||
.should('match', 'td')
|
||||
// to match text content against a regular expression
|
||||
// first need to invoke jQuery method text()
|
||||
// and then match using regular expression
|
||||
.invoke('text')
|
||||
.should('match', /column content/i)
|
||||
|
||||
describe('Explicit Assertions', () => {
|
||||
// https://on.cypress.io/assertions
|
||||
it('expect - make an assertion about a specified subject', () => {
|
||||
// We can use Chai's BDD style assertions
|
||||
expect(true).to.be.true
|
||||
const o = { foo: 'bar' }
|
||||
// a better way to check element's text content against a regular expression
|
||||
// is to use "cy.contains"
|
||||
// https://on.cypress.io/contains
|
||||
cy.get('.assertion-table')
|
||||
.find('tbody tr:last')
|
||||
// finds first <td> element with text content matching regular expression
|
||||
.contains('td', /column content/i)
|
||||
.should('be.visible')
|
||||
|
||||
expect(o).to.equal(o)
|
||||
expect(o).to.deep.equal({ foo: 'bar' })
|
||||
// matching text using regular expression
|
||||
expect('FooBar').to.match(/bar$/i)
|
||||
})
|
||||
// for more information about asserting element's text
|
||||
// see https://on.cypress.io/using-cypress-faq#How-do-I-get-an-element’s-text-contents
|
||||
})
|
||||
|
||||
it('pass your own callback function to should()', () => {
|
||||
// Pass a function to should that can have any number
|
||||
// of explicit assertions within it.
|
||||
// The ".should(cb)" function will be retried
|
||||
// automatically until it passes all your explicit assertions or times out.
|
||||
cy.get('.assertions-p')
|
||||
.find('p')
|
||||
.should(($p) => {
|
||||
// https://on.cypress.io/$
|
||||
// return an array of texts from all of the p's
|
||||
// @ts-ignore TS6133 unused variable
|
||||
const texts = $p.map((i, el) => Cypress.$(el).text())
|
||||
|
||||
// jquery map returns jquery object
|
||||
// and .get() convert this to simple array
|
||||
const paragraphs = texts.get()
|
||||
|
||||
// array should have length of 3
|
||||
expect(paragraphs, 'has 3 paragraphs').to.have.length(3)
|
||||
|
||||
// use second argument to expect(...) to provide clear
|
||||
// message with each assertion
|
||||
expect(paragraphs, 'has expected text in each paragraph').to.deep.eq([
|
||||
'Some text from first p',
|
||||
'More text from second p',
|
||||
'And even more text from third p',
|
||||
])
|
||||
it('.and() - chain multiple assertions together', () => {
|
||||
// https://on.cypress.io/and
|
||||
cy.get('.assertions-link')
|
||||
.should('have.class', 'active')
|
||||
.and('have.attr', 'href')
|
||||
.and('include', 'cypress.io')
|
||||
})
|
||||
})
|
||||
|
||||
it('finds element by class name regex', () => {
|
||||
cy.get('.docs-header')
|
||||
.find('div')
|
||||
// .should(cb) callback function will be retried
|
||||
.should(($div) => {
|
||||
expect($div).to.have.length(1)
|
||||
describe('Explicit Assertions', () => {
|
||||
// https://on.cypress.io/assertions
|
||||
it('expect - make an assertion about a specified subject', () => {
|
||||
// We can use Chai's BDD style assertions
|
||||
expect(true).to.be.true
|
||||
const o = {foo: 'bar'}
|
||||
|
||||
const className = $div[0].className
|
||||
|
||||
expect(className).to.match(/heading-/)
|
||||
expect(o).to.equal(o)
|
||||
expect(o).to.deep.equal({foo: 'bar'})
|
||||
// matching text using regular expression
|
||||
expect('FooBar').to.match(/bar$/i)
|
||||
})
|
||||
// .then(cb) callback is not retried,
|
||||
// it either passes or fails
|
||||
.then(($div) => {
|
||||
expect($div, 'text content').to.have.text('Introduction')
|
||||
|
||||
it('pass your own callback function to should()', () => {
|
||||
// Pass a function to should that can have any number
|
||||
// of explicit assertions within it.
|
||||
// The ".should(cb)" function will be retried
|
||||
// automatically until it passes all your explicit assertions or times out.
|
||||
cy.get('.assertions-p')
|
||||
.find('p')
|
||||
.should(($p) => {
|
||||
// https://on.cypress.io/$
|
||||
// return an array of texts from all of the p's
|
||||
// @ts-ignore TS6133 unused variable
|
||||
const texts = $p.map((i, el) => Cypress.$(el).text())
|
||||
|
||||
// jquery map returns jquery object
|
||||
// and .get() convert this to simple array
|
||||
const paragraphs = texts.get()
|
||||
|
||||
// array should have length of 3
|
||||
expect(paragraphs, 'has 3 paragraphs').to.have.length(3)
|
||||
|
||||
// use second argument to expect(...) to provide clear
|
||||
// message with each assertion
|
||||
expect(paragraphs, 'has expected text in each paragraph').to.deep.eq([
|
||||
'Some text from first p',
|
||||
'More text from second p',
|
||||
'And even more text from third p',
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
it('finds element by class name regex', () => {
|
||||
cy.get('.docs-header')
|
||||
.find('div')
|
||||
// .should(cb) callback function will be retried
|
||||
.should(($div) => {
|
||||
expect($div).to.have.length(1)
|
||||
|
||||
const className = $div[0].className
|
||||
|
||||
expect(className).to.match(/heading-/)
|
||||
})
|
||||
// .then(cb) callback is not retried,
|
||||
// it either passes or fails
|
||||
.then(($div) => {
|
||||
expect($div, 'text content').to.have.text('Introduction')
|
||||
})
|
||||
})
|
||||
|
||||
it('can throw any error', () => {
|
||||
cy.get('.docs-header')
|
||||
.find('div')
|
||||
.should(($div) => {
|
||||
if ($div.length !== 1) {
|
||||
// you can throw your own errors
|
||||
throw new Error('Did not find 1 element')
|
||||
}
|
||||
|
||||
const className = $div[0].className
|
||||
|
||||
if (!className.match(/heading-/)) {
|
||||
throw new Error(`Could not find class "heading-" in ${className}`)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
it('matches unknown text between two elements', () => {
|
||||
/**
|
||||
* Text from the first element.
|
||||
* @type {string}
|
||||
*/
|
||||
let text
|
||||
|
||||
/**
|
||||
* Normalizes passed text,
|
||||
* useful before comparing text with spaces and different capitalization.
|
||||
* @param {string} s Text to normalize
|
||||
*/
|
||||
const normalizeText = (s) => s.replace(/\s/g, '').toLowerCase()
|
||||
|
||||
cy.get('.two-elements')
|
||||
.find('.first')
|
||||
.then(($first) => {
|
||||
// save text from the first element
|
||||
text = normalizeText($first.text())
|
||||
})
|
||||
|
||||
cy.get('.two-elements')
|
||||
.find('.second')
|
||||
.should(($div) => {
|
||||
// we can massage text before comparing
|
||||
const secondText = normalizeText($div.text())
|
||||
|
||||
expect(secondText, 'second text').to.equal(text)
|
||||
})
|
||||
})
|
||||
|
||||
it('assert - assert shape of an object', () => {
|
||||
const person = {
|
||||
name: 'Joe',
|
||||
age: 20,
|
||||
}
|
||||
|
||||
assert.isObject(person, 'value is object')
|
||||
})
|
||||
|
||||
it('retries the should callback until assertions pass', () => {
|
||||
cy.get('#random-number')
|
||||
.should(($div) => {
|
||||
const n = parseFloat($div.text())
|
||||
|
||||
expect(n).to.be.gte(1).and.be.lte(10)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('can throw any error', () => {
|
||||
cy.get('.docs-header')
|
||||
.find('div')
|
||||
.should(($div) => {
|
||||
if ($div.length !== 1) {
|
||||
// you can throw your own errors
|
||||
throw new Error('Did not find 1 element')
|
||||
}
|
||||
|
||||
const className = $div[0].className
|
||||
|
||||
if (!className.match(/heading-/)) {
|
||||
throw new Error(`Could not find class "heading-" in ${className}`)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
it('matches unknown text between two elements', () => {
|
||||
/**
|
||||
* Text from the first element.
|
||||
* @type {string}
|
||||
*/
|
||||
let text
|
||||
|
||||
/**
|
||||
* Normalizes passed text,
|
||||
* useful before comparing text with spaces and different capitalization.
|
||||
* @param {string} s Text to normalize
|
||||
*/
|
||||
const normalizeText = (s) => s.replace(/\s/g, '').toLowerCase()
|
||||
|
||||
cy.get('.two-elements')
|
||||
.find('.first')
|
||||
.then(($first) => {
|
||||
// save text from the first element
|
||||
text = normalizeText($first.text())
|
||||
})
|
||||
|
||||
cy.get('.two-elements')
|
||||
.find('.second')
|
||||
.should(($div) => {
|
||||
// we can massage text before comparing
|
||||
const secondText = normalizeText($div.text())
|
||||
|
||||
expect(secondText, 'second text').to.equal(text)
|
||||
})
|
||||
})
|
||||
|
||||
it('assert - assert shape of an object', () => {
|
||||
const person = {
|
||||
name: 'Joe',
|
||||
age: 20,
|
||||
}
|
||||
|
||||
assert.isObject(person, 'value is object')
|
||||
})
|
||||
|
||||
it('retries the should callback until assertions pass', () => {
|
||||
cy.get('#random-number')
|
||||
.should(($div) => {
|
||||
const n = parseFloat($div.text())
|
||||
|
||||
expect(n).to.be.gte(1).and.be.lte(10)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,97 +1,97 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Connectors', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/connectors')
|
||||
})
|
||||
|
||||
it('.each() - iterate over an array of elements', () => {
|
||||
// https://on.cypress.io/each
|
||||
cy.get('.connectors-each-ul>li')
|
||||
.each(($el, index, $list) => {
|
||||
console.log($el, index, $list)
|
||||
})
|
||||
})
|
||||
|
||||
it('.its() - get properties on the current subject', () => {
|
||||
// https://on.cypress.io/its
|
||||
cy.get('.connectors-its-ul>li')
|
||||
// calls the 'length' property yielding that value
|
||||
.its('length')
|
||||
.should('be.gt', 2)
|
||||
})
|
||||
|
||||
it('.invoke() - invoke a function on the current subject', () => {
|
||||
// our div is hidden in our script.js
|
||||
// $('.connectors-div').hide()
|
||||
|
||||
// https://on.cypress.io/invoke
|
||||
cy.get('.connectors-div').should('be.hidden')
|
||||
// call the jquery method 'show' on the 'div.container'
|
||||
.invoke('show')
|
||||
.should('be.visible')
|
||||
})
|
||||
|
||||
it('.spread() - spread an array as individual args to callback function', () => {
|
||||
// https://on.cypress.io/spread
|
||||
const arr = ['foo', 'bar', 'baz']
|
||||
|
||||
cy.wrap(arr).spread((foo, bar, baz) => {
|
||||
expect(foo).to.eq('foo')
|
||||
expect(bar).to.eq('bar')
|
||||
expect(baz).to.eq('baz')
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/connectors')
|
||||
})
|
||||
})
|
||||
|
||||
describe('.then()', () => {
|
||||
it('invokes a callback function with the current subject', () => {
|
||||
// https://on.cypress.io/then
|
||||
cy.get('.connectors-list > li')
|
||||
.then(($lis) => {
|
||||
expect($lis, '3 items').to.have.length(3)
|
||||
expect($lis.eq(0), 'first item').to.contain('Walk the dog')
|
||||
expect($lis.eq(1), 'second item').to.contain('Feed the cat')
|
||||
expect($lis.eq(2), 'third item').to.contain('Write JavaScript')
|
||||
it('.each() - iterate over an array of elements', () => {
|
||||
// https://on.cypress.io/each
|
||||
cy.get('.connectors-each-ul>li')
|
||||
.each(($el, index, $list) => {
|
||||
console.log($el, index, $list)
|
||||
})
|
||||
})
|
||||
|
||||
it('.its() - get properties on the current subject', () => {
|
||||
// https://on.cypress.io/its
|
||||
cy.get('.connectors-its-ul>li')
|
||||
// calls the 'length' property yielding that value
|
||||
.its('length')
|
||||
.should('be.gt', 2)
|
||||
})
|
||||
|
||||
it('.invoke() - invoke a function on the current subject', () => {
|
||||
// our div is hidden in our script.js
|
||||
// $('.connectors-div').hide()
|
||||
|
||||
// https://on.cypress.io/invoke
|
||||
cy.get('.connectors-div').should('be.hidden')
|
||||
// call the jquery method 'show' on the 'div.container'
|
||||
.invoke('show')
|
||||
.should('be.visible')
|
||||
})
|
||||
|
||||
it('.spread() - spread an array as individual args to callback function', () => {
|
||||
// https://on.cypress.io/spread
|
||||
const arr = ['foo', 'bar', 'baz']
|
||||
|
||||
cy.wrap(arr).spread((foo, bar, baz) => {
|
||||
expect(foo).to.eq('foo')
|
||||
expect(bar).to.eq('bar')
|
||||
expect(baz).to.eq('baz')
|
||||
})
|
||||
})
|
||||
|
||||
it('yields the returned value to the next command', () => {
|
||||
cy.wrap(1)
|
||||
.then((num) => {
|
||||
expect(num).to.equal(1)
|
||||
|
||||
return 2
|
||||
describe('.then()', () => {
|
||||
it('invokes a callback function with the current subject', () => {
|
||||
// https://on.cypress.io/then
|
||||
cy.get('.connectors-list > li')
|
||||
.then(($lis) => {
|
||||
expect($lis, '3 items').to.have.length(3)
|
||||
expect($lis.eq(0), 'first item').to.contain('Walk the dog')
|
||||
expect($lis.eq(1), 'second item').to.contain('Feed the cat')
|
||||
expect($lis.eq(2), 'third item').to.contain('Write JavaScript')
|
||||
})
|
||||
})
|
||||
.then((num) => {
|
||||
expect(num).to.equal(2)
|
||||
|
||||
it('yields the returned value to the next command', () => {
|
||||
cy.wrap(1)
|
||||
.then((num) => {
|
||||
expect(num).to.equal(1)
|
||||
|
||||
return 2
|
||||
})
|
||||
.then((num) => {
|
||||
expect(num).to.equal(2)
|
||||
})
|
||||
})
|
||||
|
||||
it('yields the original subject without return', () => {
|
||||
cy.wrap(1)
|
||||
.then((num) => {
|
||||
expect(num).to.equal(1)
|
||||
// note that nothing is returned from this callback
|
||||
})
|
||||
.then((num) => {
|
||||
// this callback receives the original unchanged value 1
|
||||
expect(num).to.equal(1)
|
||||
})
|
||||
})
|
||||
|
||||
it('yields the value yielded by the last Cypress command inside', () => {
|
||||
cy.wrap(1)
|
||||
.then((num) => {
|
||||
expect(num).to.equal(1)
|
||||
// note how we run a Cypress command
|
||||
// the result yielded by this Cypress command
|
||||
// will be passed to the second ".then"
|
||||
cy.wrap(2)
|
||||
})
|
||||
.then((num) => {
|
||||
// this callback receives the value yielded by "cy.wrap(2)"
|
||||
expect(num).to.equal(2)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('yields the original subject without return', () => {
|
||||
cy.wrap(1)
|
||||
.then((num) => {
|
||||
expect(num).to.equal(1)
|
||||
// note that nothing is returned from this callback
|
||||
})
|
||||
.then((num) => {
|
||||
// this callback receives the original unchanged value 1
|
||||
expect(num).to.equal(1)
|
||||
})
|
||||
})
|
||||
|
||||
it('yields the value yielded by the last Cypress command inside', () => {
|
||||
cy.wrap(1)
|
||||
.then((num) => {
|
||||
expect(num).to.equal(1)
|
||||
// note how we run a Cypress command
|
||||
// the result yielded by this Cypress command
|
||||
// will be passed to the second ".then"
|
||||
cy.wrap(2)
|
||||
})
|
||||
.then((num) => {
|
||||
// this callback receives the value yielded by "cy.wrap(2)"
|
||||
expect(num).to.equal(2)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,77 +1,77 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Cookies', () => {
|
||||
beforeEach(() => {
|
||||
Cypress.Cookies.debug(true)
|
||||
beforeEach(() => {
|
||||
Cypress.Cookies.debug(true)
|
||||
|
||||
cy.visit('https://example.cypress.io/commands/cookies')
|
||||
cy.visit('https://example.cypress.io/commands/cookies')
|
||||
|
||||
// clear cookies again after visiting to remove
|
||||
// any 3rd party cookies picked up such as cloudflare
|
||||
cy.clearCookies()
|
||||
})
|
||||
|
||||
it('cy.getCookie() - get a browser cookie', () => {
|
||||
// https://on.cypress.io/getcookie
|
||||
cy.get('#getCookie .set-a-cookie').click()
|
||||
|
||||
// cy.getCookie() yields a cookie object
|
||||
cy.getCookie('token').should('have.property', 'value', '123ABC')
|
||||
})
|
||||
|
||||
it('cy.getCookies() - get browser cookies', () => {
|
||||
// https://on.cypress.io/getcookies
|
||||
cy.getCookies().should('be.empty')
|
||||
|
||||
cy.get('#getCookies .set-a-cookie').click()
|
||||
|
||||
// cy.getCookies() yields an array of cookies
|
||||
cy.getCookies().should('have.length', 1).should((cookies) => {
|
||||
// each cookie has these properties
|
||||
expect(cookies[0]).to.have.property('name', 'token')
|
||||
expect(cookies[0]).to.have.property('value', '123ABC')
|
||||
expect(cookies[0]).to.have.property('httpOnly', false)
|
||||
expect(cookies[0]).to.have.property('secure', false)
|
||||
expect(cookies[0]).to.have.property('domain')
|
||||
expect(cookies[0]).to.have.property('path')
|
||||
// clear cookies again after visiting to remove
|
||||
// any 3rd party cookies picked up such as cloudflare
|
||||
cy.clearCookies()
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.setCookie() - set a browser cookie', () => {
|
||||
// https://on.cypress.io/setcookie
|
||||
cy.getCookies().should('be.empty')
|
||||
it('cy.getCookie() - get a browser cookie', () => {
|
||||
// https://on.cypress.io/getcookie
|
||||
cy.get('#getCookie .set-a-cookie').click()
|
||||
|
||||
cy.setCookie('foo', 'bar')
|
||||
// cy.getCookie() yields a cookie object
|
||||
cy.getCookie('token').should('have.property', 'value', '123ABC')
|
||||
})
|
||||
|
||||
// cy.getCookie() yields a cookie object
|
||||
cy.getCookie('foo').should('have.property', 'value', 'bar')
|
||||
})
|
||||
it('cy.getCookies() - get browser cookies', () => {
|
||||
// https://on.cypress.io/getcookies
|
||||
cy.getCookies().should('be.empty')
|
||||
|
||||
it('cy.clearCookie() - clear a browser cookie', () => {
|
||||
// https://on.cypress.io/clearcookie
|
||||
cy.getCookie('token').should('be.null')
|
||||
cy.get('#getCookies .set-a-cookie').click()
|
||||
|
||||
cy.get('#clearCookie .set-a-cookie').click()
|
||||
// cy.getCookies() yields an array of cookies
|
||||
cy.getCookies().should('have.length', 1).should((cookies) => {
|
||||
// each cookie has these properties
|
||||
expect(cookies[0]).to.have.property('name', 'token')
|
||||
expect(cookies[0]).to.have.property('value', '123ABC')
|
||||
expect(cookies[0]).to.have.property('httpOnly', false)
|
||||
expect(cookies[0]).to.have.property('secure', false)
|
||||
expect(cookies[0]).to.have.property('domain')
|
||||
expect(cookies[0]).to.have.property('path')
|
||||
})
|
||||
})
|
||||
|
||||
cy.getCookie('token').should('have.property', 'value', '123ABC')
|
||||
it('cy.setCookie() - set a browser cookie', () => {
|
||||
// https://on.cypress.io/setcookie
|
||||
cy.getCookies().should('be.empty')
|
||||
|
||||
// cy.clearCookies() yields null
|
||||
cy.clearCookie('token').should('be.null')
|
||||
cy.setCookie('foo', 'bar')
|
||||
|
||||
cy.getCookie('token').should('be.null')
|
||||
})
|
||||
// cy.getCookie() yields a cookie object
|
||||
cy.getCookie('foo').should('have.property', 'value', 'bar')
|
||||
})
|
||||
|
||||
it('cy.clearCookies() - clear browser cookies', () => {
|
||||
// https://on.cypress.io/clearcookies
|
||||
cy.getCookies().should('be.empty')
|
||||
it('cy.clearCookie() - clear a browser cookie', () => {
|
||||
// https://on.cypress.io/clearcookie
|
||||
cy.getCookie('token').should('be.null')
|
||||
|
||||
cy.get('#clearCookies .set-a-cookie').click()
|
||||
cy.get('#clearCookie .set-a-cookie').click()
|
||||
|
||||
cy.getCookies().should('have.length', 1)
|
||||
cy.getCookie('token').should('have.property', 'value', '123ABC')
|
||||
|
||||
// cy.clearCookies() yields null
|
||||
cy.clearCookies()
|
||||
// cy.clearCookies() yields null
|
||||
cy.clearCookie('token').should('be.null')
|
||||
|
||||
cy.getCookies().should('be.empty')
|
||||
})
|
||||
cy.getCookie('token').should('be.null')
|
||||
})
|
||||
|
||||
it('cy.clearCookies() - clear browser cookies', () => {
|
||||
// https://on.cypress.io/clearcookies
|
||||
cy.getCookies().should('be.empty')
|
||||
|
||||
cy.get('#clearCookies .set-a-cookie').click()
|
||||
|
||||
cy.getCookies().should('have.length', 1)
|
||||
|
||||
// cy.clearCookies() yields null
|
||||
cy.clearCookies()
|
||||
|
||||
cy.getCookies().should('be.empty')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,202 +1,202 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Cypress.Commands', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
|
||||
// https://on.cypress.io/custom-commands
|
||||
|
||||
it('.add() - create a custom command', () => {
|
||||
Cypress.Commands.add('console', {
|
||||
prevSubject: true,
|
||||
}, (subject, method) => {
|
||||
// the previous subject is automatically received
|
||||
// and the commands arguments are shifted
|
||||
|
||||
// allow us to change the console method used
|
||||
method = method || 'log'
|
||||
|
||||
// log the subject to the console
|
||||
// @ts-ignore TS7017
|
||||
console[method]('The subject is', subject)
|
||||
|
||||
// whatever we return becomes the new subject
|
||||
// we don't want to change the subject so
|
||||
// we return whatever was passed in
|
||||
return subject
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
|
||||
// @ts-ignore TS2339
|
||||
cy.get('button').console('info').then(($button) => {
|
||||
// subject is still $button
|
||||
// https://on.cypress.io/custom-commands
|
||||
|
||||
it('.add() - create a custom command', () => {
|
||||
Cypress.Commands.add('console', {
|
||||
prevSubject: true,
|
||||
}, (subject, method) => {
|
||||
// the previous subject is automatically received
|
||||
// and the commands arguments are shifted
|
||||
|
||||
// allow us to change the console method used
|
||||
method = method || 'log'
|
||||
|
||||
// log the subject to the console
|
||||
// @ts-ignore TS7017
|
||||
console[method]('The subject is', subject)
|
||||
|
||||
// whatever we return becomes the new subject
|
||||
// we don't want to change the subject so
|
||||
// we return whatever was passed in
|
||||
return subject
|
||||
})
|
||||
|
||||
// @ts-ignore TS2339
|
||||
cy.get('button').console('info').then(($button) => {
|
||||
// subject is still $button
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
context('Cypress.Cookies', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
|
||||
// https://on.cypress.io/cookies
|
||||
it('.debug() - enable or disable debugging', () => {
|
||||
Cypress.Cookies.debug(true)
|
||||
|
||||
// Cypress will now log in the console when
|
||||
// cookies are set or cleared
|
||||
cy.setCookie('fakeCookie', '123ABC')
|
||||
cy.clearCookie('fakeCookie')
|
||||
cy.setCookie('fakeCookie', '123ABC')
|
||||
cy.clearCookie('fakeCookie')
|
||||
cy.setCookie('fakeCookie', '123ABC')
|
||||
})
|
||||
|
||||
it('.preserveOnce() - preserve cookies by key', () => {
|
||||
// normally cookies are reset after each test
|
||||
cy.getCookie('fakeCookie').should('not.be.ok')
|
||||
|
||||
// preserving a cookie will not clear it when
|
||||
// the next test starts
|
||||
cy.setCookie('lastCookie', '789XYZ')
|
||||
Cypress.Cookies.preserveOnce('lastCookie')
|
||||
})
|
||||
|
||||
it('.defaults() - set defaults for all cookies', () => {
|
||||
// now any cookie with the name 'session_id' will
|
||||
// not be cleared before each new test runs
|
||||
Cypress.Cookies.defaults({
|
||||
preserve: 'session_id',
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
|
||||
// https://on.cypress.io/cookies
|
||||
it('.debug() - enable or disable debugging', () => {
|
||||
Cypress.Cookies.debug(true)
|
||||
|
||||
// Cypress will now log in the console when
|
||||
// cookies are set or cleared
|
||||
cy.setCookie('fakeCookie', '123ABC')
|
||||
cy.clearCookie('fakeCookie')
|
||||
cy.setCookie('fakeCookie', '123ABC')
|
||||
cy.clearCookie('fakeCookie')
|
||||
cy.setCookie('fakeCookie', '123ABC')
|
||||
})
|
||||
|
||||
it('.preserveOnce() - preserve cookies by key', () => {
|
||||
// normally cookies are reset after each test
|
||||
cy.getCookie('fakeCookie').should('not.be.ok')
|
||||
|
||||
// preserving a cookie will not clear it when
|
||||
// the next test starts
|
||||
cy.setCookie('lastCookie', '789XYZ')
|
||||
Cypress.Cookies.preserveOnce('lastCookie')
|
||||
})
|
||||
|
||||
it('.defaults() - set defaults for all cookies', () => {
|
||||
// now any cookie with the name 'session_id' will
|
||||
// not be cleared before each new test runs
|
||||
Cypress.Cookies.defaults({
|
||||
preserve: 'session_id',
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
context('Cypress.arch', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
|
||||
it('Get CPU architecture name of underlying OS', () => {
|
||||
// https://on.cypress.io/arch
|
||||
expect(Cypress.arch).to.exist
|
||||
})
|
||||
it('Get CPU architecture name of underlying OS', () => {
|
||||
// https://on.cypress.io/arch
|
||||
expect(Cypress.arch).to.exist
|
||||
})
|
||||
})
|
||||
|
||||
context('Cypress.config()', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
|
||||
it('Get and set configuration options', () => {
|
||||
// https://on.cypress.io/config
|
||||
let myConfig = Cypress.config()
|
||||
it('Get and set configuration options', () => {
|
||||
// https://on.cypress.io/config
|
||||
let myConfig = Cypress.config()
|
||||
|
||||
expect(myConfig).to.have.property('animationDistanceThreshold', 5)
|
||||
expect(myConfig).to.have.property('baseUrl', null)
|
||||
expect(myConfig).to.have.property('defaultCommandTimeout', 4000)
|
||||
expect(myConfig).to.have.property('requestTimeout', 5000)
|
||||
expect(myConfig).to.have.property('responseTimeout', 30000)
|
||||
expect(myConfig).to.have.property('viewportHeight', 660)
|
||||
expect(myConfig).to.have.property('viewportWidth', 1000)
|
||||
expect(myConfig).to.have.property('pageLoadTimeout', 60000)
|
||||
expect(myConfig).to.have.property('waitForAnimations', true)
|
||||
expect(myConfig).to.have.property('animationDistanceThreshold', 5)
|
||||
expect(myConfig).to.have.property('baseUrl', null)
|
||||
expect(myConfig).to.have.property('defaultCommandTimeout', 4000)
|
||||
expect(myConfig).to.have.property('requestTimeout', 5000)
|
||||
expect(myConfig).to.have.property('responseTimeout', 30000)
|
||||
expect(myConfig).to.have.property('viewportHeight', 660)
|
||||
expect(myConfig).to.have.property('viewportWidth', 1000)
|
||||
expect(myConfig).to.have.property('pageLoadTimeout', 60000)
|
||||
expect(myConfig).to.have.property('waitForAnimations', true)
|
||||
|
||||
expect(Cypress.config('pageLoadTimeout')).to.eq(60000)
|
||||
expect(Cypress.config('pageLoadTimeout')).to.eq(60000)
|
||||
|
||||
// this will change the config for the rest of your tests!
|
||||
Cypress.config('pageLoadTimeout', 20000)
|
||||
// this will change the config for the rest of your tests!
|
||||
Cypress.config('pageLoadTimeout', 20000)
|
||||
|
||||
expect(Cypress.config('pageLoadTimeout')).to.eq(20000)
|
||||
expect(Cypress.config('pageLoadTimeout')).to.eq(20000)
|
||||
|
||||
Cypress.config('pageLoadTimeout', 60000)
|
||||
})
|
||||
Cypress.config('pageLoadTimeout', 60000)
|
||||
})
|
||||
})
|
||||
|
||||
context('Cypress.dom', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
|
||||
// https://on.cypress.io/dom
|
||||
it('.isHidden() - determine if a DOM element is hidden', () => {
|
||||
let hiddenP = Cypress.$('.dom-p p.hidden').get(0)
|
||||
let visibleP = Cypress.$('.dom-p p.visible').get(0)
|
||||
// https://on.cypress.io/dom
|
||||
it('.isHidden() - determine if a DOM element is hidden', () => {
|
||||
let hiddenP = Cypress.$('.dom-p p.hidden').get(0)
|
||||
let visibleP = Cypress.$('.dom-p p.visible').get(0)
|
||||
|
||||
// our first paragraph has css class 'hidden'
|
||||
expect(Cypress.dom.isHidden(hiddenP)).to.be.true
|
||||
expect(Cypress.dom.isHidden(visibleP)).to.be.false
|
||||
})
|
||||
// our first paragraph has css class 'hidden'
|
||||
expect(Cypress.dom.isHidden(hiddenP)).to.be.true
|
||||
expect(Cypress.dom.isHidden(visibleP)).to.be.false
|
||||
})
|
||||
})
|
||||
|
||||
context('Cypress.env()', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
|
||||
// We can set environment variables for highly dynamic values
|
||||
|
||||
// https://on.cypress.io/environment-variables
|
||||
it('Get environment variables', () => {
|
||||
// https://on.cypress.io/env
|
||||
// set multiple environment variables
|
||||
Cypress.env({
|
||||
host: 'veronica.dev.local',
|
||||
api_server: 'http://localhost:8888/v1/',
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
|
||||
// get environment variable
|
||||
expect(Cypress.env('host')).to.eq('veronica.dev.local')
|
||||
// We can set environment variables for highly dynamic values
|
||||
|
||||
// set environment variable
|
||||
Cypress.env('api_server', 'http://localhost:8888/v2/')
|
||||
expect(Cypress.env('api_server')).to.eq('http://localhost:8888/v2/')
|
||||
// https://on.cypress.io/environment-variables
|
||||
it('Get environment variables', () => {
|
||||
// https://on.cypress.io/env
|
||||
// set multiple environment variables
|
||||
Cypress.env({
|
||||
host: 'veronica.dev.local',
|
||||
api_server: 'http://localhost:8888/v1/',
|
||||
})
|
||||
|
||||
// get all environment variable
|
||||
expect(Cypress.env()).to.have.property('host', 'veronica.dev.local')
|
||||
expect(Cypress.env()).to.have.property('api_server', 'http://localhost:8888/v2/')
|
||||
})
|
||||
// get environment variable
|
||||
expect(Cypress.env('host')).to.eq('veronica.dev.local')
|
||||
|
||||
// set environment variable
|
||||
Cypress.env('api_server', 'http://localhost:8888/v2/')
|
||||
expect(Cypress.env('api_server')).to.eq('http://localhost:8888/v2/')
|
||||
|
||||
// get all environment variable
|
||||
expect(Cypress.env()).to.have.property('host', 'veronica.dev.local')
|
||||
expect(Cypress.env()).to.have.property('api_server', 'http://localhost:8888/v2/')
|
||||
})
|
||||
})
|
||||
|
||||
context('Cypress.log', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
|
||||
it('Control what is printed to the Command Log', () => {
|
||||
// https://on.cypress.io/cypress-log
|
||||
})
|
||||
it('Control what is printed to the Command Log', () => {
|
||||
// https://on.cypress.io/cypress-log
|
||||
})
|
||||
})
|
||||
|
||||
context('Cypress.platform', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
|
||||
it('Get underlying OS name', () => {
|
||||
// https://on.cypress.io/platform
|
||||
expect(Cypress.platform).to.be.exist
|
||||
})
|
||||
it('Get underlying OS name', () => {
|
||||
// https://on.cypress.io/platform
|
||||
expect(Cypress.platform).to.be.exist
|
||||
})
|
||||
})
|
||||
|
||||
context('Cypress.version', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
|
||||
it('Get current version of Cypress being run', () => {
|
||||
// https://on.cypress.io/version
|
||||
expect(Cypress.version).to.be.exist
|
||||
})
|
||||
it('Get current version of Cypress being run', () => {
|
||||
// https://on.cypress.io/version
|
||||
expect(Cypress.version).to.be.exist
|
||||
})
|
||||
})
|
||||
|
||||
context('Cypress.spec', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/cypress-api')
|
||||
})
|
||||
|
||||
it('Get current spec information', () => {
|
||||
// https://on.cypress.io/spec
|
||||
// wrap the object so we can inspect it easily by clicking in the command log
|
||||
cy.wrap(Cypress.spec).should('include.keys', ['name', 'relative', 'absolute'])
|
||||
})
|
||||
it('Get current spec information', () => {
|
||||
// https://on.cypress.io/spec
|
||||
// wrap the object so we can inspect it easily by clicking in the command log
|
||||
cy.wrap(Cypress.spec).should('include.keys', ['name', 'relative', 'absolute'])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -6,83 +6,83 @@
|
||||
const requiredExample = require('../../fixtures/example')
|
||||
|
||||
context('Files', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/files')
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
// load example.json fixture file and store
|
||||
// in the test context object
|
||||
cy.fixture('example.json').as('example')
|
||||
})
|
||||
|
||||
it('cy.fixture() - load a fixture', () => {
|
||||
// https://on.cypress.io/fixture
|
||||
|
||||
// Instead of writing a response inline you can
|
||||
// use a fixture file's content.
|
||||
|
||||
// when application makes an Ajax request matching "GET **/comments/*"
|
||||
// Cypress will intercept it and reply with the object in `example.json` fixture
|
||||
cy.intercept('GET', '**/comments/*', { fixture: 'example.json' }).as('getComment')
|
||||
|
||||
// we have code that gets a comment when
|
||||
// the button is clicked in scripts.js
|
||||
cy.get('.fixture-btn').click()
|
||||
|
||||
cy.wait('@getComment').its('response.body')
|
||||
.should('have.property', 'name')
|
||||
.and('include', 'Using fixtures to represent data')
|
||||
})
|
||||
|
||||
it('cy.fixture() or require - load a fixture', function () {
|
||||
// we are inside the "function () { ... }"
|
||||
// callback and can use test context object "this"
|
||||
// "this.example" was loaded in "beforeEach" function callback
|
||||
expect(this.example, 'fixture in the test context')
|
||||
.to.deep.equal(requiredExample)
|
||||
|
||||
// or use "cy.wrap" and "should('deep.equal', ...)" assertion
|
||||
cy.wrap(this.example)
|
||||
.should('deep.equal', requiredExample)
|
||||
})
|
||||
|
||||
it('cy.readFile() - read file contents', () => {
|
||||
// https://on.cypress.io/readfile
|
||||
|
||||
// You can read a file and yield its contents
|
||||
// The filePath is relative to your project's root.
|
||||
cy.readFile('cypress.json').then((json) => {
|
||||
expect(json).to.be.an('object')
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.writeFile() - write to a file', () => {
|
||||
// https://on.cypress.io/writefile
|
||||
|
||||
// You can write to a file
|
||||
|
||||
// Use a response from a request to automatically
|
||||
// generate a fixture file for use later
|
||||
cy.request('https://jsonplaceholder.cypress.io/users')
|
||||
.then((response) => {
|
||||
cy.writeFile('cypress/fixtures/users.json', response.body)
|
||||
})
|
||||
|
||||
cy.fixture('users').should((users) => {
|
||||
expect(users[0].name).to.exist
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/files')
|
||||
})
|
||||
|
||||
// JavaScript arrays and objects are stringified
|
||||
// and formatted into text.
|
||||
cy.writeFile('cypress/fixtures/profile.json', {
|
||||
id: 8739,
|
||||
name: 'Jane',
|
||||
email: 'jane@example.com',
|
||||
beforeEach(() => {
|
||||
// load example.json fixture file and store
|
||||
// in the test context object
|
||||
cy.fixture('example.json').as('example')
|
||||
})
|
||||
|
||||
cy.fixture('profile').should((profile) => {
|
||||
expect(profile.name).to.eq('Jane')
|
||||
it('cy.fixture() - load a fixture', () => {
|
||||
// https://on.cypress.io/fixture
|
||||
|
||||
// Instead of writing a response inline you can
|
||||
// use a fixture file's content.
|
||||
|
||||
// when application makes an Ajax request matching "GET **/comments/*"
|
||||
// Cypress will intercept it and reply with the object in `example.json` fixture
|
||||
cy.intercept('GET', '**/comments/*', {fixture: 'example.json'}).as('getComment')
|
||||
|
||||
// we have code that gets a comment when
|
||||
// the button is clicked in scripts.js
|
||||
cy.get('.fixture-btn').click()
|
||||
|
||||
cy.wait('@getComment').its('response.body')
|
||||
.should('have.property', 'name')
|
||||
.and('include', 'Using fixtures to represent data')
|
||||
})
|
||||
|
||||
it('cy.fixture() or require - load a fixture', function () {
|
||||
// we are inside the "function () { ... }"
|
||||
// callback and can use test context object "this"
|
||||
// "this.example" was loaded in "beforeEach" function callback
|
||||
expect(this.example, 'fixture in the test context')
|
||||
.to.deep.equal(requiredExample)
|
||||
|
||||
// or use "cy.wrap" and "should('deep.equal', ...)" assertion
|
||||
cy.wrap(this.example)
|
||||
.should('deep.equal', requiredExample)
|
||||
})
|
||||
|
||||
it('cy.readFile() - read file contents', () => {
|
||||
// https://on.cypress.io/readfile
|
||||
|
||||
// You can read a file and yield its contents
|
||||
// The filePath is relative to your project's root.
|
||||
cy.readFile('cypress.json').then((json) => {
|
||||
expect(json).to.be.an('object')
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.writeFile() - write to a file', () => {
|
||||
// https://on.cypress.io/writefile
|
||||
|
||||
// You can write to a file
|
||||
|
||||
// Use a response from a request to automatically
|
||||
// generate a fixture file for use later
|
||||
cy.request('https://jsonplaceholder.cypress.io/users')
|
||||
.then((response) => {
|
||||
cy.writeFile('cypress/fixtures/users.json', response.body)
|
||||
})
|
||||
|
||||
cy.fixture('users').should((users) => {
|
||||
expect(users[0].name).to.exist
|
||||
})
|
||||
|
||||
// JavaScript arrays and objects are stringified
|
||||
// and formatted into text.
|
||||
cy.writeFile('cypress/fixtures/profile.json', {
|
||||
id: 8739,
|
||||
name: 'Jane',
|
||||
email: 'jane@example.com',
|
||||
})
|
||||
|
||||
cy.fixture('profile').should((profile) => {
|
||||
expect(profile.name).to.eq('Jane')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Local Storage', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/local-storage')
|
||||
})
|
||||
// Although local storage is automatically cleared
|
||||
// in between tests to maintain a clean state
|
||||
// sometimes we need to clear the local storage manually
|
||||
|
||||
it('cy.clearLocalStorage() - clear all data in local storage', () => {
|
||||
// https://on.cypress.io/clearlocalstorage
|
||||
cy.get('.ls-btn').click().should(() => {
|
||||
expect(localStorage.getItem('prop1')).to.eq('red')
|
||||
expect(localStorage.getItem('prop2')).to.eq('blue')
|
||||
expect(localStorage.getItem('prop3')).to.eq('magenta')
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/local-storage')
|
||||
})
|
||||
// Although local storage is automatically cleared
|
||||
// in between tests to maintain a clean state
|
||||
// sometimes we need to clear the local storage manually
|
||||
|
||||
// clearLocalStorage() yields the localStorage object
|
||||
cy.clearLocalStorage().should((ls) => {
|
||||
expect(ls.getItem('prop1')).to.be.null
|
||||
expect(ls.getItem('prop2')).to.be.null
|
||||
expect(ls.getItem('prop3')).to.be.null
|
||||
})
|
||||
it('cy.clearLocalStorage() - clear all data in local storage', () => {
|
||||
// https://on.cypress.io/clearlocalstorage
|
||||
cy.get('.ls-btn').click().should(() => {
|
||||
expect(localStorage.getItem('prop1')).to.eq('red')
|
||||
expect(localStorage.getItem('prop2')).to.eq('blue')
|
||||
expect(localStorage.getItem('prop3')).to.eq('magenta')
|
||||
})
|
||||
|
||||
cy.get('.ls-btn').click().should(() => {
|
||||
expect(localStorage.getItem('prop1')).to.eq('red')
|
||||
expect(localStorage.getItem('prop2')).to.eq('blue')
|
||||
expect(localStorage.getItem('prop3')).to.eq('magenta')
|
||||
})
|
||||
// clearLocalStorage() yields the localStorage object
|
||||
cy.clearLocalStorage().should((ls) => {
|
||||
expect(ls.getItem('prop1')).to.be.null
|
||||
expect(ls.getItem('prop2')).to.be.null
|
||||
expect(ls.getItem('prop3')).to.be.null
|
||||
})
|
||||
|
||||
// Clear key matching string in Local Storage
|
||||
cy.clearLocalStorage('prop1').should((ls) => {
|
||||
expect(ls.getItem('prop1')).to.be.null
|
||||
expect(ls.getItem('prop2')).to.eq('blue')
|
||||
expect(ls.getItem('prop3')).to.eq('magenta')
|
||||
})
|
||||
cy.get('.ls-btn').click().should(() => {
|
||||
expect(localStorage.getItem('prop1')).to.eq('red')
|
||||
expect(localStorage.getItem('prop2')).to.eq('blue')
|
||||
expect(localStorage.getItem('prop3')).to.eq('magenta')
|
||||
})
|
||||
|
||||
cy.get('.ls-btn').click().should(() => {
|
||||
expect(localStorage.getItem('prop1')).to.eq('red')
|
||||
expect(localStorage.getItem('prop2')).to.eq('blue')
|
||||
expect(localStorage.getItem('prop3')).to.eq('magenta')
|
||||
})
|
||||
// Clear key matching string in Local Storage
|
||||
cy.clearLocalStorage('prop1').should((ls) => {
|
||||
expect(ls.getItem('prop1')).to.be.null
|
||||
expect(ls.getItem('prop2')).to.eq('blue')
|
||||
expect(ls.getItem('prop3')).to.eq('magenta')
|
||||
})
|
||||
|
||||
// Clear keys matching regex in Local Storage
|
||||
cy.clearLocalStorage(/prop1|2/).should((ls) => {
|
||||
expect(ls.getItem('prop1')).to.be.null
|
||||
expect(ls.getItem('prop2')).to.be.null
|
||||
expect(ls.getItem('prop3')).to.eq('magenta')
|
||||
cy.get('.ls-btn').click().should(() => {
|
||||
expect(localStorage.getItem('prop1')).to.eq('red')
|
||||
expect(localStorage.getItem('prop2')).to.eq('blue')
|
||||
expect(localStorage.getItem('prop3')).to.eq('magenta')
|
||||
})
|
||||
|
||||
// Clear keys matching regex in Local Storage
|
||||
cy.clearLocalStorage(/prop1|2/).should((ls) => {
|
||||
expect(ls.getItem('prop1')).to.be.null
|
||||
expect(ls.getItem('prop2')).to.be.null
|
||||
expect(ls.getItem('prop3')).to.eq('magenta')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Location', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/location')
|
||||
})
|
||||
|
||||
it('cy.hash() - get the current URL hash', () => {
|
||||
// https://on.cypress.io/hash
|
||||
cy.hash().should('be.empty')
|
||||
})
|
||||
|
||||
it('cy.location() - get window.location', () => {
|
||||
// https://on.cypress.io/location
|
||||
cy.location().should((location) => {
|
||||
expect(location.hash).to.be.empty
|
||||
expect(location.href).to.eq('https://example.cypress.io/commands/location')
|
||||
expect(location.host).to.eq('example.cypress.io')
|
||||
expect(location.hostname).to.eq('example.cypress.io')
|
||||
expect(location.origin).to.eq('https://example.cypress.io')
|
||||
expect(location.pathname).to.eq('/commands/location')
|
||||
expect(location.port).to.eq('')
|
||||
expect(location.protocol).to.eq('https:')
|
||||
expect(location.search).to.be.empty
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/location')
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.url() - get the current URL', () => {
|
||||
// https://on.cypress.io/url
|
||||
cy.url().should('eq', 'https://example.cypress.io/commands/location')
|
||||
})
|
||||
it('cy.hash() - get the current URL hash', () => {
|
||||
// https://on.cypress.io/hash
|
||||
cy.hash().should('be.empty')
|
||||
})
|
||||
|
||||
it('cy.location() - get window.location', () => {
|
||||
// https://on.cypress.io/location
|
||||
cy.location().should((location) => {
|
||||
expect(location.hash).to.be.empty
|
||||
expect(location.href).to.eq('https://example.cypress.io/commands/location')
|
||||
expect(location.host).to.eq('example.cypress.io')
|
||||
expect(location.hostname).to.eq('example.cypress.io')
|
||||
expect(location.origin).to.eq('https://example.cypress.io')
|
||||
expect(location.pathname).to.eq('/commands/location')
|
||||
expect(location.port).to.eq('')
|
||||
expect(location.protocol).to.eq('https:')
|
||||
expect(location.search).to.be.empty
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.url() - get the current URL', () => {
|
||||
// https://on.cypress.io/url
|
||||
cy.url().should('eq', 'https://example.cypress.io/commands/location')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,104 +1,106 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Misc', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/misc')
|
||||
})
|
||||
|
||||
it('.end() - end the command chain', () => {
|
||||
// https://on.cypress.io/end
|
||||
|
||||
// cy.end is useful when you want to end a chain of commands
|
||||
// and force Cypress to re-query from the root element
|
||||
cy.get('.misc-table').within(() => {
|
||||
// ends the current chain and yields null
|
||||
cy.contains('Cheryl').click().end()
|
||||
|
||||
// queries the entire table again
|
||||
cy.contains('Charles').click()
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.exec() - execute a system command', () => {
|
||||
// execute a system command.
|
||||
// so you can take actions necessary for
|
||||
// your test outside the scope of Cypress.
|
||||
// https://on.cypress.io/exec
|
||||
|
||||
// we can use Cypress.platform string to
|
||||
// select appropriate command
|
||||
// https://on.cypress/io/platform
|
||||
cy.log(`Platform ${Cypress.platform} architecture ${Cypress.arch}`)
|
||||
|
||||
// on CircleCI Windows build machines we have a failure to run bash shell
|
||||
// https://github.com/cypress-io/cypress/issues/5169
|
||||
// so skip some of the tests by passing flag "--env circle=true"
|
||||
const isCircleOnWindows = Cypress.platform === 'win32' && Cypress.env('circle')
|
||||
|
||||
if (isCircleOnWindows) {
|
||||
cy.log('Skipping test on CircleCI')
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// cy.exec problem on Shippable CI
|
||||
// https://github.com/cypress-io/cypress/issues/6718
|
||||
const isShippable = Cypress.platform === 'linux' && Cypress.env('shippable')
|
||||
|
||||
if (isShippable) {
|
||||
cy.log('Skipping test on ShippableCI')
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
cy.exec('echo Jane Lane')
|
||||
.its('stdout').should('contain', 'Jane Lane')
|
||||
|
||||
if (Cypress.platform === 'win32') {
|
||||
cy.exec('print cypress.json')
|
||||
.its('stderr').should('be.empty')
|
||||
} else {
|
||||
cy.exec('cat cypress.json')
|
||||
.its('stderr').should('be.empty')
|
||||
|
||||
cy.exec('pwd')
|
||||
.its('code').should('eq', 0)
|
||||
}
|
||||
})
|
||||
|
||||
it('cy.focused() - get the DOM element that has focus', () => {
|
||||
// https://on.cypress.io/focused
|
||||
cy.get('.misc-form').find('#name').click()
|
||||
cy.focused().should('have.id', 'name')
|
||||
|
||||
cy.get('.misc-form').find('#description').click()
|
||||
cy.focused().should('have.id', 'description')
|
||||
})
|
||||
|
||||
context('Cypress.Screenshot', function () {
|
||||
it('cy.screenshot() - take a screenshot', () => {
|
||||
// https://on.cypress.io/screenshot
|
||||
cy.screenshot('my-image')
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/misc')
|
||||
})
|
||||
|
||||
it('Cypress.Screenshot.defaults() - change default config of screenshots', function () {
|
||||
Cypress.Screenshot.defaults({
|
||||
blackout: ['.foo'],
|
||||
capture: 'viewport',
|
||||
clip: { x: 0, y: 0, width: 200, height: 200 },
|
||||
scale: false,
|
||||
disableTimersAndAnimations: true,
|
||||
screenshotOnRunFailure: true,
|
||||
onBeforeScreenshot () { },
|
||||
onAfterScreenshot () { },
|
||||
})
|
||||
})
|
||||
})
|
||||
it('.end() - end the command chain', () => {
|
||||
// https://on.cypress.io/end
|
||||
|
||||
it('cy.wrap() - wrap an object', () => {
|
||||
// https://on.cypress.io/wrap
|
||||
cy.wrap({ foo: 'bar' })
|
||||
.should('have.property', 'foo')
|
||||
.and('include', 'bar')
|
||||
})
|
||||
// cy.end is useful when you want to end a chain of commands
|
||||
// and force Cypress to re-query from the root element
|
||||
cy.get('.misc-table').within(() => {
|
||||
// ends the current chain and yields null
|
||||
cy.contains('Cheryl').click().end()
|
||||
|
||||
// queries the entire table again
|
||||
cy.contains('Charles').click()
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.exec() - execute a system command', () => {
|
||||
// execute a system command.
|
||||
// so you can take actions necessary for
|
||||
// your test outside the scope of Cypress.
|
||||
// https://on.cypress.io/exec
|
||||
|
||||
// we can use Cypress.platform string to
|
||||
// select appropriate command
|
||||
// https://on.cypress/io/platform
|
||||
cy.log(`Platform ${Cypress.platform} architecture ${Cypress.arch}`)
|
||||
|
||||
// on CircleCI Windows build machines we have a failure to run bash shell
|
||||
// https://github.com/cypress-io/cypress/issues/5169
|
||||
// so skip some of the tests by passing flag "--env circle=true"
|
||||
const isCircleOnWindows = Cypress.platform === 'win32' && Cypress.env('circle')
|
||||
|
||||
if (isCircleOnWindows) {
|
||||
cy.log('Skipping test on CircleCI')
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// cy.exec problem on Shippable CI
|
||||
// https://github.com/cypress-io/cypress/issues/6718
|
||||
const isShippable = Cypress.platform === 'linux' && Cypress.env('shippable')
|
||||
|
||||
if (isShippable) {
|
||||
cy.log('Skipping test on ShippableCI')
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
cy.exec('echo Jane Lane')
|
||||
.its('stdout').should('contain', 'Jane Lane')
|
||||
|
||||
if (Cypress.platform === 'win32') {
|
||||
cy.exec('print cypress.json')
|
||||
.its('stderr').should('be.empty')
|
||||
} else {
|
||||
cy.exec('cat cypress.json')
|
||||
.its('stderr').should('be.empty')
|
||||
|
||||
cy.exec('pwd')
|
||||
.its('code').should('eq', 0)
|
||||
}
|
||||
})
|
||||
|
||||
it('cy.focused() - get the DOM element that has focus', () => {
|
||||
// https://on.cypress.io/focused
|
||||
cy.get('.misc-form').find('#name').click()
|
||||
cy.focused().should('have.id', 'name')
|
||||
|
||||
cy.get('.misc-form').find('#description').click()
|
||||
cy.focused().should('have.id', 'description')
|
||||
})
|
||||
|
||||
context('Cypress.Screenshot', function () {
|
||||
it('cy.screenshot() - take a screenshot', () => {
|
||||
// https://on.cypress.io/screenshot
|
||||
cy.screenshot('my-image')
|
||||
})
|
||||
|
||||
it('Cypress.Screenshot.defaults() - change default config of screenshots', function () {
|
||||
Cypress.Screenshot.defaults({
|
||||
blackout: ['.foo'],
|
||||
capture: 'viewport',
|
||||
clip: {x: 0, y: 0, width: 200, height: 200},
|
||||
scale: false,
|
||||
disableTimersAndAnimations: true,
|
||||
screenshotOnRunFailure: true,
|
||||
onBeforeScreenshot() {
|
||||
},
|
||||
onAfterScreenshot() {
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.wrap() - wrap an object', () => {
|
||||
// https://on.cypress.io/wrap
|
||||
cy.wrap({foo: 'bar'})
|
||||
.should('have.property', 'foo')
|
||||
.and('include', 'bar')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Navigation', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io')
|
||||
cy.get('.navbar-nav').contains('Commands').click()
|
||||
cy.get('.dropdown-menu').contains('Navigation').click()
|
||||
})
|
||||
|
||||
it('cy.go() - go back or forward in the browser\'s history', () => {
|
||||
// https://on.cypress.io/go
|
||||
|
||||
cy.location('pathname').should('include', 'navigation')
|
||||
|
||||
cy.go('back')
|
||||
cy.location('pathname').should('not.include', 'navigation')
|
||||
|
||||
cy.go('forward')
|
||||
cy.location('pathname').should('include', 'navigation')
|
||||
|
||||
// clicking back
|
||||
cy.go(-1)
|
||||
cy.location('pathname').should('not.include', 'navigation')
|
||||
|
||||
// clicking forward
|
||||
cy.go(1)
|
||||
cy.location('pathname').should('include', 'navigation')
|
||||
})
|
||||
|
||||
it('cy.reload() - reload the page', () => {
|
||||
// https://on.cypress.io/reload
|
||||
cy.reload()
|
||||
|
||||
// reload the page without using the cache
|
||||
cy.reload(true)
|
||||
})
|
||||
|
||||
it('cy.visit() - visit a remote url', () => {
|
||||
// https://on.cypress.io/visit
|
||||
|
||||
// Visit any sub-domain of your current domain
|
||||
|
||||
// Pass options to the visit
|
||||
cy.visit('https://example.cypress.io/commands/navigation', {
|
||||
timeout: 50000, // increase total time for the visit to resolve
|
||||
onBeforeLoad (contentWindow) {
|
||||
// contentWindow is the remote page's window object
|
||||
expect(typeof contentWindow === 'object').to.be.true
|
||||
},
|
||||
onLoad (contentWindow) {
|
||||
// contentWindow is the remote page's window object
|
||||
expect(typeof contentWindow === 'object').to.be.true
|
||||
},
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io')
|
||||
cy.get('.navbar-nav').contains('Commands').click()
|
||||
cy.get('.dropdown-menu').contains('Navigation').click()
|
||||
})
|
||||
|
||||
it('cy.go() - go back or forward in the browser\'s history', () => {
|
||||
// https://on.cypress.io/go
|
||||
|
||||
cy.location('pathname').should('include', 'navigation')
|
||||
|
||||
cy.go('back')
|
||||
cy.location('pathname').should('not.include', 'navigation')
|
||||
|
||||
cy.go('forward')
|
||||
cy.location('pathname').should('include', 'navigation')
|
||||
|
||||
// clicking back
|
||||
cy.go(-1)
|
||||
cy.location('pathname').should('not.include', 'navigation')
|
||||
|
||||
// clicking forward
|
||||
cy.go(1)
|
||||
cy.location('pathname').should('include', 'navigation')
|
||||
})
|
||||
|
||||
it('cy.reload() - reload the page', () => {
|
||||
// https://on.cypress.io/reload
|
||||
cy.reload()
|
||||
|
||||
// reload the page without using the cache
|
||||
cy.reload(true)
|
||||
})
|
||||
|
||||
it('cy.visit() - visit a remote url', () => {
|
||||
// https://on.cypress.io/visit
|
||||
|
||||
// Visit any sub-domain of your current domain
|
||||
|
||||
// Pass options to the visit
|
||||
cy.visit('https://example.cypress.io/commands/navigation', {
|
||||
timeout: 50000, // increase total time for the visit to resolve
|
||||
onBeforeLoad(contentWindow) {
|
||||
// contentWindow is the remote page's window object
|
||||
expect(typeof contentWindow === 'object').to.be.true
|
||||
},
|
||||
onLoad(contentWindow) {
|
||||
// contentWindow is the remote page's window object
|
||||
expect(typeof contentWindow === 'object').to.be.true
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,163 +1,163 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Network Requests', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/network-requests')
|
||||
})
|
||||
|
||||
// Manage HTTP requests in your app
|
||||
|
||||
it('cy.request() - make an XHR request', () => {
|
||||
// https://on.cypress.io/request
|
||||
cy.request('https://jsonplaceholder.cypress.io/comments')
|
||||
.should((response) => {
|
||||
expect(response.status).to.eq(200)
|
||||
// the server sometimes gets an extra comment posted from another machine
|
||||
// which gets returned as 1 extra object
|
||||
expect(response.body).to.have.property('length').and.be.oneOf([500, 501])
|
||||
expect(response).to.have.property('headers')
|
||||
expect(response).to.have.property('duration')
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.request() - verify response using BDD syntax', () => {
|
||||
cy.request('https://jsonplaceholder.cypress.io/comments')
|
||||
.then((response) => {
|
||||
// https://on.cypress.io/assertions
|
||||
expect(response).property('status').to.equal(200)
|
||||
expect(response).property('body').to.have.property('length').and.be.oneOf([500, 501])
|
||||
expect(response).to.include.keys('headers', 'duration')
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/network-requests')
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.request() with query parameters', () => {
|
||||
// will execute request
|
||||
// https://jsonplaceholder.cypress.io/comments?postId=1&id=3
|
||||
cy.request({
|
||||
url: 'https://jsonplaceholder.cypress.io/comments',
|
||||
qs: {
|
||||
postId: 1,
|
||||
id: 3,
|
||||
},
|
||||
})
|
||||
.its('body')
|
||||
.should('be.an', 'array')
|
||||
.and('have.length', 1)
|
||||
.its('0') // yields first element of the array
|
||||
.should('contain', {
|
||||
postId: 1,
|
||||
id: 3,
|
||||
})
|
||||
})
|
||||
// Manage HTTP requests in your app
|
||||
|
||||
it('cy.request() - pass result to the second request', () => {
|
||||
// first, let's find out the userId of the first user we have
|
||||
cy.request('https://jsonplaceholder.cypress.io/users?_limit=1')
|
||||
.its('body') // yields the response object
|
||||
.its('0') // yields the first element of the returned list
|
||||
// the above two commands its('body').its('0')
|
||||
// can be written as its('body.0')
|
||||
// if you do not care about TypeScript checks
|
||||
.then((user) => {
|
||||
expect(user).property('id').to.be.a('number')
|
||||
// make a new post on behalf of the user
|
||||
cy.request('POST', 'https://jsonplaceholder.cypress.io/posts', {
|
||||
userId: user.id,
|
||||
title: 'Cypress Test Runner',
|
||||
body: 'Fast, easy and reliable testing for anything that runs in a browser.',
|
||||
it('cy.request() - make an XHR request', () => {
|
||||
// https://on.cypress.io/request
|
||||
cy.request('https://jsonplaceholder.cypress.io/comments')
|
||||
.should((response) => {
|
||||
expect(response.status).to.eq(200)
|
||||
// the server sometimes gets an extra comment posted from another machine
|
||||
// which gets returned as 1 extra object
|
||||
expect(response.body).to.have.property('length').and.be.oneOf([500, 501])
|
||||
expect(response).to.have.property('headers')
|
||||
expect(response).to.have.property('duration')
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.request() - verify response using BDD syntax', () => {
|
||||
cy.request('https://jsonplaceholder.cypress.io/comments')
|
||||
.then((response) => {
|
||||
// https://on.cypress.io/assertions
|
||||
expect(response).property('status').to.equal(200)
|
||||
expect(response).property('body').to.have.property('length').and.be.oneOf([500, 501])
|
||||
expect(response).to.include.keys('headers', 'duration')
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.request() with query parameters', () => {
|
||||
// will execute request
|
||||
// https://jsonplaceholder.cypress.io/comments?postId=1&id=3
|
||||
cy.request({
|
||||
url: 'https://jsonplaceholder.cypress.io/comments',
|
||||
qs: {
|
||||
postId: 1,
|
||||
id: 3,
|
||||
},
|
||||
})
|
||||
})
|
||||
// note that the value here is the returned value of the 2nd request
|
||||
// which is the new post object
|
||||
.then((response) => {
|
||||
expect(response).property('status').to.equal(201) // new entity created
|
||||
expect(response).property('body').to.contain({
|
||||
title: 'Cypress Test Runner',
|
||||
.its('body')
|
||||
.should('be.an', 'array')
|
||||
.and('have.length', 1)
|
||||
.its('0') // yields first element of the array
|
||||
.should('contain', {
|
||||
postId: 1,
|
||||
id: 3,
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.request() - pass result to the second request', () => {
|
||||
// first, let's find out the userId of the first user we have
|
||||
cy.request('https://jsonplaceholder.cypress.io/users?_limit=1')
|
||||
.its('body') // yields the response object
|
||||
.its('0') // yields the first element of the returned list
|
||||
// the above two commands its('body').its('0')
|
||||
// can be written as its('body.0')
|
||||
// if you do not care about TypeScript checks
|
||||
.then((user) => {
|
||||
expect(user).property('id').to.be.a('number')
|
||||
// make a new post on behalf of the user
|
||||
cy.request('POST', 'https://jsonplaceholder.cypress.io/posts', {
|
||||
userId: user.id,
|
||||
title: 'Cypress Test Runner',
|
||||
body: 'Fast, easy and reliable testing for anything that runs in a browser.',
|
||||
})
|
||||
})
|
||||
// note that the value here is the returned value of the 2nd request
|
||||
// which is the new post object
|
||||
.then((response) => {
|
||||
expect(response).property('status').to.equal(201) // new entity created
|
||||
expect(response).property('body').to.contain({
|
||||
title: 'Cypress Test Runner',
|
||||
})
|
||||
|
||||
// we don't know the exact post id - only that it will be > 100
|
||||
// since JSONPlaceholder has built-in 100 posts
|
||||
expect(response.body).property('id').to.be.a('number')
|
||||
.and.to.be.gt(100)
|
||||
|
||||
// we don't know the user id here - since it was in above closure
|
||||
// so in this test just confirm that the property is there
|
||||
expect(response.body).property('userId').to.be.a('number')
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.request() - save response in the shared test context', () => {
|
||||
// https://on.cypress.io/variables-and-aliases
|
||||
cy.request('https://jsonplaceholder.cypress.io/users?_limit=1')
|
||||
.its('body').its('0') // yields the first element of the returned list
|
||||
.as('user') // saves the object in the test context
|
||||
.then(function () {
|
||||
// NOTE 👀
|
||||
// By the time this callback runs the "as('user')" command
|
||||
// has saved the user object in the test context.
|
||||
// To access the test context we need to use
|
||||
// the "function () { ... }" callback form,
|
||||
// otherwise "this" points at a wrong or undefined object!
|
||||
cy.request('POST', 'https://jsonplaceholder.cypress.io/posts', {
|
||||
userId: this.user.id,
|
||||
title: 'Cypress Test Runner',
|
||||
body: 'Fast, easy and reliable testing for anything that runs in a browser.',
|
||||
})
|
||||
.its('body').as('post') // save the new post from the response
|
||||
})
|
||||
.then(function () {
|
||||
// When this callback runs, both "cy.request" API commands have finished
|
||||
// and the test context has "user" and "post" objects set.
|
||||
// Let's verify them.
|
||||
expect(this.post, 'post has the right user id').property('userId').to.equal(this.user.id)
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.intercept() - route responses to matching requests', () => {
|
||||
// https://on.cypress.io/intercept
|
||||
|
||||
let message = 'whoa, this comment does not exist'
|
||||
|
||||
// Listen to GET to comments/1
|
||||
cy.intercept('GET', '**/comments/*').as('getComment')
|
||||
|
||||
// we have code that gets a comment when
|
||||
// the button is clicked in scripts.js
|
||||
cy.get('.network-btn').click()
|
||||
|
||||
// https://on.cypress.io/wait
|
||||
cy.wait('@getComment').its('response.statusCode').should('be.oneOf', [200, 304])
|
||||
|
||||
// Listen to POST to comments
|
||||
cy.intercept('POST', '**/comments').as('postComment')
|
||||
|
||||
// we have code that posts a comment when
|
||||
// the button is clicked in scripts.js
|
||||
cy.get('.network-post').click()
|
||||
cy.wait('@postComment').should(({request, response}) => {
|
||||
expect(request.body).to.include('email')
|
||||
expect(request.headers).to.have.property('content-type')
|
||||
expect(response && response.body).to.have.property('name', 'Using POST in cy.intercept()')
|
||||
})
|
||||
|
||||
// we don't know the exact post id - only that it will be > 100
|
||||
// since JSONPlaceholder has built-in 100 posts
|
||||
expect(response.body).property('id').to.be.a('number')
|
||||
.and.to.be.gt(100)
|
||||
// Stub a response to PUT comments/ ****
|
||||
cy.intercept({
|
||||
method: 'PUT',
|
||||
url: '**/comments/*',
|
||||
}, {
|
||||
statusCode: 404,
|
||||
body: {error: message},
|
||||
headers: {'access-control-allow-origin': '*'},
|
||||
delayMs: 500,
|
||||
}).as('putComment')
|
||||
|
||||
// we don't know the user id here - since it was in above closure
|
||||
// so in this test just confirm that the property is there
|
||||
expect(response.body).property('userId').to.be.a('number')
|
||||
})
|
||||
})
|
||||
// we have code that puts a comment when
|
||||
// the button is clicked in scripts.js
|
||||
cy.get('.network-put').click()
|
||||
|
||||
it('cy.request() - save response in the shared test context', () => {
|
||||
// https://on.cypress.io/variables-and-aliases
|
||||
cy.request('https://jsonplaceholder.cypress.io/users?_limit=1')
|
||||
.its('body').its('0') // yields the first element of the returned list
|
||||
.as('user') // saves the object in the test context
|
||||
.then(function () {
|
||||
// NOTE 👀
|
||||
// By the time this callback runs the "as('user')" command
|
||||
// has saved the user object in the test context.
|
||||
// To access the test context we need to use
|
||||
// the "function () { ... }" callback form,
|
||||
// otherwise "this" points at a wrong or undefined object!
|
||||
cy.request('POST', 'https://jsonplaceholder.cypress.io/posts', {
|
||||
userId: this.user.id,
|
||||
title: 'Cypress Test Runner',
|
||||
body: 'Fast, easy and reliable testing for anything that runs in a browser.',
|
||||
})
|
||||
.its('body').as('post') // save the new post from the response
|
||||
})
|
||||
.then(function () {
|
||||
// When this callback runs, both "cy.request" API commands have finished
|
||||
// and the test context has "user" and "post" objects set.
|
||||
// Let's verify them.
|
||||
expect(this.post, 'post has the right user id').property('userId').to.equal(this.user.id)
|
||||
})
|
||||
})
|
||||
cy.wait('@putComment')
|
||||
|
||||
it('cy.intercept() - route responses to matching requests', () => {
|
||||
// https://on.cypress.io/intercept
|
||||
|
||||
let message = 'whoa, this comment does not exist'
|
||||
|
||||
// Listen to GET to comments/1
|
||||
cy.intercept('GET', '**/comments/*').as('getComment')
|
||||
|
||||
// we have code that gets a comment when
|
||||
// the button is clicked in scripts.js
|
||||
cy.get('.network-btn').click()
|
||||
|
||||
// https://on.cypress.io/wait
|
||||
cy.wait('@getComment').its('response.statusCode').should('be.oneOf', [200, 304])
|
||||
|
||||
// Listen to POST to comments
|
||||
cy.intercept('POST', '**/comments').as('postComment')
|
||||
|
||||
// we have code that posts a comment when
|
||||
// the button is clicked in scripts.js
|
||||
cy.get('.network-post').click()
|
||||
cy.wait('@postComment').should(({ request, response }) => {
|
||||
expect(request.body).to.include('email')
|
||||
expect(request.headers).to.have.property('content-type')
|
||||
expect(response && response.body).to.have.property('name', 'Using POST in cy.intercept()')
|
||||
// our 404 statusCode logic in scripts.js executed
|
||||
cy.get('.network-put-comment').should('contain', message)
|
||||
})
|
||||
|
||||
// Stub a response to PUT comments/ ****
|
||||
cy.intercept({
|
||||
method: 'PUT',
|
||||
url: '**/comments/*',
|
||||
}, {
|
||||
statusCode: 404,
|
||||
body: { error: message },
|
||||
headers: { 'access-control-allow-origin': '*' },
|
||||
delayMs: 500,
|
||||
}).as('putComment')
|
||||
|
||||
// we have code that puts a comment when
|
||||
// the button is clicked in scripts.js
|
||||
cy.get('.network-put').click()
|
||||
|
||||
cy.wait('@putComment')
|
||||
|
||||
// our 404 statusCode logic in scripts.js executed
|
||||
cy.get('.network-put-comment').should('contain', message)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,114 +1,114 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Querying', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/querying')
|
||||
})
|
||||
|
||||
// The most commonly used query is 'cy.get()', you can
|
||||
// think of this like the '$' in jQuery
|
||||
|
||||
it('cy.get() - query DOM elements', () => {
|
||||
// https://on.cypress.io/get
|
||||
|
||||
cy.get('#query-btn').should('contain', 'Button')
|
||||
|
||||
cy.get('.query-btn').should('contain', 'Button')
|
||||
|
||||
cy.get('#querying .well>button:first').should('contain', 'Button')
|
||||
// ↲
|
||||
// Use CSS selectors just like jQuery
|
||||
|
||||
cy.get('[data-test-id="test-example"]').should('have.class', 'example')
|
||||
|
||||
// 'cy.get()' yields jQuery object, you can get its attribute
|
||||
// by invoking `.attr()` method
|
||||
cy.get('[data-test-id="test-example"]')
|
||||
.invoke('attr', 'data-test-id')
|
||||
.should('equal', 'test-example')
|
||||
|
||||
// or you can get element's CSS property
|
||||
cy.get('[data-test-id="test-example"]')
|
||||
.invoke('css', 'position')
|
||||
.should('equal', 'static')
|
||||
|
||||
// or use assertions directly during 'cy.get()'
|
||||
// https://on.cypress.io/assertions
|
||||
cy.get('[data-test-id="test-example"]')
|
||||
.should('have.attr', 'data-test-id', 'test-example')
|
||||
.and('have.css', 'position', 'static')
|
||||
})
|
||||
|
||||
it('cy.contains() - query DOM elements with matching content', () => {
|
||||
// https://on.cypress.io/contains
|
||||
cy.get('.query-list')
|
||||
.contains('bananas')
|
||||
.should('have.class', 'third')
|
||||
|
||||
// we can pass a regexp to `.contains()`
|
||||
cy.get('.query-list')
|
||||
.contains(/^b\w+/)
|
||||
.should('have.class', 'third')
|
||||
|
||||
cy.get('.query-list')
|
||||
.contains('apples')
|
||||
.should('have.class', 'first')
|
||||
|
||||
// passing a selector to contains will
|
||||
// yield the selector containing the text
|
||||
cy.get('#querying')
|
||||
.contains('ul', 'oranges')
|
||||
.should('have.class', 'query-list')
|
||||
|
||||
cy.get('.query-button')
|
||||
.contains('Save Form')
|
||||
.should('have.class', 'btn')
|
||||
})
|
||||
|
||||
it('.within() - query DOM elements within a specific element', () => {
|
||||
// https://on.cypress.io/within
|
||||
cy.get('.query-form').within(() => {
|
||||
cy.get('input:first').should('have.attr', 'placeholder', 'Email')
|
||||
cy.get('input:last').should('have.attr', 'placeholder', 'Password')
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/querying')
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.root() - query the root DOM element', () => {
|
||||
// https://on.cypress.io/root
|
||||
// The most commonly used query is 'cy.get()', you can
|
||||
// think of this like the '$' in jQuery
|
||||
|
||||
// By default, root is the document
|
||||
cy.root().should('match', 'html')
|
||||
it('cy.get() - query DOM elements', () => {
|
||||
// https://on.cypress.io/get
|
||||
|
||||
cy.get('.query-ul').within(() => {
|
||||
// In this within, the root is now the ul DOM element
|
||||
cy.root().should('have.class', 'query-ul')
|
||||
cy.get('#query-btn').should('contain', 'Button')
|
||||
|
||||
cy.get('.query-btn').should('contain', 'Button')
|
||||
|
||||
cy.get('#querying .well>button:first').should('contain', 'Button')
|
||||
// ↲
|
||||
// Use CSS selectors just like jQuery
|
||||
|
||||
cy.get('[data-test-id="test-example"]').should('have.class', 'example')
|
||||
|
||||
// 'cy.get()' yields jQuery object, you can get its attribute
|
||||
// by invoking `.attr()` method
|
||||
cy.get('[data-test-id="test-example"]')
|
||||
.invoke('attr', 'data-test-id')
|
||||
.should('equal', 'test-example')
|
||||
|
||||
// or you can get element's CSS property
|
||||
cy.get('[data-test-id="test-example"]')
|
||||
.invoke('css', 'position')
|
||||
.should('equal', 'static')
|
||||
|
||||
// or use assertions directly during 'cy.get()'
|
||||
// https://on.cypress.io/assertions
|
||||
cy.get('[data-test-id="test-example"]')
|
||||
.should('have.attr', 'data-test-id', 'test-example')
|
||||
.and('have.css', 'position', 'static')
|
||||
})
|
||||
})
|
||||
|
||||
it('best practices - selecting elements', () => {
|
||||
// https://on.cypress.io/best-practices#Selecting-Elements
|
||||
cy.get('[data-cy=best-practices-selecting-elements]').within(() => {
|
||||
// Worst - too generic, no context
|
||||
cy.get('button').click()
|
||||
it('cy.contains() - query DOM elements with matching content', () => {
|
||||
// https://on.cypress.io/contains
|
||||
cy.get('.query-list')
|
||||
.contains('bananas')
|
||||
.should('have.class', 'third')
|
||||
|
||||
// Bad. Coupled to styling. Highly subject to change.
|
||||
cy.get('.btn.btn-large').click()
|
||||
// we can pass a regexp to `.contains()`
|
||||
cy.get('.query-list')
|
||||
.contains(/^b\w+/)
|
||||
.should('have.class', 'third')
|
||||
|
||||
// Average. Coupled to the `name` attribute which has HTML semantics.
|
||||
cy.get('[name=submission]').click()
|
||||
cy.get('.query-list')
|
||||
.contains('apples')
|
||||
.should('have.class', 'first')
|
||||
|
||||
// Better. But still coupled to styling or JS event listeners.
|
||||
cy.get('#main').click()
|
||||
// passing a selector to contains will
|
||||
// yield the selector containing the text
|
||||
cy.get('#querying')
|
||||
.contains('ul', 'oranges')
|
||||
.should('have.class', 'query-list')
|
||||
|
||||
// Slightly better. Uses an ID but also ensures the element
|
||||
// has an ARIA role attribute
|
||||
cy.get('#main[role=button]').click()
|
||||
|
||||
// Much better. But still coupled to text content that may change.
|
||||
cy.contains('Submit').click()
|
||||
|
||||
// Best. Insulated from all changes.
|
||||
cy.get('[data-cy=submit]').click()
|
||||
cy.get('.query-button')
|
||||
.contains('Save Form')
|
||||
.should('have.class', 'btn')
|
||||
})
|
||||
|
||||
it('.within() - query DOM elements within a specific element', () => {
|
||||
// https://on.cypress.io/within
|
||||
cy.get('.query-form').within(() => {
|
||||
cy.get('input:first').should('have.attr', 'placeholder', 'Email')
|
||||
cy.get('input:last').should('have.attr', 'placeholder', 'Password')
|
||||
})
|
||||
})
|
||||
|
||||
it('cy.root() - query the root DOM element', () => {
|
||||
// https://on.cypress.io/root
|
||||
|
||||
// By default, root is the document
|
||||
cy.root().should('match', 'html')
|
||||
|
||||
cy.get('.query-ul').within(() => {
|
||||
// In this within, the root is now the ul DOM element
|
||||
cy.root().should('have.class', 'query-ul')
|
||||
})
|
||||
})
|
||||
|
||||
it('best practices - selecting elements', () => {
|
||||
// https://on.cypress.io/best-practices#Selecting-Elements
|
||||
cy.get('[data-cy=best-practices-selecting-elements]').within(() => {
|
||||
// Worst - too generic, no context
|
||||
cy.get('button').click()
|
||||
|
||||
// Bad. Coupled to styling. Highly subject to change.
|
||||
cy.get('.btn.btn-large').click()
|
||||
|
||||
// Average. Coupled to the `name` attribute which has HTML semantics.
|
||||
cy.get('[name=submission]').click()
|
||||
|
||||
// Better. But still coupled to styling or JS event listeners.
|
||||
cy.get('#main').click()
|
||||
|
||||
// Slightly better. Uses an ID but also ensures the element
|
||||
// has an ARIA role attribute
|
||||
cy.get('#main[role=button]').click()
|
||||
|
||||
// Much better. But still coupled to text content that may change.
|
||||
cy.contains('Submit').click()
|
||||
|
||||
// Best. Insulated from all changes.
|
||||
cy.get('[data-cy=submit]').click()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -3,203 +3,204 @@
|
||||
// https://github.com/cypress-io/cypress/issues/6720
|
||||
|
||||
context('Spies, Stubs, and Clock', () => {
|
||||
it('cy.spy() - wrap a method in a spy', () => {
|
||||
// https://on.cypress.io/spy
|
||||
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
||||
it('cy.spy() - wrap a method in a spy', () => {
|
||||
// https://on.cypress.io/spy
|
||||
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
||||
|
||||
const obj = {
|
||||
foo () {},
|
||||
}
|
||||
const obj = {
|
||||
foo() {
|
||||
},
|
||||
}
|
||||
|
||||
const spy = cy.spy(obj, 'foo').as('anyArgs')
|
||||
const spy = cy.spy(obj, 'foo').as('anyArgs')
|
||||
|
||||
obj.foo()
|
||||
obj.foo()
|
||||
|
||||
expect(spy).to.be.called
|
||||
})
|
||||
expect(spy).to.be.called
|
||||
})
|
||||
|
||||
it('cy.spy() retries until assertions pass', () => {
|
||||
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
||||
it('cy.spy() retries until assertions pass', () => {
|
||||
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
||||
|
||||
const obj = {
|
||||
/**
|
||||
* Prints the argument passed
|
||||
* @param x {any}
|
||||
*/
|
||||
foo (x) {
|
||||
console.log('obj.foo called with', x)
|
||||
},
|
||||
}
|
||||
const obj = {
|
||||
/**
|
||||
* Prints the argument passed
|
||||
* @param x {any}
|
||||
*/
|
||||
foo(x) {
|
||||
console.log('obj.foo called with', x)
|
||||
},
|
||||
}
|
||||
|
||||
cy.spy(obj, 'foo').as('foo')
|
||||
cy.spy(obj, 'foo').as('foo')
|
||||
|
||||
setTimeout(() => {
|
||||
obj.foo('first')
|
||||
}, 500)
|
||||
setTimeout(() => {
|
||||
obj.foo('first')
|
||||
}, 500)
|
||||
|
||||
setTimeout(() => {
|
||||
obj.foo('second')
|
||||
}, 2500)
|
||||
setTimeout(() => {
|
||||
obj.foo('second')
|
||||
}, 2500)
|
||||
|
||||
cy.get('@foo').should('have.been.calledTwice')
|
||||
})
|
||||
cy.get('@foo').should('have.been.calledTwice')
|
||||
})
|
||||
|
||||
it('cy.stub() - create a stub and/or replace a function with stub', () => {
|
||||
// https://on.cypress.io/stub
|
||||
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
||||
it('cy.stub() - create a stub and/or replace a function with stub', () => {
|
||||
// https://on.cypress.io/stub
|
||||
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
||||
|
||||
const obj = {
|
||||
/**
|
||||
* prints both arguments to the console
|
||||
* @param a {string}
|
||||
* @param b {string}
|
||||
*/
|
||||
foo (a, b) {
|
||||
console.log('a', a, 'b', b)
|
||||
},
|
||||
}
|
||||
const obj = {
|
||||
/**
|
||||
* prints both arguments to the console
|
||||
* @param a {string}
|
||||
* @param b {string}
|
||||
*/
|
||||
foo(a, b) {
|
||||
console.log('a', a, 'b', b)
|
||||
},
|
||||
}
|
||||
|
||||
const stub = cy.stub(obj, 'foo').as('foo')
|
||||
const stub = cy.stub(obj, 'foo').as('foo')
|
||||
|
||||
obj.foo('foo', 'bar')
|
||||
obj.foo('foo', 'bar')
|
||||
|
||||
expect(stub).to.be.called
|
||||
})
|
||||
expect(stub).to.be.called
|
||||
})
|
||||
|
||||
it('cy.clock() - control time in the browser', () => {
|
||||
// https://on.cypress.io/clock
|
||||
it('cy.clock() - control time in the browser', () => {
|
||||
// https://on.cypress.io/clock
|
||||
|
||||
// create the date in UTC so its always the same
|
||||
// no matter what local timezone the browser is running in
|
||||
const now = new Date(Date.UTC(2017, 2, 14)).getTime()
|
||||
// create the date in UTC so its always the same
|
||||
// no matter what local timezone the browser is running in
|
||||
const now = new Date(Date.UTC(2017, 2, 14)).getTime()
|
||||
|
||||
cy.clock(now)
|
||||
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
||||
cy.get('#clock-div').click()
|
||||
.should('have.text', '1489449600')
|
||||
})
|
||||
cy.clock(now)
|
||||
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
||||
cy.get('#clock-div').click()
|
||||
.should('have.text', '1489449600')
|
||||
})
|
||||
|
||||
it('cy.tick() - move time in the browser', () => {
|
||||
// https://on.cypress.io/tick
|
||||
it('cy.tick() - move time in the browser', () => {
|
||||
// https://on.cypress.io/tick
|
||||
|
||||
// create the date in UTC so its always the same
|
||||
// no matter what local timezone the browser is running in
|
||||
const now = new Date(Date.UTC(2017, 2, 14)).getTime()
|
||||
// create the date in UTC so its always the same
|
||||
// no matter what local timezone the browser is running in
|
||||
const now = new Date(Date.UTC(2017, 2, 14)).getTime()
|
||||
|
||||
cy.clock(now)
|
||||
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
||||
cy.get('#tick-div').click()
|
||||
.should('have.text', '1489449600')
|
||||
cy.clock(now)
|
||||
cy.visit('https://example.cypress.io/commands/spies-stubs-clocks')
|
||||
cy.get('#tick-div').click()
|
||||
.should('have.text', '1489449600')
|
||||
|
||||
cy.tick(10000) // 10 seconds passed
|
||||
cy.get('#tick-div').click()
|
||||
.should('have.text', '1489449610')
|
||||
})
|
||||
cy.tick(10000) // 10 seconds passed
|
||||
cy.get('#tick-div').click()
|
||||
.should('have.text', '1489449610')
|
||||
})
|
||||
|
||||
it('cy.stub() matches depending on arguments', () => {
|
||||
// see all possible matchers at
|
||||
// https://sinonjs.org/releases/latest/matchers/
|
||||
const greeter = {
|
||||
/**
|
||||
* Greets a person
|
||||
* @param {string} name
|
||||
*/
|
||||
greet (name) {
|
||||
return `Hello, ${name}!`
|
||||
},
|
||||
}
|
||||
it('cy.stub() matches depending on arguments', () => {
|
||||
// see all possible matchers at
|
||||
// https://sinonjs.org/releases/latest/matchers/
|
||||
const greeter = {
|
||||
/**
|
||||
* Greets a person
|
||||
* @param {string} name
|
||||
*/
|
||||
greet(name) {
|
||||
return `Hello, ${name}!`
|
||||
},
|
||||
}
|
||||
|
||||
cy.stub(greeter, 'greet')
|
||||
.callThrough() // if you want non-matched calls to call the real method
|
||||
.withArgs(Cypress.sinon.match.string).returns('Hi')
|
||||
.withArgs(Cypress.sinon.match.number).throws(new Error('Invalid name'))
|
||||
cy.stub(greeter, 'greet')
|
||||
.callThrough() // if you want non-matched calls to call the real method
|
||||
.withArgs(Cypress.sinon.match.string).returns('Hi')
|
||||
.withArgs(Cypress.sinon.match.number).throws(new Error('Invalid name'))
|
||||
|
||||
expect(greeter.greet('World')).to.equal('Hi')
|
||||
// @ts-ignore
|
||||
expect(() => greeter.greet(42)).to.throw('Invalid name')
|
||||
expect(greeter.greet).to.have.been.calledTwice
|
||||
expect(greeter.greet('World')).to.equal('Hi')
|
||||
// @ts-ignore
|
||||
expect(() => greeter.greet(42)).to.throw('Invalid name')
|
||||
expect(greeter.greet).to.have.been.calledTwice
|
||||
|
||||
// non-matched calls goes the actual method
|
||||
// @ts-ignore
|
||||
expect(greeter.greet()).to.equal('Hello, undefined!')
|
||||
})
|
||||
// non-matched calls goes the actual method
|
||||
// @ts-ignore
|
||||
expect(greeter.greet()).to.equal('Hello, undefined!')
|
||||
})
|
||||
|
||||
it('matches call arguments using Sinon matchers', () => {
|
||||
// see all possible matchers at
|
||||
// https://sinonjs.org/releases/latest/matchers/
|
||||
const calculator = {
|
||||
/**
|
||||
* returns the sum of two arguments
|
||||
* @param a {number}
|
||||
* @param b {number}
|
||||
*/
|
||||
add (a, b) {
|
||||
return a + b
|
||||
},
|
||||
}
|
||||
it('matches call arguments using Sinon matchers', () => {
|
||||
// see all possible matchers at
|
||||
// https://sinonjs.org/releases/latest/matchers/
|
||||
const calculator = {
|
||||
/**
|
||||
* returns the sum of two arguments
|
||||
* @param a {number}
|
||||
* @param b {number}
|
||||
*/
|
||||
add(a, b) {
|
||||
return a + b
|
||||
},
|
||||
}
|
||||
|
||||
const spy = cy.spy(calculator, 'add').as('add')
|
||||
const spy = cy.spy(calculator, 'add').as('add')
|
||||
|
||||
expect(calculator.add(2, 3)).to.equal(5)
|
||||
expect(calculator.add(2, 3)).to.equal(5)
|
||||
|
||||
// if we want to assert the exact values used during the call
|
||||
expect(spy).to.be.calledWith(2, 3)
|
||||
// if we want to assert the exact values used during the call
|
||||
expect(spy).to.be.calledWith(2, 3)
|
||||
|
||||
// let's confirm "add" method was called with two numbers
|
||||
expect(spy).to.be.calledWith(Cypress.sinon.match.number, Cypress.sinon.match.number)
|
||||
// let's confirm "add" method was called with two numbers
|
||||
expect(spy).to.be.calledWith(Cypress.sinon.match.number, Cypress.sinon.match.number)
|
||||
|
||||
// alternatively, provide the value to match
|
||||
expect(spy).to.be.calledWith(Cypress.sinon.match(2), Cypress.sinon.match(3))
|
||||
// alternatively, provide the value to match
|
||||
expect(spy).to.be.calledWith(Cypress.sinon.match(2), Cypress.sinon.match(3))
|
||||
|
||||
// match any value
|
||||
expect(spy).to.be.calledWith(Cypress.sinon.match.any, 3)
|
||||
// match any value
|
||||
expect(spy).to.be.calledWith(Cypress.sinon.match.any, 3)
|
||||
|
||||
// match any value from a list
|
||||
expect(spy).to.be.calledWith(Cypress.sinon.match.in([1, 2, 3]), 3)
|
||||
// match any value from a list
|
||||
expect(spy).to.be.calledWith(Cypress.sinon.match.in([1, 2, 3]), 3)
|
||||
|
||||
/**
|
||||
* Returns true if the given number is event
|
||||
* @param {number} x
|
||||
*/
|
||||
const isEven = (x) => x % 2 === 0
|
||||
/**
|
||||
* Returns true if the given number is event
|
||||
* @param {number} x
|
||||
*/
|
||||
const isEven = (x) => x % 2 === 0
|
||||
|
||||
// expect the value to pass a custom predicate function
|
||||
// the second argument to "sinon.match(predicate, message)" is
|
||||
// shown if the predicate does not pass and assertion fails
|
||||
expect(spy).to.be.calledWith(Cypress.sinon.match(isEven, 'isEven'), 3)
|
||||
// expect the value to pass a custom predicate function
|
||||
// the second argument to "sinon.match(predicate, message)" is
|
||||
// shown if the predicate does not pass and assertion fails
|
||||
expect(spy).to.be.calledWith(Cypress.sinon.match(isEven, 'isEven'), 3)
|
||||
|
||||
/**
|
||||
* Returns a function that checks if a given number is larger than the limit
|
||||
* @param {number} limit
|
||||
* @returns {(x: number) => boolean}
|
||||
*/
|
||||
const isGreaterThan = (limit) => (x) => x > limit
|
||||
/**
|
||||
* Returns a function that checks if a given number is larger than the limit
|
||||
* @param {number} limit
|
||||
* @returns {(x: number) => boolean}
|
||||
*/
|
||||
const isGreaterThan = (limit) => (x) => x > limit
|
||||
|
||||
/**
|
||||
* Returns a function that checks if a given number is less than the limit
|
||||
* @param {number} limit
|
||||
* @returns {(x: number) => boolean}
|
||||
*/
|
||||
const isLessThan = (limit) => (x) => x < limit
|
||||
/**
|
||||
* Returns a function that checks if a given number is less than the limit
|
||||
* @param {number} limit
|
||||
* @returns {(x: number) => boolean}
|
||||
*/
|
||||
const isLessThan = (limit) => (x) => x < limit
|
||||
|
||||
// you can combine several matchers using "and", "or"
|
||||
expect(spy).to.be.calledWith(
|
||||
Cypress.sinon.match.number,
|
||||
Cypress.sinon.match(isGreaterThan(2), '> 2').and(Cypress.sinon.match(isLessThan(4), '< 4')),
|
||||
)
|
||||
// you can combine several matchers using "and", "or"
|
||||
expect(spy).to.be.calledWith(
|
||||
Cypress.sinon.match.number,
|
||||
Cypress.sinon.match(isGreaterThan(2), '> 2').and(Cypress.sinon.match(isLessThan(4), '< 4')),
|
||||
)
|
||||
|
||||
expect(spy).to.be.calledWith(
|
||||
Cypress.sinon.match.number,
|
||||
Cypress.sinon.match(isGreaterThan(200), '> 200').or(Cypress.sinon.match(3)),
|
||||
)
|
||||
expect(spy).to.be.calledWith(
|
||||
Cypress.sinon.match.number,
|
||||
Cypress.sinon.match(isGreaterThan(200), '> 200').or(Cypress.sinon.match(3)),
|
||||
)
|
||||
|
||||
// matchers can be used from BDD assertions
|
||||
cy.get('@add').should('have.been.calledWith',
|
||||
Cypress.sinon.match.number, Cypress.sinon.match(3))
|
||||
// matchers can be used from BDD assertions
|
||||
cy.get('@add').should('have.been.calledWith',
|
||||
Cypress.sinon.match.number, Cypress.sinon.match(3))
|
||||
|
||||
// you can alias matchers for shorter test code
|
||||
const { match: M } = Cypress.sinon
|
||||
// you can alias matchers for shorter test code
|
||||
const {match: M} = Cypress.sinon
|
||||
|
||||
cy.get('@add').should('have.been.calledWith', M.number, M(3))
|
||||
})
|
||||
cy.get('@add').should('have.been.calledWith', M.number, M(3))
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,121 +1,121 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Traversal', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/traversal')
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/traversal')
|
||||
})
|
||||
|
||||
it('.children() - get child DOM elements', () => {
|
||||
// https://on.cypress.io/children
|
||||
cy.get('.traversal-breadcrumb')
|
||||
.children('.active')
|
||||
.should('contain', 'Data')
|
||||
})
|
||||
it('.children() - get child DOM elements', () => {
|
||||
// https://on.cypress.io/children
|
||||
cy.get('.traversal-breadcrumb')
|
||||
.children('.active')
|
||||
.should('contain', 'Data')
|
||||
})
|
||||
|
||||
it('.closest() - get closest ancestor DOM element', () => {
|
||||
// https://on.cypress.io/closest
|
||||
cy.get('.traversal-badge')
|
||||
.closest('ul')
|
||||
.should('have.class', 'list-group')
|
||||
})
|
||||
it('.closest() - get closest ancestor DOM element', () => {
|
||||
// https://on.cypress.io/closest
|
||||
cy.get('.traversal-badge')
|
||||
.closest('ul')
|
||||
.should('have.class', 'list-group')
|
||||
})
|
||||
|
||||
it('.eq() - get a DOM element at a specific index', () => {
|
||||
// https://on.cypress.io/eq
|
||||
cy.get('.traversal-list>li')
|
||||
.eq(1).should('contain', 'siamese')
|
||||
})
|
||||
it('.eq() - get a DOM element at a specific index', () => {
|
||||
// https://on.cypress.io/eq
|
||||
cy.get('.traversal-list>li')
|
||||
.eq(1).should('contain', 'siamese')
|
||||
})
|
||||
|
||||
it('.filter() - get DOM elements that match the selector', () => {
|
||||
// https://on.cypress.io/filter
|
||||
cy.get('.traversal-nav>li')
|
||||
.filter('.active').should('contain', 'About')
|
||||
})
|
||||
it('.filter() - get DOM elements that match the selector', () => {
|
||||
// https://on.cypress.io/filter
|
||||
cy.get('.traversal-nav>li')
|
||||
.filter('.active').should('contain', 'About')
|
||||
})
|
||||
|
||||
it('.find() - get descendant DOM elements of the selector', () => {
|
||||
// https://on.cypress.io/find
|
||||
cy.get('.traversal-pagination')
|
||||
.find('li').find('a')
|
||||
.should('have.length', 7)
|
||||
})
|
||||
it('.find() - get descendant DOM elements of the selector', () => {
|
||||
// https://on.cypress.io/find
|
||||
cy.get('.traversal-pagination')
|
||||
.find('li').find('a')
|
||||
.should('have.length', 7)
|
||||
})
|
||||
|
||||
it('.first() - get first DOM element', () => {
|
||||
// https://on.cypress.io/first
|
||||
cy.get('.traversal-table td')
|
||||
.first().should('contain', '1')
|
||||
})
|
||||
it('.first() - get first DOM element', () => {
|
||||
// https://on.cypress.io/first
|
||||
cy.get('.traversal-table td')
|
||||
.first().should('contain', '1')
|
||||
})
|
||||
|
||||
it('.last() - get last DOM element', () => {
|
||||
// https://on.cypress.io/last
|
||||
cy.get('.traversal-buttons .btn')
|
||||
.last().should('contain', 'Submit')
|
||||
})
|
||||
it('.last() - get last DOM element', () => {
|
||||
// https://on.cypress.io/last
|
||||
cy.get('.traversal-buttons .btn')
|
||||
.last().should('contain', 'Submit')
|
||||
})
|
||||
|
||||
it('.next() - get next sibling DOM element', () => {
|
||||
// https://on.cypress.io/next
|
||||
cy.get('.traversal-ul')
|
||||
.contains('apples').next().should('contain', 'oranges')
|
||||
})
|
||||
it('.next() - get next sibling DOM element', () => {
|
||||
// https://on.cypress.io/next
|
||||
cy.get('.traversal-ul')
|
||||
.contains('apples').next().should('contain', 'oranges')
|
||||
})
|
||||
|
||||
it('.nextAll() - get all next sibling DOM elements', () => {
|
||||
// https://on.cypress.io/nextall
|
||||
cy.get('.traversal-next-all')
|
||||
.contains('oranges')
|
||||
.nextAll().should('have.length', 3)
|
||||
})
|
||||
it('.nextAll() - get all next sibling DOM elements', () => {
|
||||
// https://on.cypress.io/nextall
|
||||
cy.get('.traversal-next-all')
|
||||
.contains('oranges')
|
||||
.nextAll().should('have.length', 3)
|
||||
})
|
||||
|
||||
it('.nextUntil() - get next sibling DOM elements until next el', () => {
|
||||
// https://on.cypress.io/nextuntil
|
||||
cy.get('#veggies')
|
||||
.nextUntil('#nuts').should('have.length', 3)
|
||||
})
|
||||
it('.nextUntil() - get next sibling DOM elements until next el', () => {
|
||||
// https://on.cypress.io/nextuntil
|
||||
cy.get('#veggies')
|
||||
.nextUntil('#nuts').should('have.length', 3)
|
||||
})
|
||||
|
||||
it('.not() - remove DOM elements from set of DOM elements', () => {
|
||||
// https://on.cypress.io/not
|
||||
cy.get('.traversal-disabled .btn')
|
||||
.not('[disabled]').should('not.contain', 'Disabled')
|
||||
})
|
||||
it('.not() - remove DOM elements from set of DOM elements', () => {
|
||||
// https://on.cypress.io/not
|
||||
cy.get('.traversal-disabled .btn')
|
||||
.not('[disabled]').should('not.contain', 'Disabled')
|
||||
})
|
||||
|
||||
it('.parent() - get parent DOM element from DOM elements', () => {
|
||||
// https://on.cypress.io/parent
|
||||
cy.get('.traversal-mark')
|
||||
.parent().should('contain', 'Morbi leo risus')
|
||||
})
|
||||
it('.parent() - get parent DOM element from DOM elements', () => {
|
||||
// https://on.cypress.io/parent
|
||||
cy.get('.traversal-mark')
|
||||
.parent().should('contain', 'Morbi leo risus')
|
||||
})
|
||||
|
||||
it('.parents() - get parent DOM elements from DOM elements', () => {
|
||||
// https://on.cypress.io/parents
|
||||
cy.get('.traversal-cite')
|
||||
.parents().should('match', 'blockquote')
|
||||
})
|
||||
it('.parents() - get parent DOM elements from DOM elements', () => {
|
||||
// https://on.cypress.io/parents
|
||||
cy.get('.traversal-cite')
|
||||
.parents().should('match', 'blockquote')
|
||||
})
|
||||
|
||||
it('.parentsUntil() - get parent DOM elements from DOM elements until el', () => {
|
||||
// https://on.cypress.io/parentsuntil
|
||||
cy.get('.clothes-nav')
|
||||
.find('.active')
|
||||
.parentsUntil('.clothes-nav')
|
||||
.should('have.length', 2)
|
||||
})
|
||||
it('.parentsUntil() - get parent DOM elements from DOM elements until el', () => {
|
||||
// https://on.cypress.io/parentsuntil
|
||||
cy.get('.clothes-nav')
|
||||
.find('.active')
|
||||
.parentsUntil('.clothes-nav')
|
||||
.should('have.length', 2)
|
||||
})
|
||||
|
||||
it('.prev() - get previous sibling DOM element', () => {
|
||||
// https://on.cypress.io/prev
|
||||
cy.get('.birds').find('.active')
|
||||
.prev().should('contain', 'Lorikeets')
|
||||
})
|
||||
it('.prev() - get previous sibling DOM element', () => {
|
||||
// https://on.cypress.io/prev
|
||||
cy.get('.birds').find('.active')
|
||||
.prev().should('contain', 'Lorikeets')
|
||||
})
|
||||
|
||||
it('.prevAll() - get all previous sibling DOM elements', () => {
|
||||
// https://on.cypress.io/prevall
|
||||
cy.get('.fruits-list').find('.third')
|
||||
.prevAll().should('have.length', 2)
|
||||
})
|
||||
it('.prevAll() - get all previous sibling DOM elements', () => {
|
||||
// https://on.cypress.io/prevall
|
||||
cy.get('.fruits-list').find('.third')
|
||||
.prevAll().should('have.length', 2)
|
||||
})
|
||||
|
||||
it('.prevUntil() - get all previous sibling DOM elements until el', () => {
|
||||
// https://on.cypress.io/prevuntil
|
||||
cy.get('.foods-list').find('#nuts')
|
||||
.prevUntil('#veggies').should('have.length', 3)
|
||||
})
|
||||
it('.prevUntil() - get all previous sibling DOM elements until el', () => {
|
||||
// https://on.cypress.io/prevuntil
|
||||
cy.get('.foods-list').find('#nuts')
|
||||
.prevUntil('#veggies').should('have.length', 3)
|
||||
})
|
||||
|
||||
it('.siblings() - get all sibling DOM elements', () => {
|
||||
// https://on.cypress.io/siblings
|
||||
cy.get('.traversal-pills .active')
|
||||
.siblings().should('have.length', 2)
|
||||
})
|
||||
it('.siblings() - get all sibling DOM elements', () => {
|
||||
// https://on.cypress.io/siblings
|
||||
cy.get('.traversal-pills .active')
|
||||
.siblings().should('have.length', 2)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,110 +1,110 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Utilities', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/utilities')
|
||||
})
|
||||
|
||||
it('Cypress._ - call a lodash method', () => {
|
||||
// https://on.cypress.io/_
|
||||
cy.request('https://jsonplaceholder.cypress.io/users')
|
||||
.then((response) => {
|
||||
let ids = Cypress._.chain(response.body).map('id').take(3).value()
|
||||
|
||||
expect(ids).to.deep.eq([1, 2, 3])
|
||||
})
|
||||
})
|
||||
|
||||
it('Cypress.$ - call a jQuery method', () => {
|
||||
// https://on.cypress.io/$
|
||||
let $li = Cypress.$('.utility-jquery li:first')
|
||||
|
||||
cy.wrap($li)
|
||||
.should('not.have.class', 'active')
|
||||
.click()
|
||||
.should('have.class', 'active')
|
||||
})
|
||||
|
||||
it('Cypress.Blob - blob utilities and base64 string conversion', () => {
|
||||
// https://on.cypress.io/blob
|
||||
cy.get('.utility-blob').then(($div) => {
|
||||
// https://github.com/nolanlawson/blob-util#imgSrcToDataURL
|
||||
// get the dataUrl string for the javascript-logo
|
||||
return Cypress.Blob.imgSrcToDataURL('https://example.cypress.io/assets/img/javascript-logo.png', undefined, 'anonymous')
|
||||
.then((dataUrl) => {
|
||||
// create an <img> element and set its src to the dataUrl
|
||||
let img = Cypress.$('<img />', { src: dataUrl })
|
||||
|
||||
// need to explicitly return cy here since we are initially returning
|
||||
// the Cypress.Blob.imgSrcToDataURL promise to our test
|
||||
// append the image
|
||||
$div.append(img)
|
||||
|
||||
cy.get('.utility-blob img').click()
|
||||
.should('have.attr', 'src', dataUrl)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('Cypress.minimatch - test out glob patterns against strings', () => {
|
||||
// https://on.cypress.io/minimatch
|
||||
let matching = Cypress.minimatch('/users/1/comments', '/users/*/comments', {
|
||||
matchBase: true,
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/utilities')
|
||||
})
|
||||
|
||||
expect(matching, 'matching wildcard').to.be.true
|
||||
it('Cypress._ - call a lodash method', () => {
|
||||
// https://on.cypress.io/_
|
||||
cy.request('https://jsonplaceholder.cypress.io/users')
|
||||
.then((response) => {
|
||||
let ids = Cypress._.chain(response.body).map('id').take(3).value()
|
||||
|
||||
matching = Cypress.minimatch('/users/1/comments/2', '/users/*/comments', {
|
||||
matchBase: true,
|
||||
expect(ids).to.deep.eq([1, 2, 3])
|
||||
})
|
||||
})
|
||||
|
||||
expect(matching, 'comments').to.be.false
|
||||
it('Cypress.$ - call a jQuery method', () => {
|
||||
// https://on.cypress.io/$
|
||||
let $li = Cypress.$('.utility-jquery li:first')
|
||||
|
||||
// ** matches against all downstream path segments
|
||||
matching = Cypress.minimatch('/foo/bar/baz/123/quux?a=b&c=2', '/foo/**', {
|
||||
matchBase: true,
|
||||
cy.wrap($li)
|
||||
.should('not.have.class', 'active')
|
||||
.click()
|
||||
.should('have.class', 'active')
|
||||
})
|
||||
|
||||
expect(matching, 'comments').to.be.true
|
||||
it('Cypress.Blob - blob utilities and base64 string conversion', () => {
|
||||
// https://on.cypress.io/blob
|
||||
cy.get('.utility-blob').then(($div) => {
|
||||
// https://github.com/nolanlawson/blob-util#imgSrcToDataURL
|
||||
// get the dataUrl string for the javascript-logo
|
||||
return Cypress.Blob.imgSrcToDataURL('https://example.cypress.io/assets/img/javascript-logo.png', undefined, 'anonymous')
|
||||
.then((dataUrl) => {
|
||||
// create an <img> element and set its src to the dataUrl
|
||||
let img = Cypress.$('<img />', {src: dataUrl})
|
||||
|
||||
// whereas * matches only the next path segment
|
||||
// need to explicitly return cy here since we are initially returning
|
||||
// the Cypress.Blob.imgSrcToDataURL promise to our test
|
||||
// append the image
|
||||
$div.append(img)
|
||||
|
||||
matching = Cypress.minimatch('/foo/bar/baz/123/quux?a=b&c=2', '/foo/*', {
|
||||
matchBase: false,
|
||||
cy.get('.utility-blob img').click()
|
||||
.should('have.attr', 'src', dataUrl)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
expect(matching, 'comments').to.be.false
|
||||
})
|
||||
it('Cypress.minimatch - test out glob patterns against strings', () => {
|
||||
// https://on.cypress.io/minimatch
|
||||
let matching = Cypress.minimatch('/users/1/comments', '/users/*/comments', {
|
||||
matchBase: true,
|
||||
})
|
||||
|
||||
it('Cypress.Promise - instantiate a bluebird promise', () => {
|
||||
// https://on.cypress.io/promise
|
||||
let waited = false
|
||||
expect(matching, 'matching wildcard').to.be.true
|
||||
|
||||
/**
|
||||
* @return Bluebird<string>
|
||||
*/
|
||||
function waitOneSecond () {
|
||||
// return a promise that resolves after 1 second
|
||||
// @ts-ignore TS2351 (new Cypress.Promise)
|
||||
return new Cypress.Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
// set waited to true
|
||||
waited = true
|
||||
matching = Cypress.minimatch('/users/1/comments/2', '/users/*/comments', {
|
||||
matchBase: true,
|
||||
})
|
||||
|
||||
// resolve with 'foo' string
|
||||
resolve('foo')
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
expect(matching, 'comments').to.be.false
|
||||
|
||||
cy.then(() => {
|
||||
// return a promise to cy.then() that
|
||||
// is awaited until it resolves
|
||||
// @ts-ignore TS7006
|
||||
return waitOneSecond().then((str) => {
|
||||
expect(str).to.eq('foo')
|
||||
expect(waited).to.be.true
|
||||
})
|
||||
// ** matches against all downstream path segments
|
||||
matching = Cypress.minimatch('/foo/bar/baz/123/quux?a=b&c=2', '/foo/**', {
|
||||
matchBase: true,
|
||||
})
|
||||
|
||||
expect(matching, 'comments').to.be.true
|
||||
|
||||
// whereas * matches only the next path segment
|
||||
|
||||
matching = Cypress.minimatch('/foo/bar/baz/123/quux?a=b&c=2', '/foo/*', {
|
||||
matchBase: false,
|
||||
})
|
||||
|
||||
expect(matching, 'comments').to.be.false
|
||||
})
|
||||
|
||||
it('Cypress.Promise - instantiate a bluebird promise', () => {
|
||||
// https://on.cypress.io/promise
|
||||
let waited = false
|
||||
|
||||
/**
|
||||
* @return Bluebird<string>
|
||||
*/
|
||||
function waitOneSecond() {
|
||||
// return a promise that resolves after 1 second
|
||||
// @ts-ignore TS2351 (new Cypress.Promise)
|
||||
return new Cypress.Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
// set waited to true
|
||||
waited = true
|
||||
|
||||
// resolve with 'foo' string
|
||||
resolve('foo')
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
|
||||
cy.then(() => {
|
||||
// return a promise to cy.then() that
|
||||
// is awaited until it resolves
|
||||
// @ts-ignore TS7006
|
||||
return waitOneSecond().then((str) => {
|
||||
expect(str).to.eq('foo')
|
||||
expect(waited).to.be.true
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,59 +1,59 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Viewport', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/viewport')
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/viewport')
|
||||
})
|
||||
|
||||
it('cy.viewport() - set the viewport size and dimension', () => {
|
||||
// https://on.cypress.io/viewport
|
||||
it('cy.viewport() - set the viewport size and dimension', () => {
|
||||
// https://on.cypress.io/viewport
|
||||
|
||||
cy.get('#navbar').should('be.visible')
|
||||
cy.viewport(320, 480)
|
||||
cy.get('#navbar').should('be.visible')
|
||||
cy.viewport(320, 480)
|
||||
|
||||
// the navbar should have collapse since our screen is smaller
|
||||
cy.get('#navbar').should('not.be.visible')
|
||||
cy.get('.navbar-toggle').should('be.visible').click()
|
||||
cy.get('.nav').find('a').should('be.visible')
|
||||
// the navbar should have collapse since our screen is smaller
|
||||
cy.get('#navbar').should('not.be.visible')
|
||||
cy.get('.navbar-toggle').should('be.visible').click()
|
||||
cy.get('.nav').find('a').should('be.visible')
|
||||
|
||||
// lets see what our app looks like on a super large screen
|
||||
cy.viewport(2999, 2999)
|
||||
// lets see what our app looks like on a super large screen
|
||||
cy.viewport(2999, 2999)
|
||||
|
||||
// cy.viewport() accepts a set of preset sizes
|
||||
// to easily set the screen to a device's width and height
|
||||
// cy.viewport() accepts a set of preset sizes
|
||||
// to easily set the screen to a device's width and height
|
||||
|
||||
// We added a cy.wait() between each viewport change so you can see
|
||||
// the change otherwise it is a little too fast to see :)
|
||||
// We added a cy.wait() between each viewport change so you can see
|
||||
// the change otherwise it is a little too fast to see :)
|
||||
|
||||
cy.viewport('macbook-15')
|
||||
cy.wait(200)
|
||||
cy.viewport('macbook-13')
|
||||
cy.wait(200)
|
||||
cy.viewport('macbook-11')
|
||||
cy.wait(200)
|
||||
cy.viewport('ipad-2')
|
||||
cy.wait(200)
|
||||
cy.viewport('ipad-mini')
|
||||
cy.wait(200)
|
||||
cy.viewport('iphone-6+')
|
||||
cy.wait(200)
|
||||
cy.viewport('iphone-6')
|
||||
cy.wait(200)
|
||||
cy.viewport('iphone-5')
|
||||
cy.wait(200)
|
||||
cy.viewport('iphone-4')
|
||||
cy.wait(200)
|
||||
cy.viewport('iphone-3')
|
||||
cy.wait(200)
|
||||
cy.viewport('macbook-15')
|
||||
cy.wait(200)
|
||||
cy.viewport('macbook-13')
|
||||
cy.wait(200)
|
||||
cy.viewport('macbook-11')
|
||||
cy.wait(200)
|
||||
cy.viewport('ipad-2')
|
||||
cy.wait(200)
|
||||
cy.viewport('ipad-mini')
|
||||
cy.wait(200)
|
||||
cy.viewport('iphone-6+')
|
||||
cy.wait(200)
|
||||
cy.viewport('iphone-6')
|
||||
cy.wait(200)
|
||||
cy.viewport('iphone-5')
|
||||
cy.wait(200)
|
||||
cy.viewport('iphone-4')
|
||||
cy.wait(200)
|
||||
cy.viewport('iphone-3')
|
||||
cy.wait(200)
|
||||
|
||||
// cy.viewport() accepts an orientation for all presets
|
||||
// the default orientation is 'portrait'
|
||||
cy.viewport('ipad-2', 'portrait')
|
||||
cy.wait(200)
|
||||
cy.viewport('iphone-4', 'landscape')
|
||||
cy.wait(200)
|
||||
// cy.viewport() accepts an orientation for all presets
|
||||
// the default orientation is 'portrait'
|
||||
cy.viewport('ipad-2', 'portrait')
|
||||
cy.wait(200)
|
||||
cy.viewport('iphone-4', 'landscape')
|
||||
cy.wait(200)
|
||||
|
||||
// The viewport will be reset back to the default dimensions
|
||||
// in between tests (the default can be set in cypress.json)
|
||||
})
|
||||
// The viewport will be reset back to the default dimensions
|
||||
// in between tests (the default can be set in cypress.json)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Waiting', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/waiting')
|
||||
})
|
||||
// BE CAREFUL of adding unnecessary wait times.
|
||||
// https://on.cypress.io/best-practices#Unnecessary-Waiting
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/waiting')
|
||||
})
|
||||
// BE CAREFUL of adding unnecessary wait times.
|
||||
// https://on.cypress.io/best-practices#Unnecessary-Waiting
|
||||
|
||||
// https://on.cypress.io/wait
|
||||
it('cy.wait() - wait for a specific amount of time', () => {
|
||||
cy.get('.wait-input1').type('Wait 1000ms after typing')
|
||||
cy.wait(1000)
|
||||
cy.get('.wait-input2').type('Wait 1000ms after typing')
|
||||
cy.wait(1000)
|
||||
cy.get('.wait-input3').type('Wait 1000ms after typing')
|
||||
cy.wait(1000)
|
||||
})
|
||||
// https://on.cypress.io/wait
|
||||
it('cy.wait() - wait for a specific amount of time', () => {
|
||||
cy.get('.wait-input1').type('Wait 1000ms after typing')
|
||||
cy.wait(1000)
|
||||
cy.get('.wait-input2').type('Wait 1000ms after typing')
|
||||
cy.wait(1000)
|
||||
cy.get('.wait-input3').type('Wait 1000ms after typing')
|
||||
cy.wait(1000)
|
||||
})
|
||||
|
||||
it('cy.wait() - wait for a specific route', () => {
|
||||
// Listen to GET to comments/1
|
||||
cy.intercept('GET', '**/comments/*').as('getComment')
|
||||
it('cy.wait() - wait for a specific route', () => {
|
||||
// Listen to GET to comments/1
|
||||
cy.intercept('GET', '**/comments/*').as('getComment')
|
||||
|
||||
// we have code that gets a comment when
|
||||
// the button is clicked in scripts.js
|
||||
cy.get('.network-btn').click()
|
||||
// we have code that gets a comment when
|
||||
// the button is clicked in scripts.js
|
||||
cy.get('.network-btn').click()
|
||||
|
||||
// wait for GET comments/1
|
||||
cy.wait('@getComment').its('response.statusCode').should('be.oneOf', [200, 304])
|
||||
})
|
||||
// wait for GET comments/1
|
||||
cy.wait('@getComment').its('response.statusCode').should('be.oneOf', [200, 304])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
context('Window', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/window')
|
||||
})
|
||||
beforeEach(() => {
|
||||
cy.visit('https://example.cypress.io/commands/window')
|
||||
})
|
||||
|
||||
it('cy.window() - get the global window object', () => {
|
||||
// https://on.cypress.io/window
|
||||
cy.window().should('have.property', 'top')
|
||||
})
|
||||
it('cy.window() - get the global window object', () => {
|
||||
// https://on.cypress.io/window
|
||||
cy.window().should('have.property', 'top')
|
||||
})
|
||||
|
||||
it('cy.document() - get the document object', () => {
|
||||
// https://on.cypress.io/document
|
||||
cy.document().should('have.property', 'charset').and('eq', 'UTF-8')
|
||||
})
|
||||
it('cy.document() - get the document object', () => {
|
||||
// https://on.cypress.io/document
|
||||
cy.document().should('have.property', 'charset').and('eq', 'UTF-8')
|
||||
})
|
||||
|
||||
it('cy.title() - get the title', () => {
|
||||
// https://on.cypress.io/title
|
||||
cy.title().should('include', 'Kitchen Sink')
|
||||
})
|
||||
it('cy.title() - get the title', () => {
|
||||
// https://on.cypress.io/title
|
||||
cy.title().should('include', 'Kitchen Sink')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
*/
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
module.exports = (on, config) => {
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
// `on` is used to hook into various events Cypress emits
|
||||
// `config` is the resolved Cypress config
|
||||
}
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"baseUrl": "../node_modules",
|
||||
"types": ["cypress"]
|
||||
"types": [
|
||||
"cypress"
|
||||
]
|
||||
},
|
||||
"include": ["**/*.*"]
|
||||
"include": [
|
||||
"**/*.*"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -5,52 +5,52 @@ importScripts("https://www.gstatic.com/firebasejs/8.2.0/firebase-messaging.js");
|
||||
// Initialize the Firebase app in the service worker by passing the generated config
|
||||
let firebaseConfig;
|
||||
switch (this.location.hostname) {
|
||||
case "localhost":
|
||||
firebaseConfig = {
|
||||
apiKey: "AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc",
|
||||
authDomain: "imex-dev.firebaseapp.com",
|
||||
databaseURL: "https://imex-dev.firebaseio.com",
|
||||
projectId: "imex-dev",
|
||||
storageBucket: "imex-dev.appspot.com",
|
||||
messagingSenderId: "759548147434",
|
||||
appId: "1:759548147434:web:e8239868a48ceb36700993",
|
||||
measurementId: "G-K5XRBVVB4S",
|
||||
};
|
||||
break;
|
||||
case "test.imex.online":
|
||||
firebaseConfig = {
|
||||
apiKey: "AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c",
|
||||
authDomain: "imex-test.firebaseapp.com",
|
||||
projectId: "imex-test",
|
||||
storageBucket: "imex-test.appspot.com",
|
||||
messagingSenderId: "991923618608",
|
||||
appId: "1:991923618608:web:633437569cdad78299bef5",
|
||||
// measurementId: "${config.measurementId}",
|
||||
};
|
||||
break;
|
||||
case "romeonline.io":
|
||||
firebaseConfig = {
|
||||
apiKey: "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE",
|
||||
authDomain: "rome-prod-1.firebaseapp.com",
|
||||
projectId: "rome-prod-1",
|
||||
storageBucket: "rome-prod-1.appspot.com",
|
||||
messagingSenderId: "147786367145",
|
||||
appId: "1:147786367145:web:9d4cba68071c3f29a8a9b8",
|
||||
measurementId: "G-G8Z9DRHTZS",
|
||||
};
|
||||
break;
|
||||
case "imex.online":
|
||||
default:
|
||||
firebaseConfig = {
|
||||
apiKey: "AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU",
|
||||
authDomain: "imex-prod.firebaseapp.com",
|
||||
databaseURL: "https://imex-prod.firebaseio.com",
|
||||
projectId: "imex-prod",
|
||||
storageBucket: "imex-prod.appspot.com",
|
||||
messagingSenderId: "253497221485",
|
||||
appId: "1:253497221485:web:3c81c483b94db84b227a64",
|
||||
measurementId: "G-NTWBKG2L0M",
|
||||
};
|
||||
case "localhost":
|
||||
firebaseConfig = {
|
||||
apiKey: "AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc",
|
||||
authDomain: "imex-dev.firebaseapp.com",
|
||||
databaseURL: "https://imex-dev.firebaseio.com",
|
||||
projectId: "imex-dev",
|
||||
storageBucket: "imex-dev.appspot.com",
|
||||
messagingSenderId: "759548147434",
|
||||
appId: "1:759548147434:web:e8239868a48ceb36700993",
|
||||
measurementId: "G-K5XRBVVB4S",
|
||||
};
|
||||
break;
|
||||
case "test.imex.online":
|
||||
firebaseConfig = {
|
||||
apiKey: "AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c",
|
||||
authDomain: "imex-test.firebaseapp.com",
|
||||
projectId: "imex-test",
|
||||
storageBucket: "imex-test.appspot.com",
|
||||
messagingSenderId: "991923618608",
|
||||
appId: "1:991923618608:web:633437569cdad78299bef5",
|
||||
// measurementId: "${config.measurementId}",
|
||||
};
|
||||
break;
|
||||
case "romeonline.io":
|
||||
firebaseConfig = {
|
||||
apiKey: "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE",
|
||||
authDomain: "rome-prod-1.firebaseapp.com",
|
||||
projectId: "rome-prod-1",
|
||||
storageBucket: "rome-prod-1.appspot.com",
|
||||
messagingSenderId: "147786367145",
|
||||
appId: "1:147786367145:web:9d4cba68071c3f29a8a9b8",
|
||||
measurementId: "G-G8Z9DRHTZS",
|
||||
};
|
||||
break;
|
||||
case "imex.online":
|
||||
default:
|
||||
firebaseConfig = {
|
||||
apiKey: "AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU",
|
||||
authDomain: "imex-prod.firebaseapp.com",
|
||||
databaseURL: "https://imex-prod.firebaseio.com",
|
||||
projectId: "imex-prod",
|
||||
storageBucket: "imex-prod.appspot.com",
|
||||
messagingSenderId: "253497221485",
|
||||
appId: "1:253497221485:web:3c81c483b94db84b227a64",
|
||||
measurementId: "G-NTWBKG2L0M",
|
||||
};
|
||||
}
|
||||
|
||||
firebase.initializeApp(firebaseConfig);
|
||||
@@ -59,9 +59,9 @@ firebase.initializeApp(firebaseConfig);
|
||||
const messaging = firebase.messaging();
|
||||
|
||||
messaging.onBackgroundMessage(function (payload) {
|
||||
// Customize notification here
|
||||
const channel = new BroadcastChannel("imex-sw-messages");
|
||||
channel.postMessage(payload);
|
||||
// Customize notification here
|
||||
const channel = new BroadcastChannel("imex-sw-messages");
|
||||
channel.postMessage(payload);
|
||||
|
||||
//self.registration.showNotification(notificationTitle, notificationOptions);
|
||||
//self.registration.showNotification(notificationTitle, notificationOptions);
|
||||
});
|
||||
|
||||
@@ -1,131 +1,134 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/ro-favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#002366" />
|
||||
<meta name="description" content="Rome Online" />
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link href="%PUBLIC_URL%/ro-favicon.png" rel="icon"/>
|
||||
<meta content="width=device-width, initial-scale=1" name="viewport"/>
|
||||
<meta content="#002366" name="theme-color"/>
|
||||
<meta content="Rome Online" name="description"/>
|
||||
<!-- <link rel="apple-touch-icon" href="logo192.png" /> -->
|
||||
|
||||
<!--Use the below code snippet to provide real time updates to the live chat plugin without the need of copying and paste each time to your website when changes are made via PBX-->
|
||||
|
||||
<call-us-selector phonesystem-url=https://rometech.east.3cx.us:5001 party="LiveChat528346"></call-us-selector>
|
||||
<call-us-selector party="LiveChat528346" phonesystem-url=https://rometech.east.3cx.us:5001></call-us-selector>
|
||||
|
||||
<!--Incase you don't want real time updates to the live chat plugin when options are changed, use the below code snippet. Please note that each time you change the settings you will need to copy and paste the snippet code to your website-->
|
||||
<!--Incase you don't want real time updates to the live chat plugin when options are changed, use the below code snippet. Please note that each time you change the settings you will need to copy and paste the snippet code to your website-->
|
||||
|
||||
<!--<call-us
|
||||
<!--<call-us
|
||||
|
||||
phonesystem-url=https://rometech.east.3cx.us:5001
|
||||
phonesystem-url=https://rometech.east.3cx.us:5001
|
||||
|
||||
style="position:fixed;font-size:16px;line-height:17px;z-index: 99999;right: 20px; bottom: 20px;"
|
||||
style="position:fixed;font-size:16px;line-height:17px;z-index: 99999;right: 20px; bottom: 20px;"
|
||||
|
||||
id="wp-live-chat-by-3CX"
|
||||
id="wp-live-chat-by-3CX"
|
||||
|
||||
minimized="true"
|
||||
minimized="true"
|
||||
|
||||
animation-style="noanimation"
|
||||
animation-style="noanimation"
|
||||
|
||||
party="LiveChat528346"
|
||||
party="LiveChat528346"
|
||||
|
||||
minimized-style="bubbleright"
|
||||
minimized-style="bubbleright"
|
||||
|
||||
allow-call="true"
|
||||
allow-call="true"
|
||||
|
||||
allow-video="false"
|
||||
allow-video="false"
|
||||
|
||||
allow-soundnotifications="true"
|
||||
allow-soundnotifications="true"
|
||||
|
||||
enable-mute="true"
|
||||
enable-mute="true"
|
||||
|
||||
enable-onmobile="true"
|
||||
enable-onmobile="true"
|
||||
|
||||
offline-enabled="true"
|
||||
offline-enabled="true"
|
||||
|
||||
enable="true"
|
||||
enable="true"
|
||||
|
||||
ignore-queueownership="false"
|
||||
ignore-queueownership="false"
|
||||
|
||||
authentication="both"
|
||||
authentication="both"
|
||||
|
||||
show-operator-actual-name="true"
|
||||
show-operator-actual-name="true"
|
||||
|
||||
aknowledge-received="true"
|
||||
aknowledge-received="true"
|
||||
|
||||
gdpr-enabled="false"
|
||||
gdpr-enabled="false"
|
||||
|
||||
message-userinfo-format="name"
|
||||
message-userinfo-format="name"
|
||||
|
||||
message-dateformat="both"
|
||||
message-dateformat="both"
|
||||
|
||||
lang="browser"
|
||||
lang="browser"
|
||||
|
||||
button-icon-type="default"
|
||||
button-icon-type="default"
|
||||
|
||||
greeting-visibility="none"
|
||||
greeting-visibility="none"
|
||||
|
||||
greeting-offline-visibility="none"
|
||||
greeting-offline-visibility="none"
|
||||
|
||||
chat-delay="2000"
|
||||
chat-delay="2000"
|
||||
|
||||
enable-direct-call="true"
|
||||
enable-direct-call="true"
|
||||
|
||||
enable-ga="false"
|
||||
enable-ga="false"
|
||||
|
||||
></call-us>-->
|
||||
></call-us>-->
|
||||
|
||||
<script defer src=https://downloads-global.3cx.com/downloads/livechatandtalk/v1/callus.js id="tcx-callus-js" charset="utf-8"></script>
|
||||
<script charset="utf-8" defer id="tcx-callus-js"
|
||||
src=https://downloads-global.3cx.com/downloads/livechatandtalk/v1/callus.js></script>
|
||||
|
||||
<link rel="apple-touch-icon" href="logo192.png" />
|
||||
<link href="logo192.png" rel="apple-touch-icon"/>
|
||||
<script>
|
||||
!(function () {
|
||||
"use strict";
|
||||
var e = [
|
||||
"debug",
|
||||
"destroy",
|
||||
"do",
|
||||
"help",
|
||||
"identify",
|
||||
"is",
|
||||
"off",
|
||||
"on",
|
||||
"ready",
|
||||
"render",
|
||||
"reset",
|
||||
"safe",
|
||||
"set",
|
||||
];
|
||||
if (window.noticeable)
|
||||
console.warn("Noticeable SDK code snippet loaded more than once");
|
||||
else {
|
||||
var n = (window.noticeable = window.noticeable || []);
|
||||
function t(e) {
|
||||
return function () {
|
||||
var t = Array.prototype.slice.call(arguments);
|
||||
return t.unshift(e), n.push(t), n;
|
||||
};
|
||||
}
|
||||
!(function () {
|
||||
for (var o = 0; o < e.length; o++) {
|
||||
var r = e[o];
|
||||
n[r] = t(r);
|
||||
!(function () {
|
||||
"use strict";
|
||||
var e = [
|
||||
"debug",
|
||||
"destroy",
|
||||
"do",
|
||||
"help",
|
||||
"identify",
|
||||
"is",
|
||||
"off",
|
||||
"on",
|
||||
"ready",
|
||||
"render",
|
||||
"reset",
|
||||
"safe",
|
||||
"set",
|
||||
];
|
||||
if (window.noticeable)
|
||||
console.warn("Noticeable SDK code snippet loaded more than once");
|
||||
else {
|
||||
var n = (window.noticeable = window.noticeable || []);
|
||||
|
||||
function t(e) {
|
||||
return function () {
|
||||
var t = Array.prototype.slice.call(arguments);
|
||||
return t.unshift(e), n.push(t), n;
|
||||
};
|
||||
}
|
||||
|
||||
!(function () {
|
||||
for (var o = 0; o < e.length; o++) {
|
||||
var r = e[o];
|
||||
n[r] = t(r);
|
||||
}
|
||||
})(),
|
||||
(function () {
|
||||
var e = document.createElement("script");
|
||||
(e.async = !0), (e.src = "https://sdk.noticeable.io/l.js");
|
||||
var n = document.head;
|
||||
n.insertBefore(e, n.firstChild);
|
||||
})();
|
||||
}
|
||||
})(),
|
||||
(function () {
|
||||
var e = document.createElement("script");
|
||||
(e.async = !0), (e.src = "https://sdk.noticeable.io/l.js");
|
||||
var n = document.head;
|
||||
n.insertBefore(e, n.firstChild);
|
||||
})();
|
||||
}
|
||||
})();
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is installed on a
|
||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||
-->
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<link href="%PUBLIC_URL%/manifest.json" rel="manifest"/>
|
||||
<!--
|
||||
Notice the use of %PUBLIC_URL% in the tags above.
|
||||
It will be replaced with the URL of the `public` folder during the build.
|
||||
@@ -136,9 +139,9 @@ enable-ga="false"
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>Rome Online</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
id="etuajo-oikeus"
|
||||
width="450"
|
||||
height="450">
|
||||
<path d="M 0,225 L 225,0 L 450,225 L 225,450" fill="#000000" />
|
||||
<path d="M 225,431.25 L 18.75,225 L 225,18.75 L 431.25,225" fill="#ffffff" />
|
||||
<path d="M 56.25,225 L 225,56.25 L 393.75,225 L 225,393.75" fill="#000000" />
|
||||
<path d="M 225,386.25 L 63.75,225 L 225,63.75 L 386.25,225" fill="#ffd90f" />
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
id="etuajo-oikeus"
|
||||
width="450"
|
||||
height="450">
|
||||
<path d="M 0,225 L 225,0 L 450,225 L 225,450" fill="#000000"/>
|
||||
<path d="M 225,431.25 L 18.75,225 L 225,18.75 L 431.25,225" fill="#ffffff"/>
|
||||
<path d="M 56.25,225 L 225,56.25 L 393.75,225 L 225,393.75" fill="#000000"/>
|
||||
<path d="M 225,386.25 L 63.75,225 L 225,63.75 L 386.25,225" fill="#ffd90f"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 572 B |
@@ -56,7 +56,7 @@ export function App({bodyshop, checkUserSession, currentUser, online, setOnline,
|
||||
}
|
||||
|
||||
checkUserSession();
|
||||
}, [checkUserSession, setOnline]);
|
||||
}, [checkUserSession, setOnline]);
|
||||
|
||||
//const b = Grid.useBreakpoint();
|
||||
// console.log("Breakpoints:", b);
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
animation: alertBlinker 1s linear infinite;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
@keyframes alertBlinker {
|
||||
50% {
|
||||
color: red;
|
||||
@@ -99,6 +100,7 @@
|
||||
color: rgba(255, 140, 0, 0.8);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.production-completion-past {
|
||||
color: rgba(255, 0, 0, 0.8);
|
||||
font-weight: bold;
|
||||
|
||||
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 52 KiB |
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 -256 1792 1792">
|
||||
<g transform="matrix(1,0,0,-1,197.42373,1300.6102)">
|
||||
<path d="M 1408,131 Q 1408,11 1335,-58.5 1262,-128 1141,-128 H 267 Q 146,-128 73,-58.5 0,11 0,131 0,184 3.5,234.5 7,285 17.5,343.5 28,402 44,452 q 16,50 43,97.5 27,47.5 62,81 35,33.5 85.5,53.5 50.5,20 111.5,20 9,0 42,-21.5 33,-21.5 74.5,-48 41.5,-26.5 108,-48 Q 637,565 704,565 q 67,0 133.5,21.5 66.5,21.5 108,48 41.5,26.5 74.5,48 33,21.5 42,21.5 61,0 111.5,-20 50.5,-20 85.5,-53.5 35,-33.5 62,-81 27,-47.5 43,-97.5 16,-50 26.5,-108.5 10.5,-58.5 14,-109 Q 1408,184 1408,131 z m -320,893 Q 1088,865 975.5,752.5 863,640 704,640 545,640 432.5,752.5 320,865 320,1024 320,1183 432.5,1295.5 545,1408 704,1408 863,1408 975.5,1295.5 1088,1183 1088,1024 z"/>
|
||||
</g>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
||||
viewBox="0 -256 1792 1792">
|
||||
<g transform="matrix(1,0,0,-1,197.42373,1300.6102)">
|
||||
<path d="M 1408,131 Q 1408,11 1335,-58.5 1262,-128 1141,-128 H 267 Q 146,-128 73,-58.5 0,11 0,131 0,184 3.5,234.5 7,285 17.5,343.5 28,402 44,452 q 16,50 43,97.5 27,47.5 62,81 35,33.5 85.5,53.5 50.5,20 111.5,20 9,0 42,-21.5 33,-21.5 74.5,-48 41.5,-26.5 108,-48 Q 637,565 704,565 q 67,0 133.5,21.5 66.5,21.5 108,48 41.5,26.5 74.5,48 33,21.5 42,21.5 61,0 111.5,-20 50.5,-20 85.5,-53.5 35,-33.5 62,-81 27,-47.5 43,-97.5 16,-50 26.5,-108.5 10.5,-58.5 14,-109 Q 1408,184 1408,131 z m -320,893 Q 1088,865 975.5,752.5 863,640 704,640 545,640 432.5,752.5 320,865 320,1024 320,1183 432.5,1295.5 545,1408 704,1408 863,1408 975.5,1295.5 1088,1183 1088,1024 z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 981 B After Width: | Height: | Size: 955 B |
@@ -1 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M23.5 7c.276 0 .5.224.5.5v.511c0 .793-.926.989-1.616.989l-1.086-2h2.202zm-1.441 3.506c.639 1.186.946 2.252.946 3.666 0 1.37-.397 2.533-1.005 3.981v1.847c0 .552-.448 1-1 1h-1.5c-.552 0-1-.448-1-1v-1h-13v1c0 .552-.448 1-1 1h-1.5c-.552 0-1-.448-1-1v-1.847c-.608-1.448-1.005-2.611-1.005-3.981 0-1.414.307-2.48.946-3.666.829-1.537 1.851-3.453 2.93-5.252.828-1.382 1.262-1.707 2.278-1.889 1.532-.275 2.918-.365 4.851-.365s3.319.09 4.851.365c1.016.182 1.45.507 2.278 1.889 1.079 1.799 2.101 3.715 2.93 5.252zm-16.059 2.994c0-.828-.672-1.5-1.5-1.5s-1.5.672-1.5 1.5.672 1.5 1.5 1.5 1.5-.672 1.5-1.5zm10 1c0-.276-.224-.5-.5-.5h-7c-.276 0-.5.224-.5.5s.224.5.5.5h7c.276 0 .5-.224.5-.5zm2.941-5.527s-.74-1.826-1.631-3.142c-.202-.298-.515-.502-.869-.566-1.511-.272-2.835-.359-4.441-.359s-2.93.087-4.441.359c-.354.063-.667.267-.869.566-.891 1.315-1.631 3.142-1.631 3.142 1.64.313 4.309.497 6.941.497s5.301-.184 6.941-.497zm2.059 4.527c0-.828-.672-1.5-1.5-1.5s-1.5.672-1.5 1.5.672 1.5 1.5 1.5 1.5-.672 1.5-1.5zm-18.298-6.5h-2.202c-.276 0-.5.224-.5.5v.511c0 .793.926.989 1.616.989l1.086-2z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<path d="M23.5 7c.276 0 .5.224.5.5v.511c0 .793-.926.989-1.616.989l-1.086-2h2.202zm-1.441 3.506c.639 1.186.946 2.252.946 3.666 0 1.37-.397 2.533-1.005 3.981v1.847c0 .552-.448 1-1 1h-1.5c-.552 0-1-.448-1-1v-1h-13v1c0 .552-.448 1-1 1h-1.5c-.552 0-1-.448-1-1v-1.847c-.608-1.448-1.005-2.611-1.005-3.981 0-1.414.307-2.48.946-3.666.829-1.537 1.851-3.453 2.93-5.252.828-1.382 1.262-1.707 2.278-1.889 1.532-.275 2.918-.365 4.851-.365s3.319.09 4.851.365c1.016.182 1.45.507 2.278 1.889 1.079 1.799 2.101 3.715 2.93 5.252zm-16.059 2.994c0-.828-.672-1.5-1.5-1.5s-1.5.672-1.5 1.5.672 1.5 1.5 1.5 1.5-.672 1.5-1.5zm10 1c0-.276-.224-.5-.5-.5h-7c-.276 0-.5.224-.5.5s.224.5.5.5h7c.276 0 .5-.224.5-.5zm2.941-5.527s-.74-1.826-1.631-3.142c-.202-.298-.515-.502-.869-.566-1.511-.272-2.835-.359-4.441-.359s-2.93.087-4.441.359c-.354.063-.667.267-.869.566-.891 1.315-1.631 3.142-1.631 3.142 1.64.313 4.309.497 6.941.497s5.301-.184 6.941-.497zm2.059 4.527c0-.828-.672-1.5-1.5-1.5s-1.5.672-1.5 1.5.672 1.5 1.5 1.5 1.5-.672 1.5-1.5zm-18.298-6.5h-2.202c-.276 0-.5.224-.5.5v.511c0 .793.926.989 1.616.989l1.086-2z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.2 KiB |
@@ -1,5 +1,21 @@
|
||||
<?xml version="1.0" ?><svg style="enable-background:new 0 0 128 128;" version="1.1" viewBox="0 0 128 128" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style type="text/css">
|
||||
<?xml version="1.0" ?>
|
||||
<svg style="enable-background:new 0 0 128 128;" version="1.1" viewBox="0 0 128 128" xml:space="preserve"
|
||||
xmlns="http://www.w3.org/2000/svg"><style type="text/css">
|
||||
.st0{fill:none;stroke:#000000;stroke-width:8;stroke-miterlimit:10;}
|
||||
.st1{display:none;}
|
||||
.st2{display:inline;opacity:0.25;fill:#F45EFD;}
|
||||
</style><g id="_x31_2_3D_Printing"/><g id="_x31_1_VR_Gear"/><g id="_x31_0_Virtual_reality"/><g id="_x39__Augmented_reality"/><g id="_x38__Teleport"/><g id="_x37__Glassess"/><g id="_x36__Folding_phone"/><g id="_x35__Drone"/><g id="_x34__Retina_scan"/><g id="_x33__Smartwatch"/><g id="_x32__Bionic_Arm"/><g id="_x31__Chip"><g><path d="M108,40c-5.2,0-9.6,3.3-11.3,8H84V32h-8V20h-8v12h-8V20h-8v12h-8v16H24v-8.7c4.7-1.7,8-6.1,8-11.3c0-6.6-5.4-12-12-12 S8,21.4,8,28c0,5.2,3.3,9.6,8,11.3V56h28v8H16v16.7c-4.7,1.7-8,6.1-8,11.3c0,6.6,5.4,12,12,12s12-5.4,12-12c0-5.2-3.3-9.6-8-11.3 V72h20v16h8v12h8V88h8v12h8V88h8V72h8v16.7c-4.7,1.7-8,6.1-8,11.3c0,6.6,5.4,12,12,12s12-5.4,12-12c0-5.2-3.3-9.6-8-11.3V64H84v-8 h12.7c1.7,4.7,6.1,8,11.3,8c6.6,0,12-5.4,12-12S114.6,40,108,40z M20,32c-2.2,0-4-1.8-4-4s1.8-4,4-4s4,1.8,4,4S22.2,32,20,32z M20,96c-2.2,0-4-1.8-4-4s1.8-4,4-4s4,1.8,4,4S22.2,96,20,96z M76,80H52V40h24V80z M96,96c2.2,0,4,1.8,4,4s-1.8,4-4,4s-4-1.8-4-4 S93.8,96,96,96z M108,56c-2.2,0-4-1.8-4-4s1.8-4,4-4s4,1.8,4,4S110.2,56,108,56z"/><rect height="8" width="8" x="56" y="64"/></g></g><g class="st1" id="Guide"><path class="st2" d="M120,8v112H8V8H120 M128,0H0v128h128V0L128,0z"/></g></svg>
|
||||
</style>
|
||||
<g id="_x31_2_3D_Printing"/>
|
||||
<g id="_x31_1_VR_Gear"/>
|
||||
<g id="_x31_0_Virtual_reality"/>
|
||||
<g id="_x39__Augmented_reality"/>
|
||||
<g id="_x38__Teleport"/>
|
||||
<g id="_x37__Glassess"/>
|
||||
<g id="_x36__Folding_phone"/>
|
||||
<g id="_x35__Drone"/>
|
||||
<g id="_x34__Retina_scan"/>
|
||||
<g id="_x33__Smartwatch"/>
|
||||
<g id="_x32__Bionic_Arm"/>
|
||||
<g id="_x31__Chip"><g><path d="M108,40c-5.2,0-9.6,3.3-11.3,8H84V32h-8V20h-8v12h-8V20h-8v12h-8v16H24v-8.7c4.7-1.7,8-6.1,8-11.3c0-6.6-5.4-12-12-12 S8,21.4,8,28c0,5.2,3.3,9.6,8,11.3V56h28v8H16v16.7c-4.7,1.7-8,6.1-8,11.3c0,6.6,5.4,12,12,12s12-5.4,12-12c0-5.2-3.3-9.6-8-11.3 V72h20v16h8v12h8V88h8v12h8V88h8V72h8v16.7c-4.7,1.7-8,6.1-8,11.3c0,6.6,5.4,12,12,12s12-5.4,12-12c0-5.2-3.3-9.6-8-11.3V64H84v-8 h12.7c1.7,4.7,6.1,8,11.3,8c6.6,0,12-5.4,12-12S114.6,40,108,40z M20,32c-2.2,0-4-1.8-4-4s1.8-4,4-4s4,1.8,4,4S22.2,32,20,32z M20,96c-2.2,0-4-1.8-4-4s1.8-4,4-4s4,1.8,4,4S22.2,96,20,96z M76,80H52V40h24V80z M96,96c2.2,0,4,1.8,4,4s-1.8,4-4,4s-4-1.8-4-4 S93.8,96,96,96z M108,56c-2.2,0-4-1.8-4-4s1.8-4,4-4s4,1.8,4,4S110.2,56,108,56z"/><rect
|
||||
height="8" width="8" x="56" y="64"/></g></g>
|
||||
<g class="st1" id="Guide"><path class="st2" d="M120,8v112H8V8H120 M128,0H0v128h128V0L128,0z"/></g></svg>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 30 KiB |
@@ -1,144 +1,216 @@
|
||||
<svg id="svg166" version="1.1" viewBox="0 0 1668 1160" xmlns="http://www.w3.org/2000/svg">
|
||||
<g id="g158" transform="translate(254 -254)">
|
||||
<g id="g34" transform="translate(-13.78 3.524)" stroke="#000">
|
||||
<path id="path10" d="m494.57 1006.9c41.429-15.714 140-11.427 191.43-12.857 51.429-1.429 160.48 10.23 201.43 27.143 40.995 16.93 134.78 67.656 151.43 72.857 22.857 7.143 41.429 7.143 80 20 38.572 12.857 25.714 32.857 25.714 32.857l-30-4.286-5.756 52.92s37.185 1.366 41.47 15.652c4.286 14.286 5.715 31.428-2.856 41.428-8.572 10-14.286-1.428-18.572 12.858-4.286 14.285-2.857 28.571-27.143 27.142-24.285-1.428-98.571 0-98.571 0s-15.714-108.57-98.573-105.71c-82.857 2.857-95.714 105.71-95.714 105.71h-500s-5.714-104.28-97.143-105.71c-91.428-1.428-98.571 105.71-98.571 105.71h-65.713l-18.572-38.571c-0.515 0-26.243 0-21.428-17.143 4.651-16.561-4.286-41.428 17.142-41.428 21.429 0 47.143 1.428 47.143 1.428l15.715-44.286-41.429-2.857s34.286-24.285 118.57-32.857c84.286-8.571 157.14-8.571 192.86-31.428 35.714-22.858 137.14-78.572 137.14-78.572z" fill="none" stroke-width="5"/>
|
||||
<path id="path12" d="m28.857 1254h92.857m180 0h517.14m172.86 0h151.43" fill="none" stroke-width="2"/>
|
||||
<path id="path14" d="m364.57 1101.1c15.715-18.572 123.37-81.525 151.43-88.572 29.502-7.41 103-7.142 103-7.142l-7.143 95.714z" fill="#f0ffeb" stroke-width="5"/>
|
||||
<path id="path16" d="m404.57 1071.1v28.571" fill="none" stroke-width="2"/>
|
||||
<path id="path18" d="m644.7 1006.8-4.285 94.328h207.16c-11.307-20.753-46.612-74.906-72.857-88.572-14.285-10-82.878-4.327-130.02-5.756zm167.02 7.164s80 84.286 85.715 87.143c5.714 2.857 115.71 1.428 115.71 1.428s-77.143-47.141-102.86-58.571c-25.715-11.429-90-31.429-98.572-30z" fill="#f0ffeb" stroke-width="5"/>
|
||||
<g fill="none">
|
||||
<path id="path20" d="m345.64 1091.7c-14.075 30.968-18.298 71.788-18.298 94.31 0 22.521 4.223 91.493 22.521 105.57m282.93-298.41c-1.408 5.63-4.047 81.903-6.51 106.93-3.67 18.715-4.989 51.219-6.159 87.315 0 22.522 7.038 80.233 12.669 105.57" stroke-width="5"/>
|
||||
<path id="path22" d="m103.53 1252.1s15.483-85.864 106.98-85.864c91.494 0 109.79 87.271 109.79 87.271m479.99 0s15.483-85.863 106.98-85.863c91.493 0 109.79 87.27 109.79 87.27m-947.31-57.711h63.342" stroke-width="2"/>
|
||||
<path id="path24" d="m779.18 1000.2c18.299 12.668 56.304 50.673 92.9 104.16 36.598 53.489 8.447 59.12-18.298 74.603-26.744 15.483-49.266 42.227-67.564 112.61" stroke-width="5"/>
|
||||
<path id="path26" d="m1112.8 1196h-129.5m-696.76-0.222h544.74m-22.522-150.61v54.896" stroke-width="2"/>
|
||||
</g>
|
||||
<g stroke-width="2">
|
||||
<rect id="rect28" x="558.65" y="1144.9" width="41.286" height="14.541" rx="2.933" ry="7.379" fill="#e6e6e6"/>
|
||||
<rect id="rect30" x="816.24" y="1144.9" width="41.286" height="14.541" rx="2.933" ry="7.379" fill="#e6e6e6"/>
|
||||
<rect id="rect32" x="259.53" y="1146.3" width="18.776" height="11.738" rx="1.63" ry="7.692" fill="#ffcb00"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="g54" transform="translate(-13.78 15.524)" stroke="#000">
|
||||
<path id="path36" d="m62.767 812.59-11.712 16.12-18.95-6.157v-19.925l18.95-6.158z" fill="none" stroke-width="5"/>
|
||||
<path id="path38" d="m31.742 745.02 315.3-111.2m-316.71 254.77 315.3 115.42" fill="none" stroke-width="2"/>
|
||||
<path id="path40" d="m341.41 632.78 140.76 38.005s-8.446 49.222-8.446 71.963v147.62c0 30.967 8.445 78.825 8.445 78.825l-140.76 33.782s-17.242-61.902-17.242-92.901l2.111-185.8c-1.408-30.967 15.132-91.493 15.132-91.493z" fill="#f0ffeb" stroke-width="5"/>
|
||||
<g fill="none">
|
||||
<path id="path42" d="m482.17 670.79s94.309 5.63 152.02 5.63c106.98 0 201.29-5.63 201.29-5.63m-1.408 297s-77.418-5.63-199.88-5.63c-68.972 0-152.02 7.038-152.02 7.038" stroke-width="5"/>
|
||||
<rect id="rect44" x="528.62" y="729.2" width="106.98" height="181.58" rx="31.19" ry="34.436" stroke-width="2"/>
|
||||
<path id="path46" d="m345.78 632.78h-294.19l-14.076 102.75-7.038 11.26v142.17l7.038 14.076 15.483 101.35h288.56m491.11-333.6s-12.668 47.858-12.668 73.195v146.39c0 25.336 12.668 77.417 12.668 77.417l205.51 38.005h108.38s14.076-81.64 14.076-115.42v-147.8c0-38.005-14.076-109.79-14.076-109.79h-108.38z" stroke-width="5"/>
|
||||
</g>
|
||||
<path id="path48" d="m843.92 689.09s-8.445 40.82-8.445 56.303v144.98c0 19.706 7.038 57.711 7.038 57.711s94.308 26.744 123.87 26.744h42.228v-312.49h-47.859c-25.336 0-116.83 26.745-116.83 26.745z" fill="#f0ffeb" stroke-width="5"/>
|
||||
<path id="path50" d="m1038.2 632.78s30.967 40.82 30.967 111.2v146.39c0 64.749-30.967 116.83-30.967 116.83m-713.65-263.22 32.374-32.375v-40.82 112.61m-33.078 81.641 32.374-32.375v-40.82 112.61m648.9-116.83-32.375-32.374v-40.82 112.61" fill="none" stroke-width="2"/>
|
||||
<path id="path52" d="m341.41 632.78s-42.228 78.825-42.228 111.2v146.39c0 40.82 42.228 114.02 42.228 114.02" fill="none" stroke-width="2"/>
|
||||
</g>
|
||||
<g fill="none" stroke="#000">
|
||||
<path id="path56" d="m-106.79 740.92 1.407-91.493s5.63-23.93-25.337-25.337c-30.967-1.408-26.744 2.815-26.744 2.815l1.408 415.24h28.152c28.152 0 22.521-22.52 22.521-22.52v-95.717c-12.677 0-11.26-9.614-11.26-16.891v-149.2c0.45-18.89 9.853-16.892 9.853-16.892z" stroke-width="5"/>
|
||||
<path id="path58" d="m-155.99 646.16h49.265m-48.415 374.27h49.266m-50.82-315.37h49.266m-46.451 259.81h49.266" stroke-width="2.2"/>
|
||||
<path id="path60" d="m-147.1 703.82v260.4m9.853-258.84v260.4" stroke-width="2"/>
|
||||
</g>
|
||||
<g id="g88" transform="translate(-13.78 15.524)" stroke="#000">
|
||||
<path id="path62" d="m494.57 641.61c41.429 15.714 140 11.428 191.43 12.856s160.48-10.23 201.43-27.143c40.995-16.93 134.78-67.656 151.43-72.857 22.857-7.143 41.429-7.143 80-20 38.572-12.857 25.714-32.857 25.714-32.857l-30 4.285-5.756-52.92s37.185-1.365 41.47-15.651c4.286-14.286 5.715-31.429-2.856-41.429-8.572-10-14.286 1.429-18.572-12.857-4.286-14.285-2.857-28.571-27.143-27.143-24.285 1.429-98.571 0-98.571 0s-15.714 108.57-98.572 105.72c-82.857-2.857-95.714-105.72-95.714-105.72h-500s-5.714 104.29-97.143 105.72c-91.428 1.428-98.571-105.72-98.571-105.72h-65.714l-18.572 38.572c-0.515 0-26.243 0-21.428 17.143 4.651 16.561-4.286 41.428 17.142 41.428 21.429 0 47.143-1.428 47.143-1.428l15.715 44.285-41.429 2.859s34.286 24.285 118.57 32.857c84.286 8.571 157.14 8.571 192.86 31.428 35.714 22.857 137.14 78.572 137.14 78.572z" fill="none" stroke-width="5"/>
|
||||
<path id="path64" d="m28.857 394.47h92.857m180 0h517.14m172.86 0h151.43" fill="none" stroke-width="2"/>
|
||||
<path id="path66" d="m364.57 547.33c15.715 18.571 123.37 81.524 151.43 88.571 29.502 7.41 103 7.143 103 7.143l-7.143-95.714z" fill="#f0ffeb" stroke-width="5"/>
|
||||
<path id="path68" d="m404.57 577.33v-28.571" fill="none" stroke-width="2"/>
|
||||
<path id="path70" d="m644.7 641.64-4.285-94.328h207.16c-11.307 20.753-46.612 74.906-72.857 88.571-14.285 10-82.878 4.328-130.02 5.757zm167.02-7.165s80-84.285 85.715-87.142c5.714-2.857 115.71-1.429 115.71-1.429s-77.143 47.143-102.86 58.572c-25.715 11.428-90 31.428-98.572 30z" fill="#f0ffeb" stroke-width="5"/>
|
||||
<g fill="none">
|
||||
<path id="path72" d="m345.64 556.81c-14.075-30.967-18.298-71.787-18.298-94.309 0-22.521 4.223-91.493 22.521-105.57m282.93 298.41c-1.408-5.63-4.047-81.905-6.51-106.93-3.67-18.714-4.989-51.218-6.159-87.314 0-22.522 7.038-80.233 12.669-105.57" stroke-width="5"/>
|
||||
<path id="path74" d="m103.53 396.34s15.483 85.864 106.98 85.864c91.494 0 109.79-87.271 109.79-87.271m479.99 0s15.483 85.863 106.98 85.863c91.493 0 109.79-87.27 109.79-87.27m-947.31 57.71h63.342" stroke-width="2"/>
|
||||
<path id="path76" d="m779.18 648.3c18.299-12.669 56.304-50.674 92.9-104.16 36.598-53.489 8.447-59.12-18.298-74.603-26.744-15.483-49.266-42.228-67.564-112.61" stroke-width="5"/>
|
||||
<path id="path78" d="m1112.8 452.42h-129.5m-696.76 0.223h544.74m-22.522 150.61v-54.895" stroke-width="2"/>
|
||||
</g>
|
||||
<g stroke-width="2">
|
||||
<rect id="rect80" transform="scale(1 -1)" x="558.65" y="-503.55" width="41.286" height="14.541" rx="2.933" ry="7.379" fill="#e6e6e6"/>
|
||||
<rect id="rect82" transform="scale(1 -1)" x="816.24" y="-503.55" width="41.286" height="14.541" rx="2.933" ry="7.379" fill="#e6e6e6"/>
|
||||
<rect id="rect84" transform="scale(1 -1)" x="259.53" y="-502.15" width="18.776" height="11.738" rx="1.63" ry="7.692" fill="#ffcb00"/>
|
||||
<circle id="circle86" transform="translate(941.34 284)" cx="59.119" cy="211.28" r="16.891" fill="#fff"/>
|
||||
</g>
|
||||
</g>
|
||||
<path id="path90" d="m-126.58 704.93v260.4" fill="none" stroke="#000" stroke-width="2"/>
|
||||
<path id="path92" d="m-153.88 992.49v-26.041h45.043v52.08h-45.043zm0-316.71v-27.448h45.043v54.898h-45.043z" fill="#ffffc0"/>
|
||||
<g fill="none" stroke="#000">
|
||||
<path id="path94" d="m-157.4 624.38s-4.223-12.669-18.299-12.669-14.076 8.446-14.076 8.446v423.69s1.408 9.853 14.076 9.853c12.669 0 18.3-9.853 18.3-9.853" stroke-width="5"/>
|
||||
<path id="path96" d="m-191.18 624.38s-35.19-1.408-35.19 21.114v371.6c0 22.521 36.597 25.336 36.597 25.336" stroke-width="5"/>
|
||||
<g stroke-width="2">
|
||||
<rect id="rect98" x="-216.51" y="648.31" width="16.891" height="35.19" rx="7.742" ry="6.284"/>
|
||||
<rect id="rect100" x="-216.51" y="985.58" width="16.891" height="35.19" rx="7.742" ry="6.284"/>
|
||||
<path id="path102" d="m-62.939 645.49h30.967v377.24h-30.967z"/>
|
||||
</g>
|
||||
<path id="path104" d="m1200.9 633.86v73.195h67.565v-83.048l-25.337-14.076zm0 329.38h67.565v78.826l-23.93 14.076-43.635-18.3zm0-270.26v284.33m67.565-283.74v284.33" stroke-width="5"/>
|
||||
<path id="path106" d="m1216.6 759.51h14.076v147.8h-14.076zm7.631-1.408v-53.488m0 257.37v-53.49m30.375-201.06v256.18" stroke-width="2"/>
|
||||
<path id="path108" d="m1268.8 624.97s4.223-12.668 18.299-12.668 14.076 8.445 14.076 8.445v423.69s-1.408 9.853-14.076 9.853c-12.669 0-18.299-9.853-18.299-9.853m33.783-419.46s35.19-1.408 35.19 21.114v371.6c0 22.521-36.598 25.337-36.598 25.337" stroke-width="5"/>
|
||||
<g stroke-width="2">
|
||||
<rect id="rect110" transform="scale(-1 1)" x="-1329.9" y="648.9" width="16.891" height="35.19" rx="7.742" ry="6.284"/>
|
||||
<rect id="rect112" transform="scale(-1 1)" x="-1329.9" y="986.17" width="16.891" height="35.19" rx="7.742" ry="6.284"/>
|
||||
<path id="path114" d="m1199.7 632.82 67.565 74.603m-67.565 0.592 67.565-73.195m-67.342 328.16 67.565 74.602m-67.565 0.593 67.565-73.195"/>
|
||||
</g>
|
||||
</g>
|
||||
<g stroke="#000">
|
||||
<g stroke-width="2">
|
||||
<circle id="circle116" transform="translate(78.489 1074.7)" cx="119.65" cy="202.84" r="76.01" fill="#c8c8c8"/>
|
||||
<circle id="circle118" transform="translate(94.676 1204.9)" cx="103.46" cy="72.633" r="44.339" fill="#fff"/>
|
||||
<circle id="circle120" transform="translate(78.489 187.66)" cx="119.65" cy="202.84" r="76.01" fill="#c8c8c8"/>
|
||||
<circle id="circle122" transform="translate(94.676 317.86)" cx="103.46" cy="72.633" r="44.339" fill="#fff"/>
|
||||
<circle id="circle124" transform="translate(773.02 187.66)" cx="119.65" cy="202.84" r="76.01" fill="#c8c8c8"/>
|
||||
<circle id="circle126" transform="translate(789.21 317.86)" cx="103.46" cy="72.633" r="44.339" fill="#fff"/>
|
||||
<circle id="circle128" transform="translate(773.02 1074.7)" cx="119.65" cy="202.84" r="76.01" fill="#c8c8c8"/>
|
||||
<circle id="circle130" transform="translate(789.21 1204.9)" cx="103.46" cy="72.633" r="44.339" fill="#fff"/>
|
||||
</g>
|
||||
<path id="path132" d="m1338.5 829.07h40.82" fill="none" stroke-width="5"/>
|
||||
<circle id="circle134" transform="translate(1441.3 600.31)" cx="-59.119" cy="229.58" r="4.223" fill="#3c3c3c" stroke-width="5"/>
|
||||
<g stroke-width="2">
|
||||
<path id="path136" d="m778.06 845.37-38.709-38.709" fill="none"/>
|
||||
<g id="g146" transform="translate(-13.78 15.524)" fill="#3c3c3c">
|
||||
<circle id="circle138" transform="translate(-79.458 449.8)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<circle id="circle140" transform="translate(-79.458 569.92)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<circle id="circle142" transform="translate(-79.458 690.03)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<circle id="circle144" transform="translate(-79.458 810.15)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<g id="g158" transform="translate(254 -254)">
|
||||
<g id="g34" transform="translate(-13.78 3.524)" stroke="#000">
|
||||
<path id="path10"
|
||||
d="m494.57 1006.9c41.429-15.714 140-11.427 191.43-12.857 51.429-1.429 160.48 10.23 201.43 27.143 40.995 16.93 134.78 67.656 151.43 72.857 22.857 7.143 41.429 7.143 80 20 38.572 12.857 25.714 32.857 25.714 32.857l-30-4.286-5.756 52.92s37.185 1.366 41.47 15.652c4.286 14.286 5.715 31.428-2.856 41.428-8.572 10-14.286-1.428-18.572 12.858-4.286 14.285-2.857 28.571-27.143 27.142-24.285-1.428-98.571 0-98.571 0s-15.714-108.57-98.573-105.71c-82.857 2.857-95.714 105.71-95.714 105.71h-500s-5.714-104.28-97.143-105.71c-91.428-1.428-98.571 105.71-98.571 105.71h-65.713l-18.572-38.571c-0.515 0-26.243 0-21.428-17.143 4.651-16.561-4.286-41.428 17.142-41.428 21.429 0 47.143 1.428 47.143 1.428l15.715-44.286-41.429-2.857s34.286-24.285 118.57-32.857c84.286-8.571 157.14-8.571 192.86-31.428 35.714-22.858 137.14-78.572 137.14-78.572z"
|
||||
fill="none" stroke-width="5"/>
|
||||
<path id="path12" d="m28.857 1254h92.857m180 0h517.14m172.86 0h151.43" fill="none" stroke-width="2"/>
|
||||
<path id="path14"
|
||||
d="m364.57 1101.1c15.715-18.572 123.37-81.525 151.43-88.572 29.502-7.41 103-7.142 103-7.142l-7.143 95.714z"
|
||||
fill="#f0ffeb" stroke-width="5"/>
|
||||
<path id="path16" d="m404.57 1071.1v28.571" fill="none" stroke-width="2"/>
|
||||
<path id="path18"
|
||||
d="m644.7 1006.8-4.285 94.328h207.16c-11.307-20.753-46.612-74.906-72.857-88.572-14.285-10-82.878-4.327-130.02-5.756zm167.02 7.164s80 84.286 85.715 87.143c5.714 2.857 115.71 1.428 115.71 1.428s-77.143-47.141-102.86-58.571c-25.715-11.429-90-31.429-98.572-30z"
|
||||
fill="#f0ffeb" stroke-width="5"/>
|
||||
<g fill="none">
|
||||
<path id="path20"
|
||||
d="m345.64 1091.7c-14.075 30.968-18.298 71.788-18.298 94.31 0 22.521 4.223 91.493 22.521 105.57m282.93-298.41c-1.408 5.63-4.047 81.903-6.51 106.93-3.67 18.715-4.989 51.219-6.159 87.315 0 22.522 7.038 80.233 12.669 105.57"
|
||||
stroke-width="5"/>
|
||||
<path id="path22"
|
||||
d="m103.53 1252.1s15.483-85.864 106.98-85.864c91.494 0 109.79 87.271 109.79 87.271m479.99 0s15.483-85.863 106.98-85.863c91.493 0 109.79 87.27 109.79 87.27m-947.31-57.711h63.342"
|
||||
stroke-width="2"/>
|
||||
<path id="path24"
|
||||
d="m779.18 1000.2c18.299 12.668 56.304 50.673 92.9 104.16 36.598 53.489 8.447 59.12-18.298 74.603-26.744 15.483-49.266 42.227-67.564 112.61"
|
||||
stroke-width="5"/>
|
||||
<path id="path26" d="m1112.8 1196h-129.5m-696.76-0.222h544.74m-22.522-150.61v54.896" stroke-width="2"/>
|
||||
</g>
|
||||
<g stroke-width="2">
|
||||
<rect id="rect28" x="558.65" y="1144.9" width="41.286" height="14.541" rx="2.933" ry="7.379"
|
||||
fill="#e6e6e6"/>
|
||||
<rect id="rect30" x="816.24" y="1144.9" width="41.286" height="14.541" rx="2.933" ry="7.379"
|
||||
fill="#e6e6e6"/>
|
||||
<rect id="rect32" x="259.53" y="1146.3" width="18.776" height="11.738" rx="1.63" ry="7.692"
|
||||
fill="#ffcb00"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="g54" transform="translate(-13.78 15.524)" stroke="#000">
|
||||
<path id="path36" d="m62.767 812.59-11.712 16.12-18.95-6.157v-19.925l18.95-6.158z" fill="none"
|
||||
stroke-width="5"/>
|
||||
<path id="path38" d="m31.742 745.02 315.3-111.2m-316.71 254.77 315.3 115.42" fill="none" stroke-width="2"/>
|
||||
<path id="path40"
|
||||
d="m341.41 632.78 140.76 38.005s-8.446 49.222-8.446 71.963v147.62c0 30.967 8.445 78.825 8.445 78.825l-140.76 33.782s-17.242-61.902-17.242-92.901l2.111-185.8c-1.408-30.967 15.132-91.493 15.132-91.493z"
|
||||
fill="#f0ffeb" stroke-width="5"/>
|
||||
<g fill="none">
|
||||
<path id="path42"
|
||||
d="m482.17 670.79s94.309 5.63 152.02 5.63c106.98 0 201.29-5.63 201.29-5.63m-1.408 297s-77.418-5.63-199.88-5.63c-68.972 0-152.02 7.038-152.02 7.038"
|
||||
stroke-width="5"/>
|
||||
<rect id="rect44" x="528.62" y="729.2" width="106.98" height="181.58" rx="31.19" ry="34.436"
|
||||
stroke-width="2"/>
|
||||
<path id="path46"
|
||||
d="m345.78 632.78h-294.19l-14.076 102.75-7.038 11.26v142.17l7.038 14.076 15.483 101.35h288.56m491.11-333.6s-12.668 47.858-12.668 73.195v146.39c0 25.336 12.668 77.417 12.668 77.417l205.51 38.005h108.38s14.076-81.64 14.076-115.42v-147.8c0-38.005-14.076-109.79-14.076-109.79h-108.38z"
|
||||
stroke-width="5"/>
|
||||
</g>
|
||||
<path id="path48"
|
||||
d="m843.92 689.09s-8.445 40.82-8.445 56.303v144.98c0 19.706 7.038 57.711 7.038 57.711s94.308 26.744 123.87 26.744h42.228v-312.49h-47.859c-25.336 0-116.83 26.745-116.83 26.745z"
|
||||
fill="#f0ffeb" stroke-width="5"/>
|
||||
<path id="path50"
|
||||
d="m1038.2 632.78s30.967 40.82 30.967 111.2v146.39c0 64.749-30.967 116.83-30.967 116.83m-713.65-263.22 32.374-32.375v-40.82 112.61m-33.078 81.641 32.374-32.375v-40.82 112.61m648.9-116.83-32.375-32.374v-40.82 112.61"
|
||||
fill="none" stroke-width="2"/>
|
||||
<path id="path52" d="m341.41 632.78s-42.228 78.825-42.228 111.2v146.39c0 40.82 42.228 114.02 42.228 114.02"
|
||||
fill="none" stroke-width="2"/>
|
||||
</g>
|
||||
<g fill="none" stroke="#000">
|
||||
<path id="path56"
|
||||
d="m-106.79 740.92 1.407-91.493s5.63-23.93-25.337-25.337c-30.967-1.408-26.744 2.815-26.744 2.815l1.408 415.24h28.152c28.152 0 22.521-22.52 22.521-22.52v-95.717c-12.677 0-11.26-9.614-11.26-16.891v-149.2c0.45-18.89 9.853-16.892 9.853-16.892z"
|
||||
stroke-width="5"/>
|
||||
<path id="path58"
|
||||
d="m-155.99 646.16h49.265m-48.415 374.27h49.266m-50.82-315.37h49.266m-46.451 259.81h49.266"
|
||||
stroke-width="2.2"/>
|
||||
<path id="path60" d="m-147.1 703.82v260.4m9.853-258.84v260.4" stroke-width="2"/>
|
||||
</g>
|
||||
<g id="g88" transform="translate(-13.78 15.524)" stroke="#000">
|
||||
<path id="path62"
|
||||
d="m494.57 641.61c41.429 15.714 140 11.428 191.43 12.856s160.48-10.23 201.43-27.143c40.995-16.93 134.78-67.656 151.43-72.857 22.857-7.143 41.429-7.143 80-20 38.572-12.857 25.714-32.857 25.714-32.857l-30 4.285-5.756-52.92s37.185-1.365 41.47-15.651c4.286-14.286 5.715-31.429-2.856-41.429-8.572-10-14.286 1.429-18.572-12.857-4.286-14.285-2.857-28.571-27.143-27.143-24.285 1.429-98.571 0-98.571 0s-15.714 108.57-98.572 105.72c-82.857-2.857-95.714-105.72-95.714-105.72h-500s-5.714 104.29-97.143 105.72c-91.428 1.428-98.571-105.72-98.571-105.72h-65.714l-18.572 38.572c-0.515 0-26.243 0-21.428 17.143 4.651 16.561-4.286 41.428 17.142 41.428 21.429 0 47.143-1.428 47.143-1.428l15.715 44.285-41.429 2.859s34.286 24.285 118.57 32.857c84.286 8.571 157.14 8.571 192.86 31.428 35.714 22.857 137.14 78.572 137.14 78.572z"
|
||||
fill="none" stroke-width="5"/>
|
||||
<path id="path64" d="m28.857 394.47h92.857m180 0h517.14m172.86 0h151.43" fill="none" stroke-width="2"/>
|
||||
<path id="path66"
|
||||
d="m364.57 547.33c15.715 18.571 123.37 81.524 151.43 88.571 29.502 7.41 103 7.143 103 7.143l-7.143-95.714z"
|
||||
fill="#f0ffeb" stroke-width="5"/>
|
||||
<path id="path68" d="m404.57 577.33v-28.571" fill="none" stroke-width="2"/>
|
||||
<path id="path70"
|
||||
d="m644.7 641.64-4.285-94.328h207.16c-11.307 20.753-46.612 74.906-72.857 88.571-14.285 10-82.878 4.328-130.02 5.757zm167.02-7.165s80-84.285 85.715-87.142c5.714-2.857 115.71-1.429 115.71-1.429s-77.143 47.143-102.86 58.572c-25.715 11.428-90 31.428-98.572 30z"
|
||||
fill="#f0ffeb" stroke-width="5"/>
|
||||
<g fill="none">
|
||||
<path id="path72"
|
||||
d="m345.64 556.81c-14.075-30.967-18.298-71.787-18.298-94.309 0-22.521 4.223-91.493 22.521-105.57m282.93 298.41c-1.408-5.63-4.047-81.905-6.51-106.93-3.67-18.714-4.989-51.218-6.159-87.314 0-22.522 7.038-80.233 12.669-105.57"
|
||||
stroke-width="5"/>
|
||||
<path id="path74"
|
||||
d="m103.53 396.34s15.483 85.864 106.98 85.864c91.494 0 109.79-87.271 109.79-87.271m479.99 0s15.483 85.863 106.98 85.863c91.493 0 109.79-87.27 109.79-87.27m-947.31 57.71h63.342"
|
||||
stroke-width="2"/>
|
||||
<path id="path76"
|
||||
d="m779.18 648.3c18.299-12.669 56.304-50.674 92.9-104.16 36.598-53.489 8.447-59.12-18.298-74.603-26.744-15.483-49.266-42.228-67.564-112.61"
|
||||
stroke-width="5"/>
|
||||
<path id="path78" d="m1112.8 452.42h-129.5m-696.76 0.223h544.74m-22.522 150.61v-54.895"
|
||||
stroke-width="2"/>
|
||||
</g>
|
||||
<g stroke-width="2">
|
||||
<rect id="rect80" transform="scale(1 -1)" x="558.65" y="-503.55" width="41.286" height="14.541"
|
||||
rx="2.933" ry="7.379" fill="#e6e6e6"/>
|
||||
<rect id="rect82" transform="scale(1 -1)" x="816.24" y="-503.55" width="41.286" height="14.541"
|
||||
rx="2.933" ry="7.379" fill="#e6e6e6"/>
|
||||
<rect id="rect84" transform="scale(1 -1)" x="259.53" y="-502.15" width="18.776" height="11.738"
|
||||
rx="1.63" ry="7.692" fill="#ffcb00"/>
|
||||
<circle id="circle86" transform="translate(941.34 284)" cx="59.119" cy="211.28" r="16.891" fill="#fff"/>
|
||||
</g>
|
||||
</g>
|
||||
<path id="path90" d="m-126.58 704.93v260.4" fill="none" stroke="#000" stroke-width="2"/>
|
||||
<path id="path92" d="m-153.88 992.49v-26.041h45.043v52.08h-45.043zm0-316.71v-27.448h45.043v54.898h-45.043z"
|
||||
fill="#ffffc0"/>
|
||||
<g fill="none" stroke="#000">
|
||||
<path id="path94"
|
||||
d="m-157.4 624.38s-4.223-12.669-18.299-12.669-14.076 8.446-14.076 8.446v423.69s1.408 9.853 14.076 9.853c12.669 0 18.3-9.853 18.3-9.853"
|
||||
stroke-width="5"/>
|
||||
<path id="path96" d="m-191.18 624.38s-35.19-1.408-35.19 21.114v371.6c0 22.521 36.597 25.336 36.597 25.336"
|
||||
stroke-width="5"/>
|
||||
<g stroke-width="2">
|
||||
<rect id="rect98" x="-216.51" y="648.31" width="16.891" height="35.19" rx="7.742" ry="6.284"/>
|
||||
<rect id="rect100" x="-216.51" y="985.58" width="16.891" height="35.19" rx="7.742" ry="6.284"/>
|
||||
<path id="path102" d="m-62.939 645.49h30.967v377.24h-30.967z"/>
|
||||
</g>
|
||||
<path id="path104"
|
||||
d="m1200.9 633.86v73.195h67.565v-83.048l-25.337-14.076zm0 329.38h67.565v78.826l-23.93 14.076-43.635-18.3zm0-270.26v284.33m67.565-283.74v284.33"
|
||||
stroke-width="5"/>
|
||||
<path id="path106"
|
||||
d="m1216.6 759.51h14.076v147.8h-14.076zm7.631-1.408v-53.488m0 257.37v-53.49m30.375-201.06v256.18"
|
||||
stroke-width="2"/>
|
||||
<path id="path108"
|
||||
d="m1268.8 624.97s4.223-12.668 18.299-12.668 14.076 8.445 14.076 8.445v423.69s-1.408 9.853-14.076 9.853c-12.669 0-18.299-9.853-18.299-9.853m33.783-419.46s35.19-1.408 35.19 21.114v371.6c0 22.521-36.598 25.337-36.598 25.337"
|
||||
stroke-width="5"/>
|
||||
<g stroke-width="2">
|
||||
<rect id="rect110" transform="scale(-1 1)" x="-1329.9" y="648.9" width="16.891" height="35.19"
|
||||
rx="7.742" ry="6.284"/>
|
||||
<rect id="rect112" transform="scale(-1 1)" x="-1329.9" y="986.17" width="16.891" height="35.19"
|
||||
rx="7.742" ry="6.284"/>
|
||||
<path id="path114"
|
||||
d="m1199.7 632.82 67.565 74.603m-67.565 0.592 67.565-73.195m-67.342 328.16 67.565 74.602m-67.565 0.593 67.565-73.195"/>
|
||||
</g>
|
||||
</g>
|
||||
<g stroke="#000">
|
||||
<g stroke-width="2">
|
||||
<circle id="circle116" transform="translate(78.489 1074.7)" cx="119.65" cy="202.84" r="76.01"
|
||||
fill="#c8c8c8"/>
|
||||
<circle id="circle118" transform="translate(94.676 1204.9)" cx="103.46" cy="72.633" r="44.339"
|
||||
fill="#fff"/>
|
||||
<circle id="circle120" transform="translate(78.489 187.66)" cx="119.65" cy="202.84" r="76.01"
|
||||
fill="#c8c8c8"/>
|
||||
<circle id="circle122" transform="translate(94.676 317.86)" cx="103.46" cy="72.633" r="44.339"
|
||||
fill="#fff"/>
|
||||
<circle id="circle124" transform="translate(773.02 187.66)" cx="119.65" cy="202.84" r="76.01"
|
||||
fill="#c8c8c8"/>
|
||||
<circle id="circle126" transform="translate(789.21 317.86)" cx="103.46" cy="72.633" r="44.339"
|
||||
fill="#fff"/>
|
||||
<circle id="circle128" transform="translate(773.02 1074.7)" cx="119.65" cy="202.84" r="76.01"
|
||||
fill="#c8c8c8"/>
|
||||
<circle id="circle130" transform="translate(789.21 1204.9)" cx="103.46" cy="72.633" r="44.339"
|
||||
fill="#fff"/>
|
||||
</g>
|
||||
<path id="path132" d="m1338.5 829.07h40.82" fill="none" stroke-width="5"/>
|
||||
<circle id="circle134" transform="translate(1441.3 600.31)" cx="-59.119" cy="229.58" r="4.223"
|
||||
fill="#3c3c3c" stroke-width="5"/>
|
||||
<g stroke-width="2">
|
||||
<path id="path136" d="m778.06 845.37-38.709-38.709" fill="none"/>
|
||||
<g id="g146" transform="translate(-13.78 15.524)" fill="#3c3c3c">
|
||||
<circle id="circle138" transform="translate(-79.458 449.8)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<circle id="circle140" transform="translate(-79.458 569.92)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<circle id="circle142" transform="translate(-79.458 690.03)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<circle id="circle144" transform="translate(-79.458 810.15)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
</g>
|
||||
<g id="g156" transform="translate(-13.78 17.524)" fill="#3c3c3c">
|
||||
<circle id="circle148" transform="translate(1381.6 448.25)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<circle id="circle150" transform="translate(1381.6 568.36)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<circle id="circle152" transform="translate(1381.6 688.48)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<circle id="circle154" transform="translate(1381.6 808.59)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g id="g156" transform="translate(-13.78 17.524)" fill="#3c3c3c">
|
||||
<circle id="circle148" transform="translate(1381.6 448.25)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<circle id="circle150" transform="translate(1381.6 568.36)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<circle id="circle152" transform="translate(1381.6 688.48)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<circle id="circle154" transform="translate(1381.6 808.59)" cx="-81.641" cy="188.76" r="4.223"/>
|
||||
<g id="layer2" fill="#d00000">
|
||||
<circle id="p02" cx="503.65" cy="248.75" r="61.935"/>
|
||||
<circle id="p03" cx="863.41" cy="248.75" r="61.935"/>
|
||||
<circle id="p04" cx="1181.5" cy="248.75" r="61.935"/>
|
||||
<circle id="p05" cx="1378.4" cy="151.16" r="61.935"/>
|
||||
<circle id="p06" cx="1535.1" cy="581.37" r="61.935"/>
|
||||
<circle id="p07" cx="1378.4" cy="997.9" r="61.935"/>
|
||||
<circle id="p08" cx="1181.5" cy="914.24" r="61.935"/>
|
||||
<circle id="p09" transform="scale(1,-1)" cx="863.41" cy="-914.24" r="61.935"/>
|
||||
<circle id="p10" cx="503.65" cy="914.24" r="61.935"/>
|
||||
<circle id="p11" cx="297.77" cy="997.9" r="61.935"/>
|
||||
<circle id="p12" cx="93.269" cy="581.37" r="61.935"/>
|
||||
<circle id="p25" cx="424.31" cy="581.37" r="61.935"/>
|
||||
<circle id="p27" cx="972.84" cy="581.37" r="61.935"/>
|
||||
<circle id="p01" cx="297.77" cy="151.16" r="61.935"/>
|
||||
<circle id="p26" cx="1339.4" cy="581.37" r="61.935"/>
|
||||
</g>
|
||||
<g id="g4994" fill="#ffef00">
|
||||
<circle id="s02" cx="503.65" cy="248.75" r="61.935"/>
|
||||
<circle id="s03" cx="863.41" cy="248.75" r="61.935"/>
|
||||
<circle id="s04" cx="1181.5" cy="248.75" r="61.935"/>
|
||||
<circle id="s05" cx="1378.4" cy="151.16" r="61.935"/>
|
||||
<circle id="s06" cx="1535.1" cy="581.37" r="61.935"/>
|
||||
<circle id="s07" cx="1378.4" cy="997.9" r="61.935"/>
|
||||
<circle id="s08" cx="1181.5" cy="914.24" r="61.935"/>
|
||||
<circle id="s09" transform="scale(1,-1)" cx="863.41" cy="-914.24" r="61.935"/>
|
||||
<circle id="s10" cx="503.65" cy="914.24" r="61.935"/>
|
||||
<circle id="s11" cx="297.77" cy="997.9" r="61.935"/>
|
||||
<circle id="s12" cx="93.269" cy="581.37" r="61.935"/>
|
||||
<circle id="s25" cx="424.31" cy="581.37" r="61.935"/>
|
||||
<circle id="s27" cx="972.84" cy="581.37" r="61.935"/>
|
||||
<circle id="s01" cx="297.77" cy="151.16" r="61.935"/>
|
||||
<circle id="s26" cx="1339.4" cy="581.37" r="61.935"/>
|
||||
</g>
|
||||
<g id="layer3">
|
||||
<text id="p15" opacity="0" x="382.62802" y="1034.3463" fill="#fd0000" font-family="sans-serif"
|
||||
font-size="1696.9px" letter-spacing="0px" stroke-width="17.676" word-spacing="0px"
|
||||
style="line-height:5.25" xml:space="preserve"><tspan id="tspan4997" x="382.62802" y="1034.3463" fill="#fd0000" stroke-width="17.676">x</tspan></text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g id="layer2" fill="#d00000">
|
||||
<circle id="p02" cx="503.65" cy="248.75" r="61.935" />
|
||||
<circle id="p03" cx="863.41" cy="248.75" r="61.935"/>
|
||||
<circle id="p04" cx="1181.5" cy="248.75" r="61.935"/>
|
||||
<circle id="p05" cx="1378.4" cy="151.16" r="61.935"/>
|
||||
<circle id="p06" cx="1535.1" cy="581.37" r="61.935"/>
|
||||
<circle id="p07" cx="1378.4" cy="997.9" r="61.935"/>
|
||||
<circle id="p08" cx="1181.5" cy="914.24" r="61.935"/>
|
||||
<circle id="p09" transform="scale(1,-1)" cx="863.41" cy="-914.24" r="61.935"/>
|
||||
<circle id="p10" cx="503.65" cy="914.24" r="61.935"/>
|
||||
<circle id="p11" cx="297.77" cy="997.9" r="61.935"/>
|
||||
<circle id="p12" cx="93.269" cy="581.37" r="61.935"/>
|
||||
<circle id="p25" cx="424.31" cy="581.37" r="61.935"/>
|
||||
<circle id="p27" cx="972.84" cy="581.37" r="61.935"/>
|
||||
<circle id="p01" cx="297.77" cy="151.16" r="61.935"/>
|
||||
<circle id="p26" cx="1339.4" cy="581.37" r="61.935"/>
|
||||
</g>
|
||||
<g id="g4994" fill="#ffef00">
|
||||
<circle id="s02" cx="503.65" cy="248.75" r="61.935"/>
|
||||
<circle id="s03" cx="863.41" cy="248.75" r="61.935"/>
|
||||
<circle id="s04" cx="1181.5" cy="248.75" r="61.935"/>
|
||||
<circle id="s05" cx="1378.4" cy="151.16" r="61.935"/>
|
||||
<circle id="s06" cx="1535.1" cy="581.37" r="61.935"/>
|
||||
<circle id="s07" cx="1378.4" cy="997.9" r="61.935"/>
|
||||
<circle id="s08" cx="1181.5" cy="914.24" r="61.935"/>
|
||||
<circle id="s09" transform="scale(1,-1)" cx="863.41" cy="-914.24" r="61.935"/>
|
||||
<circle id="s10" cx="503.65" cy="914.24" r="61.935"/>
|
||||
<circle id="s11" cx="297.77" cy="997.9" r="61.935"/>
|
||||
<circle id="s12" cx="93.269" cy="581.37" r="61.935"/>
|
||||
<circle id="s25" cx="424.31" cy="581.37" r="61.935"/>
|
||||
<circle id="s27" cx="972.84" cy="581.37" r="61.935"/>
|
||||
<circle id="s01" cx="297.77" cy="151.16" r="61.935"/>
|
||||
<circle id="s26" cx="1339.4" cy="581.37" r="61.935"/>
|
||||
</g>
|
||||
<g id="layer3">
|
||||
<text id="p15" opacity="0" x="382.62802" y="1034.3463" fill="#fd0000" font-family="sans-serif" font-size="1696.9px" letter-spacing="0px" stroke-width="17.676" word-spacing="0px" style="line-height:5.25" xml:space="preserve"><tspan id="tspan4997" x="382.62802" y="1034.3463" fill="#fd0000" stroke-width="17.676">x</tspan></text>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 17 KiB |
@@ -16,31 +16,31 @@ import {UPDATE_DASHBOARD_LAYOUT} from "../../graphql/user.queries";
|
||||
import {selectBodyshop, selectCurrentUser,} from "../../redux/user/user.selectors";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import DashboardMonthlyEmployeeEfficiency, {
|
||||
DashboardMonthlyEmployeeEfficiencyGql,
|
||||
DashboardMonthlyEmployeeEfficiencyGql,
|
||||
} from "../dashboard-components/monthly-employee-efficiency/monthly-employee-efficiency.component";
|
||||
import DashboardMonthlyJobCosting from "../dashboard-components/monthly-job-costing/monthly-job-costing.component";
|
||||
import DashboardMonthlyLaborSales from "../dashboard-components/monthly-labor-sales/monthly-labor-sales.component";
|
||||
import DashboardMonthlyPartsSales from "../dashboard-components/monthly-parts-sales/monthly-parts-sales.component";
|
||||
import DashboardMonthlyRevenueGraph, {
|
||||
DashboardMonthlyRevenueGraphGql,
|
||||
DashboardMonthlyRevenueGraphGql,
|
||||
} from "../dashboard-components/monthly-revenue-graph/monthly-revenue-graph.component";
|
||||
import DashboardProjectedMonthlySales, {
|
||||
DashboardProjectedMonthlySalesGql,
|
||||
DashboardProjectedMonthlySalesGql,
|
||||
} from "../dashboard-components/pojected-monthly-sales/projected-monthly-sales.component";
|
||||
import DashboardTotalProductionDollars
|
||||
from "../dashboard-components/total-production-dollars/total-production-dollars.component";
|
||||
from "../dashboard-components/total-production-dollars/total-production-dollars.component";
|
||||
import DashboardTotalProductionHours, {
|
||||
DashboardTotalProductionHoursGql,
|
||||
DashboardTotalProductionHoursGql,
|
||||
} from "../dashboard-components/total-production-hours/total-production-hours.component";
|
||||
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
||||
//Combination of the following:
|
||||
// /node_modules/react-grid-layout/css/styles.css
|
||||
// /node_modules/react-resizable/css/styles.css
|
||||
import DashboardScheduledInToday, {
|
||||
DashboardScheduledInTodayGql,
|
||||
DashboardScheduledInTodayGql,
|
||||
} from "../dashboard-components/scheduled-in-today/scheduled-in-today.component";
|
||||
import DashboardScheduledOutToday, {
|
||||
DashboardScheduledOutTodayGql,
|
||||
DashboardScheduledOutTodayGql,
|
||||
} from "../dashboard-components/scheduled-out-today/scheduled-out-today.component";
|
||||
import "./dashboard-grid.styles.scss";
|
||||
import {GenerateDashboardData} from "./dashboard-grid.utils";
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import {Button, Col, Collapse, Result, Row, Space} from "antd";
|
||||
import React from "react";
|
||||
import { withTranslation } from "react-i18next";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import {withTranslation} from "react-i18next";
|
||||
import {logImEXEvent} from "../../firebase/firebase.utils";
|
||||
import * as Sentry from "@sentry/react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import {
|
||||
selectBodyshop,
|
||||
selectCurrentUser,
|
||||
} from "../../redux/user/user.selectors";
|
||||
import {connect} from "react-redux";
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import {selectBodyshop, selectCurrentUser,} from "../../redux/user/user.selectors";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
currentUser: selectCurrentUser,
|
||||
@@ -139,5 +136,5 @@ class ErrorBoundary extends React.Component {
|
||||
}
|
||||
|
||||
export default Sentry.withErrorBoundary(
|
||||
connect(mapStateToProps, mapDispatchToProps)(withTranslation()(ErrorBoundary))
|
||||
connect(mapStateToProps, mapDispatchToProps)(withTranslation()(ErrorBoundary))
|
||||
);
|
||||
|
||||
@@ -169,7 +169,8 @@ const EulaFormComponent = ({form, handleChange, onFinish, t}) => (
|
||||
value.trim() !== '' ? Promise.resolve() : Promise.reject(new Error(t('eula.messages.business_name'))),
|
||||
}]}
|
||||
>
|
||||
<Input placeholder={t('eula.labels.business_name')} aria-label={t('eula.labels.business_name')}/>
|
||||
<Input placeholder={t('eula.labels.business_name')}
|
||||
aria-label={t('eula.labels.business_name')}/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
@@ -230,7 +231,8 @@ const EulaFormComponent = ({form, handleChange, onFinish, t}) => (
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Checkbox aria-label={t('eula.labels.accepted_terms')}>{t('eula.labels.accepted_terms')}</Checkbox>
|
||||
<Checkbox
|
||||
aria-label={t('eula.labels.accepted_terms')}>{t('eula.labels.accepted_terms')}</Checkbox>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
@@ -39,7 +39,7 @@ export default function JobBillsTotalComponent({
|
||||
);
|
||||
|
||||
if (pol.cm_received === null) {
|
||||
// Skip this calculation for bills posted prior to the CNR change.
|
||||
// Skip this calculation for bills posted prior to the CNR change.
|
||||
} else {
|
||||
if (pol.cm_received === false) {
|
||||
totalReturnsMarkedNotReceived = totalReturnsMarkedNotReceived.add(
|
||||
|
||||
@@ -179,7 +179,8 @@ export function JobLifecycleComponent({job, statuses, ...rest}) {
|
||||
style={{marginTop: '10px'}}>
|
||||
<div>
|
||||
{lifecycleData.durations.summations.map((key) => (
|
||||
<Tag key={key.status} color={key.color} style={{width: '13vh', padding: '4px', margin: '4px'}}>
|
||||
<Tag key={key.status} color={key.color}
|
||||
style={{width: '13vh', padding: '4px', margin: '4px'}}>
|
||||
<div
|
||||
aria-label={`${key.status} | ${key.roundedPercentage} | ${key.humanReadable}`}
|
||||
title={`${key.status} | ${key.roundedPercentage} | ${key.humanReadable}`}
|
||||
|
||||
@@ -1,54 +1,54 @@
|
||||
import { DownCircleFilled } from "@ant-design/icons";
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Button, Dropdown, notification } from "antd";
|
||||
import {DownCircleFilled} from "@ant-design/icons";
|
||||
import {useMutation} from "@apollo/client";
|
||||
import {Button, Dropdown, notification} from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { UPDATE_JOB_STATUS } from "../../graphql/jobs.queries";
|
||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {connect} from "react-redux";
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import {UPDATE_JOB_STATUS} from "../../graphql/jobs.queries";
|
||||
import {insertAuditTrail} from "../../redux/application/application.actions";
|
||||
import {selectBodyshop} from "../../redux/user/user.selectors";
|
||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
insertAuditTrail: ({ jobid, operation }) =>
|
||||
dispatch(insertAuditTrail({ jobid, operation })),
|
||||
insertAuditTrail: ({jobid, operation}) =>
|
||||
dispatch(insertAuditTrail({jobid, operation})),
|
||||
});
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(JobsAdminStatus);
|
||||
|
||||
export function JobsAdminStatus({ insertAuditTrail, bodyshop, job }) {
|
||||
const { t } = useTranslation();
|
||||
export function JobsAdminStatus({insertAuditTrail, bodyshop, job}) {
|
||||
const {t} = useTranslation();
|
||||
|
||||
const [mutationUpdateJobstatus] = useMutation(UPDATE_JOB_STATUS);
|
||||
const updateJobStatus = (status) => {
|
||||
mutationUpdateJobstatus({
|
||||
variables: { jobId: job.id, status: status },
|
||||
})
|
||||
.then((r) => {
|
||||
notification["success"]({ message: t("jobs.successes.save") });
|
||||
insertAuditTrail({
|
||||
jobid: job.id,
|
||||
operation: AuditTrailMapping.admin_jobstatuschange(status),
|
||||
});
|
||||
// refetch();
|
||||
})
|
||||
.catch((error) => {
|
||||
notification["error"]({ message: t("jobs.errors.saving") });
|
||||
});
|
||||
};
|
||||
const [mutationUpdateJobstatus] = useMutation(UPDATE_JOB_STATUS);
|
||||
const updateJobStatus = (status) => {
|
||||
mutationUpdateJobstatus({
|
||||
variables: {jobId: job.id, status: status},
|
||||
})
|
||||
.then((r) => {
|
||||
notification["success"]({message: t("jobs.successes.save")});
|
||||
insertAuditTrail({
|
||||
jobid: job.id,
|
||||
operation: AuditTrailMapping.admin_jobstatuschange(status),
|
||||
});
|
||||
// refetch();
|
||||
})
|
||||
.catch((error) => {
|
||||
notification["error"]({message: t("jobs.errors.saving")});
|
||||
});
|
||||
};
|
||||
|
||||
const statusMenu = {
|
||||
items: bodyshop.md_ro_statuses.statuses.map((item) => ({
|
||||
key: item,
|
||||
label: item,
|
||||
})),
|
||||
onClick: (e) => {
|
||||
updateJobStatus(e.key);
|
||||
},
|
||||
}
|
||||
const statusMenu = {
|
||||
items: bodyshop.md_ro_statuses.statuses.map((item) => ({
|
||||
key: item,
|
||||
label: item,
|
||||
})),
|
||||
onClick: (e) => {
|
||||
updateJobStatus(e.key);
|
||||
},
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -56,7 +56,7 @@ export function JobsAdminStatus({ insertAuditTrail, bodyshop, job }) {
|
||||
<Button shape="round">
|
||||
<span>{job.status}</span>
|
||||
|
||||
<DownCircleFilled />
|
||||
<DownCircleFilled/>
|
||||
</Button>
|
||||
</Dropdown>
|
||||
</>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Button, Space, notification } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {useMutation} from "@apollo/client";
|
||||
import {Button, Space, notification} from "antd";
|
||||
import React, {useState} from "react";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {
|
||||
DELETE_DELIVERY_CHECKLIST,
|
||||
DELETE_INTAKE_CHECKLIST,
|
||||
DELETE_DELIVERY_CHECKLIST,
|
||||
DELETE_INTAKE_CHECKLIST,
|
||||
} from "../../graphql/jobs.queries";
|
||||
|
||||
export default function JobAdminDeleteIntake({ job }) {
|
||||
const { t } = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
export default function JobAdminDeleteIntake({job}) {
|
||||
const {t} = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const [deleteIntake] = useMutation(DELETE_INTAKE_CHECKLIST);
|
||||
const [deleteDelivery] = useMutation(DELETE_DELIVERY_CHECKLIST);
|
||||
const [deleteIntake] = useMutation(DELETE_INTAKE_CHECKLIST);
|
||||
const [deleteDelivery] = useMutation(DELETE_DELIVERY_CHECKLIST);
|
||||
|
||||
const handleDelete = async (values) => {
|
||||
setLoading(true);
|
||||
@@ -32,11 +32,11 @@ export default function JobAdminDeleteIntake({ job }) {
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
const handleDeleteDelivery = async (values) => {
|
||||
setLoading(true);
|
||||
const result = await deleteDelivery({
|
||||
variables: { jobId: job.id },
|
||||
});
|
||||
const handleDeleteDelivery = async (values) => {
|
||||
setLoading(true);
|
||||
const result = await deleteDelivery({
|
||||
variables: {jobId: job.id},
|
||||
});
|
||||
|
||||
if (!!!result.errors) {
|
||||
notification["success"]({message: t("jobs.successes.save")});
|
||||
@@ -50,24 +50,24 @@ export default function JobAdminDeleteIntake({ job }) {
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Space wrap>
|
||||
<Button
|
||||
loading={loading}
|
||||
onClick={handleDelete}
|
||||
disabled={!job.intakechecklist}
|
||||
>
|
||||
{t("jobs.labels.deleteintake")}
|
||||
</Button>
|
||||
<Button
|
||||
loading={loading}
|
||||
onClick={handleDeleteDelivery}
|
||||
disabled={!job.deliverychecklist}
|
||||
>
|
||||
{t("jobs.labels.deletedelivery")}
|
||||
</Button>
|
||||
</Space>
|
||||
</>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<Space wrap>
|
||||
<Button
|
||||
loading={loading}
|
||||
onClick={handleDelete}
|
||||
disabled={!job.intakechecklist}
|
||||
>
|
||||
{t("jobs.labels.deleteintake")}
|
||||
</Button>
|
||||
<Button
|
||||
loading={loading}
|
||||
onClick={handleDeleteDelivery}
|
||||
disabled={!job.deliverychecklist}
|
||||
>
|
||||
{t("jobs.labels.deletedelivery")}
|
||||
</Button>
|
||||
</Space>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Button, Space, notification } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {useMutation} from "@apollo/client";
|
||||
import {Button, Space, notification} from "antd";
|
||||
import React, {useState} from "react";
|
||||
import {useTranslation} from "react-i18next";
|
||||
|
||||
import moment from "moment";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
||||
import {connect} from "react-redux";
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import {INSERT_EXPORT_LOG} from "../../graphql/accounting.queries";
|
||||
import {
|
||||
MARK_JOB_AS_EXPORTED,
|
||||
MARK_JOB_AS_UNINVOICED,
|
||||
MARK_JOB_FOR_REEXPORT,
|
||||
MARK_JOB_AS_EXPORTED,
|
||||
MARK_JOB_AS_UNINVOICED,
|
||||
MARK_JOB_FOR_REEXPORT,
|
||||
} from "../../graphql/jobs.queries";
|
||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||
import {insertAuditTrail} from "../../redux/application/application.actions";
|
||||
import {
|
||||
selectBodyshop,
|
||||
selectCurrentUser,
|
||||
selectBodyshop,
|
||||
selectCurrentUser,
|
||||
} from "../../redux/user/user.selectors";
|
||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||
|
||||
@@ -33,27 +33,27 @@ export default connect(
|
||||
)(JobAdminMarkReexport);
|
||||
|
||||
export function JobAdminMarkReexport({
|
||||
insertAuditTrail,
|
||||
bodyshop,
|
||||
currentUser,
|
||||
job,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
||||
insertAuditTrail,
|
||||
bodyshop,
|
||||
currentUser,
|
||||
job,
|
||||
}) {
|
||||
const {t} = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
||||
|
||||
const [markJobForReexport] = useMutation(MARK_JOB_FOR_REEXPORT);
|
||||
const [markJobExported] = useMutation(MARK_JOB_AS_EXPORTED);
|
||||
const [markJobUninvoiced] = useMutation(MARK_JOB_AS_UNINVOICED);
|
||||
const [markJobForReexport] = useMutation(MARK_JOB_FOR_REEXPORT);
|
||||
const [markJobExported] = useMutation(MARK_JOB_AS_EXPORTED);
|
||||
const [markJobUninvoiced] = useMutation(MARK_JOB_AS_UNINVOICED);
|
||||
|
||||
const handleMarkForExport = async () => {
|
||||
setLoading(true);
|
||||
const result = await markJobForReexport({
|
||||
variables: {
|
||||
jobId: job.id,
|
||||
default_invoiced: bodyshop.md_ro_statuses.default_invoiced,
|
||||
},
|
||||
});
|
||||
const handleMarkForExport = async () => {
|
||||
setLoading(true);
|
||||
const result = await markJobForReexport({
|
||||
variables: {
|
||||
jobId: job.id,
|
||||
default_invoiced: bodyshop.md_ro_statuses.default_invoiced,
|
||||
},
|
||||
});
|
||||
|
||||
if (!result.errors) {
|
||||
notification["success"]({message: t("jobs.successes.save")});
|
||||
@@ -71,15 +71,15 @@ export function JobAdminMarkReexport({
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
const handleMarkExported = async () => {
|
||||
setLoading(true);
|
||||
const result = await markJobExported({
|
||||
variables: {
|
||||
jobId: job.id,
|
||||
date_exported: dayjs(),
|
||||
default_exported: bodyshop.md_ro_statuses.default_exported,
|
||||
},
|
||||
});
|
||||
const handleMarkExported = async () => {
|
||||
setLoading(true);
|
||||
const result = await markJobExported({
|
||||
variables: {
|
||||
jobId: job.id,
|
||||
date_exported: dayjs(),
|
||||
default_exported: bodyshop.md_ro_statuses.default_exported,
|
||||
},
|
||||
});
|
||||
|
||||
await insertExportLog({
|
||||
variables: {
|
||||
@@ -111,14 +111,14 @@ export function JobAdminMarkReexport({
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
const handleUninvoice = async () => {
|
||||
setLoading(true);
|
||||
const result = await markJobUninvoiced({
|
||||
variables: {
|
||||
jobId: job.id,
|
||||
default_delivered: bodyshop.md_ro_statuses.default_delivered,
|
||||
},
|
||||
});
|
||||
const handleUninvoice = async () => {
|
||||
setLoading(true);
|
||||
const result = await markJobUninvoiced({
|
||||
variables: {
|
||||
jobId: job.id,
|
||||
default_delivered: bodyshop.md_ro_statuses.default_delivered,
|
||||
},
|
||||
});
|
||||
|
||||
if (!result.errors) {
|
||||
notification["success"]({message: t("jobs.successes.save")});
|
||||
@@ -136,31 +136,31 @@ export function JobAdminMarkReexport({
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Space wrap>
|
||||
<Button
|
||||
loading={loading}
|
||||
disabled={!job.date_exported}
|
||||
onClick={handleMarkForExport}
|
||||
>
|
||||
{t("jobs.labels.markforreexport")}
|
||||
</Button>
|
||||
<Button
|
||||
loading={loading}
|
||||
disabled={job.date_exported}
|
||||
onClick={handleMarkExported}
|
||||
>
|
||||
{t("jobs.actions.markasexported")}
|
||||
</Button>
|
||||
<Button
|
||||
loading={loading}
|
||||
disabled={!job.date_invoiced || job.date_exported}
|
||||
onClick={handleUninvoice}
|
||||
>
|
||||
{t("jobs.actions.uninvoice")}
|
||||
</Button>
|
||||
</Space>
|
||||
</>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<Space wrap>
|
||||
<Button
|
||||
loading={loading}
|
||||
disabled={!job.date_exported}
|
||||
onClick={handleMarkForExport}
|
||||
>
|
||||
{t("jobs.labels.markforreexport")}
|
||||
</Button>
|
||||
<Button
|
||||
loading={loading}
|
||||
disabled={job.date_exported}
|
||||
onClick={handleMarkExported}
|
||||
>
|
||||
{t("jobs.actions.markasexported")}
|
||||
</Button>
|
||||
<Button
|
||||
loading={loading}
|
||||
disabled={!job.date_invoiced || job.date_exported}
|
||||
onClick={handleUninvoice}
|
||||
>
|
||||
{t("jobs.actions.uninvoice")}
|
||||
</Button>
|
||||
</Space>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,65 +1,65 @@
|
||||
import { useMutation } from "@apollo/client";
|
||||
import { Switch, notification } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { UPDATE_REMOVE_FROM_AR } from "../../graphql/jobs.queries";
|
||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||
import {useMutation} from "@apollo/client";
|
||||
import {Switch, notification} from "antd";
|
||||
import React, {useState} from "react";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {connect} from "react-redux";
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import {UPDATE_REMOVE_FROM_AR} from "../../graphql/jobs.queries";
|
||||
import {insertAuditTrail} from "../../redux/application/application.actions";
|
||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
insertAuditTrail: ({ jobid, operation }) =>
|
||||
dispatch(insertAuditTrail({ jobid, operation })),
|
||||
insertAuditTrail: ({jobid, operation}) =>
|
||||
dispatch(insertAuditTrail({jobid, operation})),
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(JobsAdminRemoveAR);
|
||||
|
||||
export function JobsAdminRemoveAR({ insertAuditTrail, job }) {
|
||||
const { t } = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [switchValue, setSwitchValue] = useState(job.remove_from_ar);
|
||||
export function JobsAdminRemoveAR({insertAuditTrail, job}) {
|
||||
const {t} = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [switchValue, setSwitchValue] = useState(job.remove_from_ar);
|
||||
|
||||
const [mutationUpdateRemoveFromAR] = useMutation(UPDATE_REMOVE_FROM_AR);
|
||||
const [mutationUpdateRemoveFromAR] = useMutation(UPDATE_REMOVE_FROM_AR);
|
||||
|
||||
const handleChange = async (value) => {
|
||||
setLoading(true);
|
||||
const result = await mutationUpdateRemoveFromAR({
|
||||
variables: { jobId: job.id, remove_from_ar: value },
|
||||
});
|
||||
const handleChange = async (value) => {
|
||||
setLoading(true);
|
||||
const result = await mutationUpdateRemoveFromAR({
|
||||
variables: {jobId: job.id, remove_from_ar: value},
|
||||
});
|
||||
|
||||
if (!result.errors) {
|
||||
notification["success"]({ message: t("jobs.successes.save") });
|
||||
insertAuditTrail({
|
||||
jobid: job.id,
|
||||
operation: AuditTrailMapping.admin_job_remove_from_ar(value),
|
||||
});
|
||||
setSwitchValue(value);
|
||||
} else {
|
||||
notification["error"]({
|
||||
message: t("jobs.errors.saving", {
|
||||
error: JSON.stringify(result.errors),
|
||||
}),
|
||||
});
|
||||
}
|
||||
setLoading(false);
|
||||
};
|
||||
if (!result.errors) {
|
||||
notification["success"]({message: t("jobs.successes.save")});
|
||||
insertAuditTrail({
|
||||
jobid: job.id,
|
||||
operation: AuditTrailMapping.admin_job_remove_from_ar(value),
|
||||
});
|
||||
setSwitchValue(value);
|
||||
} else {
|
||||
notification["error"]({
|
||||
message: t("jobs.errors.saving", {
|
||||
error: JSON.stringify(result.errors),
|
||||
}),
|
||||
});
|
||||
}
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div style={{ display: "flex", alignItems: "center" }}>
|
||||
<div style={{ marginRight: "10px" }}>
|
||||
{t("jobs.labels.remove_from_ar")}:
|
||||
</div>
|
||||
<div>
|
||||
<Switch
|
||||
checked={switchValue}
|
||||
loading={loading}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<div style={{display: "flex", alignItems: "center"}}>
|
||||
<div style={{marginRight: "10px"}}>
|
||||
{t("jobs.labels.remove_from_ar")}:
|
||||
</div>
|
||||
<div>
|
||||
<Switch
|
||||
checked={switchValue}
|
||||
loading={loading}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,68 +1,68 @@
|
||||
import {gql, useMutation} from "@apollo/client";
|
||||
import {useMutation} from "@apollo/client";
|
||||
import {Button, notification} from "antd";
|
||||
import React, {useState} from "react";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {connect} from "react-redux";
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import { UNVOID_JOB } from "../../graphql/jobs.queries";
|
||||
import {UNVOID_JOB} from "../../graphql/jobs.queries";
|
||||
import {insertAuditTrail} from "../../redux/application/application.actions";
|
||||
import {selectBodyshop, selectCurrentUser,} from "../../redux/user/user.selectors";
|
||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
currentUser: selectCurrentUser,
|
||||
bodyshop: selectBodyshop,
|
||||
currentUser: selectCurrentUser,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
insertAuditTrail: ({ jobid, operation }) =>
|
||||
dispatch(insertAuditTrail({ jobid, operation })),
|
||||
insertAuditTrail: ({jobid, operation}) =>
|
||||
dispatch(insertAuditTrail({jobid, operation})),
|
||||
});
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(JobsAdminUnvoid);
|
||||
|
||||
export function JobsAdminUnvoid({
|
||||
insertAuditTrail,
|
||||
bodyshop,
|
||||
job,
|
||||
currentUser,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [mutationUnvoidJob] = useMutation(UNVOID_JOB);
|
||||
insertAuditTrail,
|
||||
bodyshop,
|
||||
job,
|
||||
currentUser,
|
||||
}) {
|
||||
const {t} = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [mutationUnvoidJob] = useMutation(UNVOID_JOB);
|
||||
|
||||
const handleUpdate = async (values) => {
|
||||
setLoading(true);
|
||||
const result = await mutationUnvoidJob({
|
||||
variables: {
|
||||
jobId: job.id,
|
||||
default_imported: bodyshop.md_ro_statuses.default_imported,
|
||||
currentUserEmail: currentUser.email,
|
||||
text: t("jobs.labels.unvoidnote"),
|
||||
},
|
||||
});
|
||||
const handleUpdate = async (values) => {
|
||||
setLoading(true);
|
||||
const result = await mutationUnvoidJob({
|
||||
variables: {
|
||||
jobId: job.id,
|
||||
default_imported: bodyshop.md_ro_statuses.default_imported,
|
||||
currentUserEmail: currentUser.email,
|
||||
text: t("jobs.labels.unvoidnote"),
|
||||
},
|
||||
});
|
||||
|
||||
if (!result.errors) {
|
||||
notification["success"]({ message: t("jobs.successes.save") });
|
||||
if (!result.errors) {
|
||||
notification["success"]({message: t("jobs.successes.save")});
|
||||
|
||||
insertAuditTrail({
|
||||
jobid: job.id,
|
||||
operation: AuditTrailMapping.admin_jobunvoid(),
|
||||
});
|
||||
} else {
|
||||
notification["error"]({
|
||||
message: t("jobs.errors.saving", {
|
||||
error: JSON.stringify(result.errors),
|
||||
}),
|
||||
});
|
||||
}
|
||||
setLoading(false);
|
||||
//Get the owner details, populate it all back into the job.
|
||||
};
|
||||
insertAuditTrail({
|
||||
jobid: job.id,
|
||||
operation: AuditTrailMapping.admin_jobunvoid(),
|
||||
});
|
||||
} else {
|
||||
notification["error"]({
|
||||
message: t("jobs.errors.saving", {
|
||||
error: JSON.stringify(result.errors),
|
||||
}),
|
||||
});
|
||||
}
|
||||
setLoading(false);
|
||||
//Get the owner details, populate it all back into the job.
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button loading={loading} disabled={!job.voided} onClick={handleUpdate}>
|
||||
{t("jobs.actions.unvoid")}
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<Button loading={loading} disabled={!job.voided} onClick={handleUpdate}>
|
||||
{t("jobs.actions.unvoid")}
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -220,12 +220,12 @@ export function PayableExportAll({
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
if (bodyshop.pbs_serialnumber)
|
||||
return (
|
||||
<Link to='/manage/dmsap' state={{ billids }}>
|
||||
<Button>{t("jobs.actions.export")}</Button>
|
||||
</Link>
|
||||
);
|
||||
if (bodyshop.pbs_serialnumber)
|
||||
return (
|
||||
<Link to='/manage/dmsap' state={{billids}}>
|
||||
<Button>{t("jobs.actions.export")}</Button>
|
||||
</Link>
|
||||
);
|
||||
|
||||
return (
|
||||
<Button onClick={handleQbxml} loading={loading} disabled={disabled}>
|
||||
|
||||
@@ -213,12 +213,12 @@ export function PayableExportButton({
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
if (bodyshop.pbs_serialnumber)
|
||||
return (
|
||||
<Link to='/manage/dmsap' state={{billids: [billId]}}>
|
||||
<Button>{t("jobs.actions.export")}</Button>
|
||||
</Link>
|
||||
);
|
||||
if (bodyshop.pbs_serialnumber)
|
||||
return (
|
||||
<Link to='/manage/dmsap' state={{billids: [billId]}}>
|
||||
<Button>{t("jobs.actions.export")}</Button>
|
||||
</Link>
|
||||
);
|
||||
|
||||
return (
|
||||
<Button onClick={handleQbxml} loading={loading} disabled={disabled}>
|
||||
|
||||
@@ -106,36 +106,36 @@ export function ProductionBoardKanbanComponent({
|
||||
|
||||
const oldChildCardNewParent = oldChildCard ? card.kanbanparent : null;
|
||||
|
||||
let movedCardNewKanbanParent;
|
||||
if (movedCardWillBeFirst) {
|
||||
//console.log("==> New Card is first.");
|
||||
movedCardNewKanbanParent = "-1";
|
||||
} else if (movedCardWillBeLast) {
|
||||
// console.log("==> New Card is last.");
|
||||
movedCardNewKanbanParent = lastCardInDestinationColumn.id;
|
||||
} else if (!!newChildCard) {
|
||||
// console.log("==> New Card is somewhere in the middle");
|
||||
movedCardNewKanbanParent = newChildCard.kanbanparent;
|
||||
} else {
|
||||
console.log("==> !!!!!!Couldn't find a parent.!!!! <==");
|
||||
}
|
||||
const newChildCardNewParent = newChildCard ? card.id : null;
|
||||
const update = await client.mutate({
|
||||
mutation: generate_UPDATE_JOB_KANBAN(
|
||||
oldChildCard ? oldChildCard.id : null,
|
||||
oldChildCardNewParent,
|
||||
card.id,
|
||||
movedCardNewKanbanParent,
|
||||
destination.toColumnId,
|
||||
newChildCard ? newChildCard.id : null,
|
||||
newChildCardNewParent
|
||||
),
|
||||
// TODO: optimisticResponse
|
||||
});
|
||||
insertAuditTrail({
|
||||
jobid: card.id,
|
||||
operation: AuditTrailMapping.jobstatuschange(destination.toColumnId),
|
||||
});
|
||||
let movedCardNewKanbanParent;
|
||||
if (movedCardWillBeFirst) {
|
||||
//console.log("==> New Card is first.");
|
||||
movedCardNewKanbanParent = "-1";
|
||||
} else if (movedCardWillBeLast) {
|
||||
// console.log("==> New Card is last.");
|
||||
movedCardNewKanbanParent = lastCardInDestinationColumn.id;
|
||||
} else if (!!newChildCard) {
|
||||
// console.log("==> New Card is somewhere in the middle");
|
||||
movedCardNewKanbanParent = newChildCard.kanbanparent;
|
||||
} else {
|
||||
console.log("==> !!!!!!Couldn't find a parent.!!!! <==");
|
||||
}
|
||||
const newChildCardNewParent = newChildCard ? card.id : null;
|
||||
const update = await client.mutate({
|
||||
mutation: generate_UPDATE_JOB_KANBAN(
|
||||
oldChildCard ? oldChildCard.id : null,
|
||||
oldChildCardNewParent,
|
||||
card.id,
|
||||
movedCardNewKanbanParent,
|
||||
destination.toColumnId,
|
||||
newChildCard ? newChildCard.id : null,
|
||||
newChildCardNewParent
|
||||
),
|
||||
// TODO: optimisticResponse
|
||||
});
|
||||
insertAuditTrail({
|
||||
jobid: card.id,
|
||||
operation: AuditTrailMapping.jobstatuschange(destination.toColumnId),
|
||||
});
|
||||
|
||||
if (update.errors) {
|
||||
notification["error"]({
|
||||
@@ -146,30 +146,30 @@ export function ProductionBoardKanbanComponent({
|
||||
}
|
||||
};
|
||||
|
||||
const totalHrs = data
|
||||
.reduce(
|
||||
(acc, val) =>
|
||||
acc +
|
||||
(val.labhrs?.aggregate?.sum?.mod_lb_hrs || 0) +
|
||||
(val.larhrs?.aggregate?.sum?.mod_lb_hrs || 0),
|
||||
0
|
||||
)
|
||||
.toFixed(1);
|
||||
const totalLAB = data
|
||||
.reduce(
|
||||
(acc, val) => acc + (val.labhrs?.aggregate?.sum?.mod_lb_hrs || 0),
|
||||
0
|
||||
)
|
||||
.toFixed(1);
|
||||
const totalLAR = data
|
||||
.reduce(
|
||||
(acc, val) => acc + (val.larhrs?.aggregate?.sum?.mod_lb_hrs || 0),
|
||||
0
|
||||
)
|
||||
.toFixed(1);
|
||||
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
||||
.filter((screen) => !!screen[1])
|
||||
.slice(-1)[0];
|
||||
const totalHrs = data
|
||||
.reduce(
|
||||
(acc, val) =>
|
||||
acc +
|
||||
(val.labhrs?.aggregate?.sum?.mod_lb_hrs || 0) +
|
||||
(val.larhrs?.aggregate?.sum?.mod_lb_hrs || 0),
|
||||
0
|
||||
)
|
||||
.toFixed(1);
|
||||
const totalLAB = data
|
||||
.reduce(
|
||||
(acc, val) => acc + (val.labhrs?.aggregate?.sum?.mod_lb_hrs || 0),
|
||||
0
|
||||
)
|
||||
.toFixed(1);
|
||||
const totalLAR = data
|
||||
.reduce(
|
||||
(acc, val) => acc + (val.larhrs?.aggregate?.sum?.mod_lb_hrs || 0),
|
||||
0
|
||||
)
|
||||
.toFixed(1);
|
||||
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
||||
.filter((screen) => !!screen[1])
|
||||
.slice(-1)[0];
|
||||
|
||||
const standardSizes = {
|
||||
xs: "250",
|
||||
|
||||
@@ -65,132 +65,132 @@ export function ProductionListDetail({
|
||||
nextFetchPolicy: "network-only",
|
||||
});
|
||||
|
||||
return (
|
||||
<Drawer
|
||||
title={
|
||||
<PageHeader
|
||||
title={theJob.ro_number}
|
||||
extra={
|
||||
<Space wrap>
|
||||
{!technician ? (
|
||||
<ProductionRemoveButton jobId={theJob.id} />
|
||||
) : null}
|
||||
<Button
|
||||
onClick={() => {
|
||||
setPrintCenterContext({
|
||||
actions: { refetch: refetch },
|
||||
context: {
|
||||
id: theJob.id,
|
||||
job: theJob,
|
||||
type: "job",
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
<PrinterFilled />
|
||||
{t("jobs.actions.printCenter")}
|
||||
</Button>
|
||||
{!technician ? (
|
||||
<ScoreboardAddButton job={data ? data.jobs_by_pk : {}} />
|
||||
) : null}
|
||||
</Space>
|
||||
}
|
||||
/>
|
||||
}
|
||||
placement="right"
|
||||
width={"50%"}
|
||||
onClose={handleClose}
|
||||
open={selected}
|
||||
>
|
||||
{loading && <LoadingSkeleton />}
|
||||
{error && <AlertComponent error={JSON.stringify(error)} />}
|
||||
{!loading && data && (
|
||||
<div>
|
||||
<CardTemplate
|
||||
title={t("jobs.labels.employeeassignments")}
|
||||
loading={loading}
|
||||
>
|
||||
<JobEmployeeAssignments job={data.jobs_by_pk} refetch={refetch} />
|
||||
</CardTemplate>
|
||||
<div style={{ height: "8px" }} />
|
||||
<Descriptions bordered column={1}>
|
||||
<Descriptions.Item label={t("jobs.fields.ro_number")}>
|
||||
{theJob.ro_number || ""}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.alt_transport")}>
|
||||
<Space>
|
||||
{data.jobs_by_pk.alt_transport || ""}
|
||||
<JobAtChange job={data.jobs_by_pk} />
|
||||
</Space>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.clm_no")}>
|
||||
{theJob.clm_no || ""}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.ins_co_nm")}>
|
||||
{theJob.ins_co_nm || ""}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.owner")}>
|
||||
<Space>
|
||||
<OwnerNameDisplay ownerObject={theJob} />
|
||||
{!technician ? (
|
||||
<>
|
||||
<StartChatButton
|
||||
phone={data.jobs_by_pk.ownr_ph1}
|
||||
jobid={data.jobs_by_pk.id}
|
||||
return (
|
||||
<Drawer
|
||||
title={
|
||||
<PageHeader
|
||||
title={theJob.ro_number}
|
||||
extra={
|
||||
<Space wrap>
|
||||
{!technician ? (
|
||||
<ProductionRemoveButton jobId={theJob.id}/>
|
||||
) : null}
|
||||
<Button
|
||||
onClick={() => {
|
||||
setPrintCenterContext({
|
||||
actions: {refetch: refetch},
|
||||
context: {
|
||||
id: theJob.id,
|
||||
job: theJob,
|
||||
type: "job",
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
<PrinterFilled/>
|
||||
{t("jobs.actions.printCenter")}
|
||||
</Button>
|
||||
{!technician ? (
|
||||
<ScoreboardAddButton job={data ? data.jobs_by_pk : {}}/>
|
||||
) : null}
|
||||
</Space>
|
||||
}
|
||||
/>
|
||||
}
|
||||
placement="right"
|
||||
width={"50%"}
|
||||
onClose={handleClose}
|
||||
open={selected}
|
||||
>
|
||||
{loading && <LoadingSkeleton/>}
|
||||
{error && <AlertComponent error={JSON.stringify(error)}/>}
|
||||
{!loading && data && (
|
||||
<div>
|
||||
<CardTemplate
|
||||
title={t("jobs.labels.employeeassignments")}
|
||||
loading={loading}
|
||||
>
|
||||
<JobEmployeeAssignments job={data.jobs_by_pk} refetch={refetch}/>
|
||||
</CardTemplate>
|
||||
<div style={{height: "8px"}}/>
|
||||
<Descriptions bordered column={1}>
|
||||
<Descriptions.Item label={t("jobs.fields.ro_number")}>
|
||||
{theJob.ro_number || ""}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.alt_transport")}>
|
||||
<Space>
|
||||
{data.jobs_by_pk.alt_transport || ""}
|
||||
<JobAtChange job={data.jobs_by_pk}/>
|
||||
</Space>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.clm_no")}>
|
||||
{theJob.clm_no || ""}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.ins_co_nm")}>
|
||||
{theJob.ins_co_nm || ""}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.owner")}>
|
||||
<Space>
|
||||
<OwnerNameDisplay ownerObject={theJob}/>
|
||||
{!technician ? (
|
||||
<>
|
||||
<StartChatButton
|
||||
phone={data.jobs_by_pk.ownr_ph1}
|
||||
jobid={data.jobs_by_pk.id}
|
||||
/>
|
||||
<StartChatButton
|
||||
phone={data.jobs_by_pk.ownr_ph2}
|
||||
jobid={data.jobs_by_pk.id}
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<PhoneNumberFormatter>
|
||||
{data.jobs_by_pk.ownr_ph1}
|
||||
</PhoneNumberFormatter>
|
||||
<PhoneNumberFormatter>
|
||||
{data.jobs_by_pk.ownr_ph2}
|
||||
</PhoneNumberFormatter>
|
||||
</>
|
||||
)}
|
||||
</Space>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.vehicle")}>
|
||||
{`${theJob.v_model_yr || ""} ${theJob.v_color || ""} ${
|
||||
theJob.v_make_desc || ""
|
||||
} ${theJob.v_model_desc || ""}`}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.clm_total")}>
|
||||
<CurrencyFormatter>{theJob.clm_total}</CurrencyFormatter>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.actual_in")}>
|
||||
<DateFormatter>{theJob.actual_in}</DateFormatter>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.scheduled_completion")}>
|
||||
<DateFormatter>{theJob.scheduled_completion}</DateFormatter>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<div style={{height: "8px"}}/>
|
||||
<JobDetailCardsPartsComponent
|
||||
loading={loading}
|
||||
data={data ? data.jobs_by_pk : null}
|
||||
/>
|
||||
<StartChatButton
|
||||
phone={data.jobs_by_pk.ownr_ph2}
|
||||
jobid={data.jobs_by_pk.id}
|
||||
<div style={{height: "8px"}}/>
|
||||
<JobDetailCardsNotesComponent
|
||||
loading={loading}
|
||||
data={data ? data.jobs_by_pk : null}
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<PhoneNumberFormatter>
|
||||
{data.jobs_by_pk.ownr_ph1}
|
||||
</PhoneNumberFormatter>
|
||||
<PhoneNumberFormatter>
|
||||
{data.jobs_by_pk.ownr_ph2}
|
||||
</PhoneNumberFormatter>
|
||||
</>
|
||||
)}
|
||||
</Space>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.vehicle")}>
|
||||
{`${theJob.v_model_yr || ""} ${theJob.v_color || ""} ${
|
||||
theJob.v_make_desc || ""
|
||||
} ${theJob.v_model_desc || ""}`}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.clm_total")}>
|
||||
<CurrencyFormatter>{theJob.clm_total}</CurrencyFormatter>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.actual_in")}>
|
||||
<DateFormatter>{theJob.actual_in}</DateFormatter>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("jobs.fields.scheduled_completion")}>
|
||||
<DateFormatter>{theJob.scheduled_completion}</DateFormatter>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<div style={{ height: "8px" }} />
|
||||
<JobDetailCardsPartsComponent
|
||||
loading={loading}
|
||||
data={data ? data.jobs_by_pk : null}
|
||||
/>
|
||||
<div style={{ height: "8px" }} />
|
||||
<JobDetailCardsNotesComponent
|
||||
loading={loading}
|
||||
data={data ? data.jobs_by_pk : null}
|
||||
/>
|
||||
{!bodyshop.uselocalmediaserver && (
|
||||
<>
|
||||
<div style={{ height: "8px" }} />
|
||||
<JobDetailCardsDocumentsComponent
|
||||
loading={loading}
|
||||
data={data ? data.jobs_by_pk : null}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</Drawer>
|
||||
);
|
||||
{!bodyshop.uselocalmediaserver && (
|
||||
<>
|
||||
<div style={{height: "8px"}}/>
|
||||
<JobDetailCardsDocumentsComponent
|
||||
loading={loading}
|
||||
data={data ? data.jobs_by_pk : null}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</Drawer>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ export function ReportCenterModalComponent({reportCenterModal, bodyshop}) {
|
||||
setLoading(true);
|
||||
const start = values.dates ? values.dates[0] : null;
|
||||
const end = values.dates ? values.dates[1] : null;
|
||||
const { id } = values;
|
||||
const {id} = values;
|
||||
|
||||
await GenerateDocument(
|
||||
{
|
||||
@@ -257,7 +257,7 @@ export function ReportCenterModalComponent({reportCenterModal, bodyshop}) {
|
||||
else return null;
|
||||
}}
|
||||
</Form.Item>
|
||||
<Form.Item style={{ margin: 0, padding: 0 }} dependencies={["key"]}>
|
||||
<Form.Item style={{margin: 0, padding: 0}} dependencies={["key"]}>
|
||||
{() => {
|
||||
const key = form.getFieldValue("key");
|
||||
const datedisable = Templates[key] && Templates[key].datedisable;
|
||||
@@ -316,18 +316,18 @@ export function ReportCenterModalComponent({reportCenterModal, bodyshop}) {
|
||||
}}
|
||||
</Form.Item>
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
marginTop: "1rem",
|
||||
}}
|
||||
>
|
||||
<Button onClick={() => form.submit()} style={{}} loading={loading}>
|
||||
{t("reportcenter.actions.generate")}
|
||||
</Button>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
marginTop: "1rem",
|
||||
}}
|
||||
>
|
||||
<Button onClick={() => form.submit()} style={{}} loading={loading}>
|
||||
{t("reportcenter.actions.generate")}
|
||||
</Button>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import EmailInput from "../form-items-formatted/email-form-item.component";
|
||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||
import ScheduleDayViewContainer from "../schedule-day-view/schedule-day-view.container";
|
||||
import ScheduleExistingAppointmentsList
|
||||
from "../schedule-existing-appointments-list/schedule-existing-appointments-list.component";
|
||||
from "../schedule-existing-appointments-list/schedule-existing-appointments-list.component";
|
||||
import "./schedule-job-modal.scss";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
|
||||
@@ -6,7 +6,7 @@ import querystring from "query-string";
|
||||
import React, {useEffect} from "react";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {connect} from "react-redux";
|
||||
import {useNavigate, useLocation} from "react-router-dom";
|
||||
import {useLocation, useNavigate} from "react-router-dom";
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import {logImEXEvent} from "../../firebase/firebase.utils";
|
||||
import {selectBodyshop} from "../../redux/user/user.selectors";
|
||||
|
||||
@@ -2,7 +2,7 @@ import {Button, Table} from "antd";
|
||||
import queryString from "query-string";
|
||||
import React from "react";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {useNavigate, useLocation} from "react-router-dom";
|
||||
import {useLocation, useNavigate} from "react-router-dom";
|
||||
|
||||
export default function ShopEmployeeTeamsListComponent({
|
||||
loading,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {EditFilled, SyncOutlined} from "@ant-design/icons";
|
||||
import {Card, Space, Table, Checkbox, Button} from "antd";
|
||||
import {Button, Card, Checkbox, Space, Table} from "antd";
|
||||
import dayjs from "../../utils/day";
|
||||
import React, {useMemo, useState} from "react";
|
||||
import {useTranslation} from "react-i18next";
|
||||
|
||||
@@ -5,7 +5,7 @@ import queryString from "query-string";
|
||||
import React, {useState} from "react";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {connect} from "react-redux";
|
||||
import {Link, useNavigate, useLocation} from "react-router-dom";
|
||||
import {Link, useLocation, useNavigate} from "react-router-dom";
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import {setModalContext} from "../../redux/modals/modals.actions";
|
||||
import {selectAuthLevel, selectBodyshop,} from "../../redux/user/user.selectors";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { getAnalytics, logEvent } from "firebase/analytics";
|
||||
import { initializeApp } from "firebase/app";
|
||||
import { getAuth, updatePassword, updateProfile } from "firebase/auth";
|
||||
import { getFirestore } from "firebase/firestore";
|
||||
import { getMessaging, getToken, onMessage } from "firebase/messaging";
|
||||
import { store } from "../redux/store";
|
||||
import {getAnalytics, logEvent} from "firebase/analytics";
|
||||
import {initializeApp} from "firebase/app";
|
||||
import {getAuth, updatePassword, updateProfile} from "firebase/auth";
|
||||
import {getFirestore} from "firebase/firestore";
|
||||
import {getMessaging, getToken, onMessage} from "firebase/messaging";
|
||||
import {store} from "../redux/store";
|
||||
|
||||
const config = JSON.parse(process.env.REACT_APP_FIREBASE_CONFIG);
|
||||
initializeApp(config);
|
||||
@@ -14,85 +14,85 @@ export const analytics = getAnalytics();
|
||||
|
||||
//export default firebase;
|
||||
export const getCurrentUser = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const unsubscribe = auth.onAuthStateChanged((userAuth) => {
|
||||
unsubscribe();
|
||||
resolve(userAuth);
|
||||
}, reject);
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
const unsubscribe = auth.onAuthStateChanged((userAuth) => {
|
||||
unsubscribe();
|
||||
resolve(userAuth);
|
||||
}, reject);
|
||||
});
|
||||
};
|
||||
|
||||
export const updateCurrentUser = (userDetails) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const unsubscribe = auth.onAuthStateChanged((userAuth) => {
|
||||
updateProfile(userAuth, userDetails).then((r) => {
|
||||
unsubscribe();
|
||||
resolve(userAuth);
|
||||
});
|
||||
}, reject);
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
const unsubscribe = auth.onAuthStateChanged((userAuth) => {
|
||||
updateProfile(userAuth, userDetails).then((r) => {
|
||||
unsubscribe();
|
||||
resolve(userAuth);
|
||||
});
|
||||
}, reject);
|
||||
});
|
||||
};
|
||||
|
||||
export const updateCurrentPassword = async (password) => {
|
||||
const currentUser = await getCurrentUser();
|
||||
const currentUser = await getCurrentUser();
|
||||
|
||||
return updatePassword(currentUser, password);
|
||||
return updatePassword(currentUser, password);
|
||||
};
|
||||
let messaging;
|
||||
try {
|
||||
messaging = getMessaging();
|
||||
messaging = getMessaging();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
export { messaging };
|
||||
export {messaging};
|
||||
|
||||
export const requestForToken = () => {
|
||||
return getToken(messaging, {
|
||||
vapidKey: process.env.REACT_APP_FIREBASE_PUBLIC_VAPID_KEY,
|
||||
})
|
||||
.then((currentToken) => {
|
||||
if (currentToken) {
|
||||
window.sessionStorage.setItem("fcmtoken", currentToken);
|
||||
// Perform any other necessary action with the token
|
||||
} else {
|
||||
// Show permission request UI
|
||||
console.log(
|
||||
"No registration token available. Request permission to generate one."
|
||||
);
|
||||
}
|
||||
return getToken(messaging, {
|
||||
vapidKey: process.env.REACT_APP_FIREBASE_PUBLIC_VAPID_KEY,
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("An error occurred while retrieving token. ", err);
|
||||
});
|
||||
.then((currentToken) => {
|
||||
if (currentToken) {
|
||||
window.sessionStorage.setItem("fcmtoken", currentToken);
|
||||
// Perform any other necessary action with the token
|
||||
} else {
|
||||
// Show permission request UI
|
||||
console.log(
|
||||
"No registration token available. Request permission to generate one."
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("An error occurred while retrieving token. ", err);
|
||||
});
|
||||
};
|
||||
|
||||
export const onMessageListener = () =>
|
||||
new Promise((resolve) => {
|
||||
onMessage(messaging, (payload) => {
|
||||
console.log("Inbound FCM Message", payload);
|
||||
resolve(payload);
|
||||
new Promise((resolve) => {
|
||||
onMessage(messaging, (payload) => {
|
||||
console.log("Inbound FCM Message", payload);
|
||||
resolve(payload);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
export const logImEXEvent = (eventName, additionalParams, stateProp = null) => {
|
||||
const state = stateProp || store.getState();
|
||||
const eventParams = {
|
||||
shop:
|
||||
(state.user && state.user.bodyshop && state.user.bodyshop.shopname) ||
|
||||
null,
|
||||
user:
|
||||
(state.user && state.user.currentUser && state.user.currentUser.email) ||
|
||||
null,
|
||||
...additionalParams,
|
||||
};
|
||||
// console.log(
|
||||
// "%c[Analytics]",
|
||||
// "background-color: green ;font-weight:bold;",
|
||||
// eventName,
|
||||
// eventParams
|
||||
// );
|
||||
logEvent(analytics, eventName, eventParams);
|
||||
const state = stateProp || store.getState();
|
||||
const eventParams = {
|
||||
shop:
|
||||
(state.user && state.user.bodyshop && state.user.bodyshop.shopname) ||
|
||||
null,
|
||||
user:
|
||||
(state.user && state.user.currentUser && state.user.currentUser.email) ||
|
||||
null,
|
||||
...additionalParams,
|
||||
};
|
||||
// console.log(
|
||||
// "%c[Analytics]",
|
||||
// "background-color: green ;font-weight:bold;",
|
||||
// eventName,
|
||||
// eventParams
|
||||
// );
|
||||
logEvent(analytics, eventName, eventParams);
|
||||
};
|
||||
|
||||
// if (messaging) {
|
||||
|
||||
@@ -1,174 +1,174 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const QUERY_JOBS_FOR_EXPORT = gql`
|
||||
query QUERY_JOBS_FOR_EXPORT($invoicedStatus: String!) {
|
||||
jobs(
|
||||
where: {
|
||||
date_exported: { _is_null: true }
|
||||
status: { _eq: $invoicedStatus }
|
||||
}
|
||||
) {
|
||||
id
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
date_invoiced
|
||||
date_exported
|
||||
status
|
||||
v_model_desc
|
||||
v_make_desc
|
||||
v_model_yr
|
||||
v_color
|
||||
query QUERY_JOBS_FOR_EXPORT($invoicedStatus: String!) {
|
||||
jobs(
|
||||
where: {
|
||||
date_exported: { _is_null: true }
|
||||
status: { _eq: $invoicedStatus }
|
||||
}
|
||||
) {
|
||||
id
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
date_invoiced
|
||||
date_exported
|
||||
status
|
||||
v_model_desc
|
||||
v_make_desc
|
||||
v_model_yr
|
||||
v_color
|
||||
|
||||
clm_total
|
||||
clm_no
|
||||
ins_co_nm
|
||||
exportlogs {
|
||||
id
|
||||
successful
|
||||
}
|
||||
clm_total
|
||||
clm_no
|
||||
ins_co_nm
|
||||
exportlogs {
|
||||
id
|
||||
successful
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_BILLS_FOR_EXPORT = gql`
|
||||
query QUERY_BILLS_FOR_EXPORT {
|
||||
bills(where: { exported: { _eq: false }, isinhouse: { _eq: false } }) {
|
||||
id
|
||||
exported
|
||||
date
|
||||
invoice_number
|
||||
is_credit_memo
|
||||
total
|
||||
exportlogs {
|
||||
id
|
||||
successful
|
||||
}
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
}
|
||||
vendor {
|
||||
name
|
||||
id
|
||||
}
|
||||
query QUERY_BILLS_FOR_EXPORT {
|
||||
bills(where: { exported: { _eq: false }, isinhouse: { _eq: false } }) {
|
||||
id
|
||||
exported
|
||||
date
|
||||
invoice_number
|
||||
is_credit_memo
|
||||
total
|
||||
exportlogs {
|
||||
id
|
||||
successful
|
||||
}
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
}
|
||||
vendor {
|
||||
name
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_PAYMENTS_FOR_EXPORT = gql`
|
||||
query QUERY_PAYMENTS_FOR_EXPORT {
|
||||
payments(
|
||||
where: { exportedat: { _is_null: true } }
|
||||
order_by: { created_at: desc }
|
||||
) {
|
||||
id
|
||||
amount
|
||||
job {
|
||||
ro_number
|
||||
query QUERY_PAYMENTS_FOR_EXPORT {
|
||||
payments(
|
||||
where: { exportedat: { _is_null: true } }
|
||||
order_by: { created_at: desc }
|
||||
) {
|
||||
id
|
||||
amount
|
||||
job {
|
||||
ro_number
|
||||
|
||||
id
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
}
|
||||
payer
|
||||
memo
|
||||
exportedat
|
||||
stripeid
|
||||
created_at
|
||||
transactionid
|
||||
paymentnum
|
||||
date
|
||||
exportlogs {
|
||||
id
|
||||
successful
|
||||
}
|
||||
id
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
}
|
||||
payer
|
||||
memo
|
||||
exportedat
|
||||
stripeid
|
||||
created_at
|
||||
transactionid
|
||||
paymentnum
|
||||
date
|
||||
exportlogs {
|
||||
id
|
||||
successful
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const INSERT_EXPORT_LOG = gql`
|
||||
mutation INSERT_EXPORT_LOG($logs: [exportlog_insert_input!]!) {
|
||||
insert_exportlog(objects: $logs) {
|
||||
affected_rows
|
||||
mutation INSERT_EXPORT_LOG($logs: [exportlog_insert_input!]!) {
|
||||
insert_exportlog(objects: $logs) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_PHONEBOOK_PAGINATED = gql`
|
||||
query QUERY_PHONEBOOK_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [phonebook_order_by!]
|
||||
) {
|
||||
search_phonebook(
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
args: { search: $search }
|
||||
query QUERY_PHONEBOOK_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [phonebook_order_by!]
|
||||
) {
|
||||
id
|
||||
created_at
|
||||
firstname
|
||||
lastname
|
||||
phone1
|
||||
phone2
|
||||
state
|
||||
zip
|
||||
fax
|
||||
email
|
||||
country
|
||||
company
|
||||
city
|
||||
category
|
||||
address2
|
||||
address1
|
||||
search_phonebook(
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
args: { search: $search }
|
||||
) {
|
||||
id
|
||||
created_at
|
||||
firstname
|
||||
lastname
|
||||
phone1
|
||||
phone2
|
||||
state
|
||||
zip
|
||||
fax
|
||||
email
|
||||
country
|
||||
company
|
||||
city
|
||||
category
|
||||
address2
|
||||
address1
|
||||
}
|
||||
search_phonebook_aggregate(args: { search: $search }) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
search_phonebook_aggregate(args: { search: $search }) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_EXPORT_LOG_PAGINATED = gql`
|
||||
query QUERY_ALL_EXPORTLOG_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [exportlog_order_by!]
|
||||
) {
|
||||
search_exportlog(
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
args: { search: $search }
|
||||
query QUERY_ALL_EXPORTLOG_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [exportlog_order_by!]
|
||||
) {
|
||||
id
|
||||
job {
|
||||
ro_number
|
||||
id
|
||||
}
|
||||
payment {
|
||||
id
|
||||
paymentnum
|
||||
}
|
||||
bill {
|
||||
invoice_number
|
||||
id
|
||||
}
|
||||
successful
|
||||
message
|
||||
created_at
|
||||
useremail
|
||||
search_exportlog(
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
args: { search: $search }
|
||||
) {
|
||||
id
|
||||
job {
|
||||
ro_number
|
||||
id
|
||||
}
|
||||
payment {
|
||||
id
|
||||
paymentnum
|
||||
}
|
||||
bill {
|
||||
invoice_number
|
||||
id
|
||||
}
|
||||
successful
|
||||
message
|
||||
created_at
|
||||
useremail
|
||||
}
|
||||
search_exportlog_aggregate(args: { search: $search }) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
search_exportlog_aggregate(args: { search: $search }) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const INSERT_ALLOCATION = gql`
|
||||
mutation INSERT_ALLOCATION($alloc: [allocations_insert_input!]!) {
|
||||
insert_allocations(objects: $alloc) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation INSERT_ALLOCATION($alloc: [allocations_insert_input!]!) {
|
||||
insert_allocations(objects: $alloc) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_ALLOCATION = gql`
|
||||
mutation DELETE_ALLOCATION($id: uuid!) {
|
||||
delete_allocations(where: { id: { _eq: $id } }) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation DELETE_ALLOCATION($id: uuid!) {
|
||||
delete_allocations(where: { id: { _eq: $id } }) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import { onError } from "@apollo/client/link/error";
|
||||
import {onError} from "@apollo/client/link/error";
|
||||
//https://stackoverflow.com/questions/57163454/refreshing-a-token-with-apollo-client-firebase-auth
|
||||
import * as Sentry from "@sentry/react";
|
||||
|
||||
const errorLink = onError(
|
||||
({ graphQLErrors, networkError, operation, forward }) => {
|
||||
if (graphQLErrors) {
|
||||
graphQLErrors.forEach(({ message, locations, path }) => {
|
||||
console.log(
|
||||
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`
|
||||
);
|
||||
Sentry.captureException({ message, locations, path });
|
||||
});
|
||||
({graphQLErrors, networkError, operation, forward}) => {
|
||||
if (graphQLErrors) {
|
||||
graphQLErrors.forEach(({message, locations, path}) => {
|
||||
console.log(
|
||||
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`
|
||||
);
|
||||
Sentry.captureException({message, locations, path});
|
||||
});
|
||||
}
|
||||
if (networkError)
|
||||
console.log(`[Network error]: ${JSON.stringify(networkError)}`);
|
||||
console.log(operation.getContext());
|
||||
return forward(operation);
|
||||
}
|
||||
if (networkError)
|
||||
console.log(`[Network error]: ${JSON.stringify(networkError)}`);
|
||||
console.log(operation.getContext());
|
||||
return forward(operation);
|
||||
}
|
||||
);
|
||||
|
||||
export default errorLink;
|
||||
|
||||
@@ -1,439 +1,439 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql`
|
||||
query QUERY_ALL_ACTIVE_APPOINTMENTS(
|
||||
$start: timestamptz!
|
||||
$end: timestamptz!
|
||||
$startd: date!
|
||||
$endd: date!
|
||||
) {
|
||||
employee_vacation(
|
||||
where: {
|
||||
_or: [
|
||||
{ start: { _gte: $startd } }
|
||||
{ end: { _lte: $endd } }
|
||||
{ _and: [{ start: { _lte: $startd } }, { end: { _gte: $endd } }] }
|
||||
]
|
||||
}
|
||||
query QUERY_ALL_ACTIVE_APPOINTMENTS(
|
||||
$start: timestamptz!
|
||||
$end: timestamptz!
|
||||
$startd: date!
|
||||
$endd: date!
|
||||
) {
|
||||
id
|
||||
start
|
||||
end
|
||||
employee {
|
||||
id
|
||||
last_name
|
||||
first_name
|
||||
}
|
||||
}
|
||||
appointments(
|
||||
where: {
|
||||
canceled: { _eq: false }
|
||||
end: { _lte: $end }
|
||||
start: { _gte: $start }
|
||||
}
|
||||
) {
|
||||
start
|
||||
id
|
||||
end
|
||||
arrived
|
||||
title
|
||||
isintake
|
||||
block
|
||||
color
|
||||
note
|
||||
job {
|
||||
alt_transport
|
||||
ro_number
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ph1
|
||||
ownr_ph2
|
||||
ownr_ea
|
||||
clm_total
|
||||
id
|
||||
clm_no
|
||||
ins_co_nm
|
||||
v_model_yr
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
est_ct_fn
|
||||
est_ct_ln
|
||||
labhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
employee_vacation(
|
||||
where: {
|
||||
_or: [
|
||||
{ start: { _gte: $startd } }
|
||||
{ end: { _lte: $endd } }
|
||||
{ _and: [{ start: { _lte: $startd } }, { end: { _gte: $endd } }] }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
larhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
id
|
||||
start
|
||||
end
|
||||
employee {
|
||||
id
|
||||
last_name
|
||||
first_name
|
||||
}
|
||||
}
|
||||
appointments(
|
||||
where: {
|
||||
canceled: { _eq: false }
|
||||
end: { _lte: $end }
|
||||
start: { _gte: $start }
|
||||
}
|
||||
) {
|
||||
start
|
||||
id
|
||||
end
|
||||
arrived
|
||||
title
|
||||
isintake
|
||||
block
|
||||
color
|
||||
note
|
||||
job {
|
||||
alt_transport
|
||||
ro_number
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ph1
|
||||
ownr_ph2
|
||||
ownr_ea
|
||||
clm_total
|
||||
id
|
||||
clm_no
|
||||
ins_co_nm
|
||||
v_model_yr
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
est_ct_fn
|
||||
est_ct_ln
|
||||
labhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
larhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_APPOINTMENT_BLOCK = gql`
|
||||
mutation INSERT_APPOINTMENT_BLOCK($app: [appointments_insert_input!]!) {
|
||||
insert_appointments(objects: $app) {
|
||||
returning {
|
||||
id
|
||||
start
|
||||
end
|
||||
arrived
|
||||
title
|
||||
isintake
|
||||
block
|
||||
note
|
||||
}
|
||||
mutation INSERT_APPOINTMENT_BLOCK($app: [appointments_insert_input!]!) {
|
||||
insert_appointments(objects: $app) {
|
||||
returning {
|
||||
id
|
||||
start
|
||||
end
|
||||
arrived
|
||||
title
|
||||
isintake
|
||||
block
|
||||
note
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_MANUAL_APPT = gql`
|
||||
mutation INSERT_MANUAL_APPT($apt: appointments_insert_input!) {
|
||||
insert_appointments_one(object: $apt) {
|
||||
start
|
||||
id
|
||||
end
|
||||
arrived
|
||||
title
|
||||
isintake
|
||||
block
|
||||
color
|
||||
note
|
||||
canceled
|
||||
job {
|
||||
id
|
||||
}
|
||||
mutation INSERT_MANUAL_APPT($apt: appointments_insert_input!) {
|
||||
insert_appointments_one(object: $apt) {
|
||||
start
|
||||
id
|
||||
end
|
||||
arrived
|
||||
title
|
||||
isintake
|
||||
block
|
||||
color
|
||||
note
|
||||
canceled
|
||||
job {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_APPOINTMENT = gql`
|
||||
mutation INSERT_APPOINTMENT(
|
||||
$app: [appointments_insert_input!]!
|
||||
$jobId: uuid
|
||||
$altTransport: String
|
||||
) {
|
||||
insert_appointments(objects: $app) {
|
||||
returning {
|
||||
id
|
||||
start
|
||||
end
|
||||
arrived
|
||||
title
|
||||
isintake
|
||||
block
|
||||
color
|
||||
note
|
||||
}
|
||||
}
|
||||
update_jobs(
|
||||
where: { id: { _eq: $jobId } }
|
||||
_set: { alt_transport: $altTransport }
|
||||
mutation INSERT_APPOINTMENT(
|
||||
$app: [appointments_insert_input!]!
|
||||
$jobId: uuid
|
||||
$altTransport: String
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
alt_transport
|
||||
}
|
||||
insert_appointments(objects: $app) {
|
||||
returning {
|
||||
id
|
||||
start
|
||||
end
|
||||
arrived
|
||||
title
|
||||
isintake
|
||||
block
|
||||
color
|
||||
note
|
||||
}
|
||||
}
|
||||
update_jobs(
|
||||
where: { id: { _eq: $jobId } }
|
||||
_set: { alt_transport: $altTransport }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
alt_transport
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_APPOINTMENT_BY_DATE = gql`
|
||||
query QUERY_APPOINTMENT_BY_DATE(
|
||||
$start: timestamptz
|
||||
$end: timestamptz
|
||||
$startd: date!
|
||||
$endd: date!
|
||||
) {
|
||||
employee_vacation(
|
||||
where: { _or: [{ start: { _gte: $startd } }, { end: { _lte: $endd } }] }
|
||||
query QUERY_APPOINTMENT_BY_DATE(
|
||||
$start: timestamptz
|
||||
$end: timestamptz
|
||||
$startd: date!
|
||||
$endd: date!
|
||||
) {
|
||||
id
|
||||
start
|
||||
end
|
||||
employee {
|
||||
id
|
||||
last_name
|
||||
first_name
|
||||
}
|
||||
}
|
||||
appointments(
|
||||
where: { start: { _lte: $end, _gte: $start }, canceled: { _eq: false } }
|
||||
) {
|
||||
start
|
||||
id
|
||||
end
|
||||
title
|
||||
isintake
|
||||
block
|
||||
color
|
||||
note
|
||||
job {
|
||||
alt_transport
|
||||
ro_number
|
||||
ownr_ln
|
||||
ownr_fn
|
||||
ownr_ph1
|
||||
ownr_ph2
|
||||
ownr_ea
|
||||
clm_total
|
||||
id
|
||||
clm_no
|
||||
vehicle {
|
||||
id
|
||||
v_model_yr
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
}
|
||||
labhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
|
||||
employee_vacation(
|
||||
where: { _or: [{ start: { _gte: $startd } }, { end: { _lte: $endd } }] }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
id
|
||||
start
|
||||
end
|
||||
employee {
|
||||
id
|
||||
last_name
|
||||
first_name
|
||||
}
|
||||
}
|
||||
}
|
||||
larhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
|
||||
appointments(
|
||||
where: { start: { _lte: $end, _gte: $start }, canceled: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
start
|
||||
id
|
||||
end
|
||||
title
|
||||
isintake
|
||||
block
|
||||
color
|
||||
note
|
||||
job {
|
||||
alt_transport
|
||||
ro_number
|
||||
ownr_ln
|
||||
ownr_fn
|
||||
ownr_ph1
|
||||
ownr_ph2
|
||||
ownr_ea
|
||||
clm_total
|
||||
id
|
||||
clm_no
|
||||
vehicle {
|
||||
id
|
||||
v_model_yr
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
}
|
||||
labhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
larhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_APPOINTMENT = gql`
|
||||
mutation UPDATE_APPOINTMENT($appid: uuid!, $app: appointments_set_input) {
|
||||
update_appointments(where: { id: { _eq: $appid } }, _set: $app) {
|
||||
returning {
|
||||
id
|
||||
start
|
||||
id
|
||||
end
|
||||
arrived
|
||||
title
|
||||
isintake
|
||||
block
|
||||
color
|
||||
note
|
||||
}
|
||||
mutation UPDATE_APPOINTMENT($appid: uuid!, $app: appointments_set_input) {
|
||||
update_appointments(where: { id: { _eq: $appid } }, _set: $app) {
|
||||
returning {
|
||||
id
|
||||
start
|
||||
id
|
||||
end
|
||||
arrived
|
||||
title
|
||||
isintake
|
||||
block
|
||||
color
|
||||
note
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const CANCEL_APPOINTMENT_BY_ID = gql`
|
||||
mutation CANCEL_APPOINTMENT_BY_ID($appid: uuid!) {
|
||||
update_appointments(
|
||||
where: { id: { _eq: $appid } }
|
||||
_set: { canceled: true }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
canceled
|
||||
}
|
||||
mutation CANCEL_APPOINTMENT_BY_ID($appid: uuid!) {
|
||||
update_appointments(
|
||||
where: { id: { _eq: $appid } }
|
||||
_set: { canceled: true }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
canceled
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const CANCEL_APPOINTMENTS_BY_JOB_ID = gql`
|
||||
mutation CANCEL_APPOINTMENTS_BY_JOB_ID($jobid: uuid!, $job: jobs_set_input) {
|
||||
update_appointments(
|
||||
where: { _and: { jobid: { _eq: $jobid }, arrived: { _eq: false } } }
|
||||
_set: { canceled: true }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
canceled
|
||||
}
|
||||
mutation CANCEL_APPOINTMENTS_BY_JOB_ID($jobid: uuid!, $job: jobs_set_input) {
|
||||
update_appointments(
|
||||
where: { _and: { jobid: { _eq: $jobid }, arrived: { _eq: false } } }
|
||||
_set: { canceled: true }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
canceled
|
||||
}
|
||||
}
|
||||
update_jobs_by_pk(pk_columns: { id: $jobid }, _set: $job) {
|
||||
date_scheduled
|
||||
id
|
||||
scheduled_in
|
||||
scheduled_completion
|
||||
status
|
||||
lost_sale_reason
|
||||
date_lost_sale
|
||||
}
|
||||
}
|
||||
update_jobs_by_pk(pk_columns: { id: $jobid }, _set: $job) {
|
||||
date_scheduled
|
||||
id
|
||||
scheduled_in
|
||||
scheduled_completion
|
||||
status
|
||||
lost_sale_reason
|
||||
date_lost_sale
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_APPOINTMENTS_BY_JOBID = gql`
|
||||
query QUERY_APPOINTMENTS_BY_JOBID($jobid: uuid!) {
|
||||
appointments(where: { jobid: { _eq: $jobid } }, order_by: { start: desc }) {
|
||||
start
|
||||
id
|
||||
end
|
||||
color
|
||||
isintake
|
||||
arrived
|
||||
canceled
|
||||
created_at
|
||||
block
|
||||
note
|
||||
query QUERY_APPOINTMENTS_BY_JOBID($jobid: uuid!) {
|
||||
appointments(where: { jobid: { _eq: $jobid } }, order_by: { start: desc }) {
|
||||
start
|
||||
id
|
||||
end
|
||||
color
|
||||
isintake
|
||||
arrived
|
||||
canceled
|
||||
created_at
|
||||
block
|
||||
note
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const QUERY_SCHEDULE_LOAD_DATA = gql`
|
||||
query QUERY_SCHEDULE_LOAD_DATA($start: timestamptz!, $end: timestamptz!) {
|
||||
prodJobs: jobs(
|
||||
where: { inproduction: { _eq: true }, suspended: { _eq: false } }
|
||||
) {
|
||||
id
|
||||
actual_in
|
||||
scheduled_in
|
||||
actual_completion
|
||||
scheduled_completion
|
||||
inproduction
|
||||
ro_number
|
||||
labhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
query QUERY_SCHEDULE_LOAD_DATA($start: timestamptz!, $end: timestamptz!) {
|
||||
prodJobs: jobs(
|
||||
where: { inproduction: { _eq: true }, suspended: { _eq: false } }
|
||||
) {
|
||||
id
|
||||
actual_in
|
||||
scheduled_in
|
||||
actual_completion
|
||||
scheduled_completion
|
||||
inproduction
|
||||
ro_number
|
||||
labhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
larhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
larhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
compJobs: jobs(
|
||||
where: {
|
||||
_and: [
|
||||
{ suspended: { _eq: false } }
|
||||
{
|
||||
_or: [
|
||||
{ scheduled_completion: { _gte: $start, _lte: $end } }
|
||||
{ actual_completion: { _gte: $start, _lte: $end } }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
) {
|
||||
id
|
||||
status
|
||||
ro_number
|
||||
scheduled_completion
|
||||
actual_completion
|
||||
scheduled_in
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
inproduction
|
||||
labhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
larhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
arrJobs: jobs(
|
||||
where: {
|
||||
scheduled_in: { _gte: $start, _lte: $end }
|
||||
suspended: { _eq: false }
|
||||
}
|
||||
) {
|
||||
id
|
||||
scheduled_in
|
||||
actual_in
|
||||
scheduled_completion
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
alt_transport
|
||||
actual_completion
|
||||
inproduction
|
||||
status
|
||||
labhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
larhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
compJobs: jobs(
|
||||
where: {
|
||||
_and: [
|
||||
{ suspended: { _eq: false } }
|
||||
{
|
||||
_or: [
|
||||
{ scheduled_completion: { _gte: $start, _lte: $end } }
|
||||
{ actual_completion: { _gte: $start, _lte: $end } }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
) {
|
||||
id
|
||||
status
|
||||
ro_number
|
||||
scheduled_completion
|
||||
actual_completion
|
||||
scheduled_in
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
inproduction
|
||||
labhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
larhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
arrJobs: jobs(
|
||||
where: {
|
||||
scheduled_in: { _gte: $start, _lte: $end }
|
||||
suspended: { _eq: false }
|
||||
}
|
||||
) {
|
||||
id
|
||||
scheduled_in
|
||||
actual_in
|
||||
scheduled_completion
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
alt_transport
|
||||
actual_completion
|
||||
inproduction
|
||||
status
|
||||
labhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
larhrs: joblines_aggregate(
|
||||
where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const MARK_APPOINTMENT_ARRIVED = gql`
|
||||
mutation MARK_APPOINTMENT_ARRIVED($appointmentId: uuid!) {
|
||||
update_appointments(
|
||||
where: { id: { _eq: $appointmentId } }
|
||||
_set: { arrived: true }
|
||||
) {
|
||||
affected_rows
|
||||
returning {
|
||||
id
|
||||
arrived
|
||||
}
|
||||
mutation MARK_APPOINTMENT_ARRIVED($appointmentId: uuid!) {
|
||||
update_appointments(
|
||||
where: { id: { _eq: $appointmentId } }
|
||||
_set: { arrived: true }
|
||||
) {
|
||||
affected_rows
|
||||
returning {
|
||||
id
|
||||
arrived
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const MARK_LATEST_APPOINTMENT_ARRIVED = gql`
|
||||
mutation MARK_LATEST_APPOINTMENT_ARRIVED($jobId: uuid!) {
|
||||
update_appointments(
|
||||
where: {
|
||||
jobid: { _eq: $jobId }
|
||||
canceled: { _eq: false }
|
||||
isintake: { _eq: true }
|
||||
}
|
||||
_set: { arrived: true }
|
||||
) {
|
||||
affected_rows
|
||||
returning {
|
||||
id
|
||||
arrived
|
||||
}
|
||||
mutation MARK_LATEST_APPOINTMENT_ARRIVED($jobId: uuid!) {
|
||||
update_appointments(
|
||||
where: {
|
||||
jobid: { _eq: $jobId }
|
||||
canceled: { _eq: false }
|
||||
isintake: { _eq: true }
|
||||
}
|
||||
_set: { arrived: true }
|
||||
) {
|
||||
affected_rows
|
||||
returning {
|
||||
id
|
||||
arrived
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,70 +1,70 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const QUERY_ALL_ASSOCIATIONS = gql`
|
||||
query QUERY_ALL_ASSOCIATIONS($email: String) {
|
||||
associations(
|
||||
where: { useremail: { _eq: $email } }
|
||||
order_by: { bodyshop: { shopname: asc } }
|
||||
) {
|
||||
id
|
||||
active
|
||||
bodyshop {
|
||||
shopname
|
||||
}
|
||||
query QUERY_ALL_ASSOCIATIONS($email: String) {
|
||||
associations(
|
||||
where: { useremail: { _eq: $email } }
|
||||
order_by: { bodyshop: { shopname: asc } }
|
||||
) {
|
||||
id
|
||||
active
|
||||
bodyshop {
|
||||
shopname
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_ASSOCIATION = gql`
|
||||
mutation UPDATE_ASSOCIATION($assocId: uuid, $assocActive: Boolean) {
|
||||
update_associations(
|
||||
where: { id: { _eq: $assocId } }
|
||||
_set: { active: $assocActive }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
active
|
||||
authlevel
|
||||
default_prod_list_view
|
||||
}
|
||||
mutation UPDATE_ASSOCIATION($assocId: uuid, $assocActive: Boolean) {
|
||||
update_associations(
|
||||
where: { id: { _eq: $assocId } }
|
||||
_set: { active: $assocActive }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
active
|
||||
authlevel
|
||||
default_prod_list_view
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const UPDATE_ACTIVE_ASSOCIATION = gql`
|
||||
mutation UPDATE_ACTIVE_ASSOCIATION($newActiveAssocId: uuid) {
|
||||
nweActive: update_associations(
|
||||
where: { id: { _eq: $newActiveAssocId } }
|
||||
_set: { active: true }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
shopid
|
||||
active
|
||||
}
|
||||
mutation UPDATE_ACTIVE_ASSOCIATION($newActiveAssocId: uuid) {
|
||||
nweActive: update_associations(
|
||||
where: { id: { _eq: $newActiveAssocId } }
|
||||
_set: { active: true }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
shopid
|
||||
active
|
||||
}
|
||||
}
|
||||
inactive: update_associations(
|
||||
where: { id: { _neq: $newActiveAssocId } }
|
||||
_set: { active: false }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
shopid
|
||||
active
|
||||
}
|
||||
}
|
||||
}
|
||||
inactive: update_associations(
|
||||
where: { id: { _neq: $newActiveAssocId } }
|
||||
_set: { active: false }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
shopid
|
||||
active
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_ACTIVE_PROD_LIST_VIEW = gql`
|
||||
mutation UPDATE_ACTIVE_PROD_LIST_VIEW($assocId: uuid, $view: String) {
|
||||
update_associations(
|
||||
where: { id: { _eq: $assocId } }
|
||||
_set: { default_prod_list_view: $view }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
default_prod_list_view
|
||||
}
|
||||
mutation UPDATE_ACTIVE_PROD_LIST_VIEW($assocId: uuid, $view: String) {
|
||||
update_associations(
|
||||
where: { id: { _eq: $assocId } }
|
||||
_set: { default_prod_list_view: $view }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
default_prod_list_view
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const QUERY_AUDIT_TRAIL = gql`
|
||||
query QUERY_AUDIT_TRAIL($jobid: uuid!) {
|
||||
audit_trail(
|
||||
where: { jobid: { _eq: $jobid } }
|
||||
order_by: { created: desc }
|
||||
) {
|
||||
useremail
|
||||
jobid
|
||||
operation
|
||||
id
|
||||
created
|
||||
bodyshopid
|
||||
query QUERY_AUDIT_TRAIL($jobid: uuid!) {
|
||||
audit_trail(
|
||||
where: { jobid: { _eq: $jobid } }
|
||||
order_by: { created: desc }
|
||||
) {
|
||||
useremail
|
||||
jobid
|
||||
operation
|
||||
id
|
||||
created
|
||||
bodyshopid
|
||||
}
|
||||
email_audit_trail(
|
||||
where: { jobid: { _eq: $jobid } }
|
||||
order_by: { created_at: desc }
|
||||
) {
|
||||
cc
|
||||
contents
|
||||
created_at
|
||||
id
|
||||
jobid
|
||||
noteid
|
||||
subject
|
||||
to
|
||||
useremail
|
||||
status
|
||||
}
|
||||
}
|
||||
email_audit_trail(
|
||||
where: { jobid: { _eq: $jobid } }
|
||||
order_by: { created_at: desc }
|
||||
) {
|
||||
cc
|
||||
contents
|
||||
created_at
|
||||
id
|
||||
jobid
|
||||
noteid
|
||||
subject
|
||||
to
|
||||
useremail
|
||||
status
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_AUDIT_TRAIL = gql`
|
||||
mutation INSERT_AUDIT_TRAIL($auditObj: audit_trail_insert_input!) {
|
||||
insert_audit_trail_one(object: $auditObj) {
|
||||
id
|
||||
jobid
|
||||
billid
|
||||
bodyshopid
|
||||
created
|
||||
operation
|
||||
useremail
|
||||
mutation INSERT_AUDIT_TRAIL($auditObj: audit_trail_insert_input!) {
|
||||
insert_audit_trail_one(object: $auditObj) {
|
||||
id
|
||||
jobid
|
||||
billid
|
||||
bodyshopid
|
||||
created
|
||||
operation
|
||||
useremail
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,118 +1,118 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const QUERY_AVAILABLE_JOBS = gql`
|
||||
query QUERY_AVAILABLE_JOBS {
|
||||
available_jobs(order_by: { updated_at: desc }) {
|
||||
cieca_id
|
||||
clm_amt
|
||||
clm_no
|
||||
created_at
|
||||
id
|
||||
issupplement
|
||||
ownr_name
|
||||
source_system
|
||||
supplement_number
|
||||
updated_at
|
||||
uploaded_by
|
||||
ins_co_nm
|
||||
vehicle_info
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
status
|
||||
}
|
||||
query QUERY_AVAILABLE_JOBS {
|
||||
available_jobs(order_by: { updated_at: desc }) {
|
||||
cieca_id
|
||||
clm_amt
|
||||
clm_no
|
||||
created_at
|
||||
id
|
||||
issupplement
|
||||
ownr_name
|
||||
source_system
|
||||
supplement_number
|
||||
updated_at
|
||||
uploaded_by
|
||||
ins_co_nm
|
||||
vehicle_info
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
status
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_AVAILABLE_NEW_JOBS = gql`
|
||||
query QUERY_AVAILABLE_NEW_JOBS {
|
||||
available_jobs(
|
||||
where: { issupplement: { _eq: false } }
|
||||
order_by: { updated_at: desc }
|
||||
) {
|
||||
cieca_id
|
||||
clm_amt
|
||||
clm_no
|
||||
created_at
|
||||
id
|
||||
issupplement
|
||||
ownr_name
|
||||
source_system
|
||||
supplement_number
|
||||
updated_at
|
||||
uploaded_by
|
||||
ins_co_nm
|
||||
vehicle_info
|
||||
query QUERY_AVAILABLE_NEW_JOBS {
|
||||
available_jobs(
|
||||
where: { issupplement: { _eq: false } }
|
||||
order_by: { updated_at: desc }
|
||||
) {
|
||||
cieca_id
|
||||
clm_amt
|
||||
clm_no
|
||||
created_at
|
||||
id
|
||||
issupplement
|
||||
ownr_name
|
||||
source_system
|
||||
supplement_number
|
||||
updated_at
|
||||
uploaded_by
|
||||
ins_co_nm
|
||||
vehicle_info
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_AVAILABLE_SUPPLEMENT_JOBS = gql`
|
||||
query QUERY_AVAILABLE_SUPPLEMENT_JOBS {
|
||||
available_jobs(
|
||||
where: { issupplement: { _eq: true } }
|
||||
order_by: { updated_at: desc }
|
||||
) {
|
||||
cieca_id
|
||||
clm_amt
|
||||
clm_no
|
||||
created_at
|
||||
id
|
||||
issupplement
|
||||
ownr_name
|
||||
source_system
|
||||
supplement_number
|
||||
updated_at
|
||||
uploaded_by
|
||||
ins_co_nm
|
||||
vehicle_info
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
}
|
||||
query QUERY_AVAILABLE_SUPPLEMENT_JOBS {
|
||||
available_jobs(
|
||||
where: { issupplement: { _eq: true } }
|
||||
order_by: { updated_at: desc }
|
||||
) {
|
||||
cieca_id
|
||||
clm_amt
|
||||
clm_no
|
||||
created_at
|
||||
id
|
||||
issupplement
|
||||
ownr_name
|
||||
source_system
|
||||
supplement_number
|
||||
updated_at
|
||||
uploaded_by
|
||||
ins_co_nm
|
||||
vehicle_info
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_AVAILABLE_JOB = gql`
|
||||
mutation DELETE_AVAILABLE_JOB($id: uuid) {
|
||||
delete_available_jobs(where: { id: { _eq: $id } }) {
|
||||
affected_rows
|
||||
mutation DELETE_AVAILABLE_JOB($id: uuid) {
|
||||
delete_available_jobs(where: { id: { _eq: $id } }) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_ALL_AVAILABLE_JOBS = gql`
|
||||
mutation DELETE_ALL_AVAILABLE_JOBS {
|
||||
delete_available_jobs(where: {}) {
|
||||
affected_rows
|
||||
mutation DELETE_ALL_AVAILABLE_JOBS {
|
||||
delete_available_jobs(where: {}) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_ALL_AVAILABLE_NEW_JOBS = gql`
|
||||
mutation DELETE_ALL_AVAILABLE_NEW_JOBS {
|
||||
delete_available_jobs(where: { issupplement: { _eq: false } }) {
|
||||
affected_rows
|
||||
mutation DELETE_ALL_AVAILABLE_NEW_JOBS {
|
||||
delete_available_jobs(where: { issupplement: { _eq: false } }) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_ALL_AVAILABLE_SUPPLEMENT_JOBS = gql`
|
||||
mutation DELETE_ALL_AVAILABLE_NEW_JOBS {
|
||||
delete_available_jobs(where: { issupplement: { _eq: true } }) {
|
||||
affected_rows
|
||||
mutation DELETE_ALL_AVAILABLE_NEW_JOBS {
|
||||
delete_available_jobs(where: { issupplement: { _eq: true } }) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK = gql`
|
||||
query QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK($id: uuid!) {
|
||||
available_jobs_by_pk(id: $id) {
|
||||
id
|
||||
issupplement
|
||||
est_data
|
||||
query QUERY_AVAILABLE_NEW_JOBS_EST_DATA_BY_PK($id: uuid!) {
|
||||
available_jobs_by_pk(id: $id) {
|
||||
id
|
||||
issupplement
|
||||
est_data
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const UPDATE_BILL_LINE = gql`
|
||||
mutation UPDATE_BILL_LINE(
|
||||
$billLineId: uuid!
|
||||
$billLine: billlines_set_input!
|
||||
) {
|
||||
update_billlines(where: { id: { _eq: $billLineId } }, _set: $billLine) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation UPDATE_BILL_LINE(
|
||||
$billLineId: uuid!
|
||||
$billLine: billlines_set_input!
|
||||
) {
|
||||
update_billlines(where: { id: { _eq: $billLineId } }, _set: $billLine) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const DELETE_BILL_LINE = gql`
|
||||
mutation DELETE_BILL_LINE($id: uuid!) {
|
||||
delete_billlines_by_pk(id: $id) {
|
||||
id
|
||||
mutation DELETE_BILL_LINE($id: uuid!) {
|
||||
delete_billlines_by_pk(id: $id) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_NEW_BILL_LINES = gql`
|
||||
mutation INSERT_NEW_BILL_LINES($billLines: [billlines_insert_input!]!) {
|
||||
insert_billlines(objects: $billLines) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation INSERT_NEW_BILL_LINES($billLines: [billlines_insert_input!]!) {
|
||||
insert_billlines(objects: $billLines) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,250 +1,250 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const INSERT_NEW_BILL = gql`
|
||||
mutation INSERT_NEW_BILL($bill: [bills_insert_input!]!) {
|
||||
insert_bills(objects: $bill) {
|
||||
returning {
|
||||
id
|
||||
invoice_number
|
||||
}
|
||||
mutation INSERT_NEW_BILL($bill: [bills_insert_input!]!) {
|
||||
insert_bills(objects: $bill) {
|
||||
returning {
|
||||
id
|
||||
invoice_number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_BILL = gql`
|
||||
mutation DELETE_BILL($billId: uuid!) {
|
||||
delete_bills_by_pk(id: $billId) {
|
||||
id
|
||||
mutation DELETE_BILL($billId: uuid!) {
|
||||
delete_bills_by_pk(id: $billId) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_ALL_BILLS_PAGINATED = gql`
|
||||
query QUERY_ALL_BILLS_PAGINATED(
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [bills_order_by!]!
|
||||
) {
|
||||
bills(offset: $offset, limit: $limit, order_by: $order) {
|
||||
id
|
||||
vendorid
|
||||
vendor {
|
||||
id
|
||||
name
|
||||
}
|
||||
federal_tax_rate
|
||||
local_tax_rate
|
||||
state_tax_rate
|
||||
is_credit_memo
|
||||
total
|
||||
invoice_number
|
||||
date
|
||||
isinhouse
|
||||
exported
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
}
|
||||
query QUERY_ALL_BILLS_PAGINATED(
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [bills_order_by!]!
|
||||
) {
|
||||
bills(offset: $offset, limit: $limit, order_by: $order) {
|
||||
id
|
||||
vendorid
|
||||
vendor {
|
||||
id
|
||||
name
|
||||
}
|
||||
federal_tax_rate
|
||||
local_tax_rate
|
||||
state_tax_rate
|
||||
is_credit_memo
|
||||
total
|
||||
invoice_number
|
||||
date
|
||||
isinhouse
|
||||
exported
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
}
|
||||
}
|
||||
bills_aggregate {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
bills_aggregate {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_BILLS_BY_JOBID = gql`
|
||||
query QUERY_PARTS_BILLS_BY_JOBID($jobid: uuid!) {
|
||||
parts_orders(
|
||||
where: { jobid: { _eq: $jobid } }
|
||||
order_by: { order_date: desc }
|
||||
) {
|
||||
id
|
||||
vendor {
|
||||
id
|
||||
name
|
||||
email
|
||||
}
|
||||
order_date
|
||||
deliver_by
|
||||
return
|
||||
orderedby
|
||||
parts_order_lines {
|
||||
id
|
||||
act_price
|
||||
db_price
|
||||
line_desc
|
||||
oem_partno
|
||||
status
|
||||
line_remarks
|
||||
quantity
|
||||
job_line_id
|
||||
part_type
|
||||
cost
|
||||
cm_received
|
||||
jobline {
|
||||
id
|
||||
part_type
|
||||
query QUERY_PARTS_BILLS_BY_JOBID($jobid: uuid!) {
|
||||
parts_orders(
|
||||
where: { jobid: { _eq: $jobid } }
|
||||
order_by: { order_date: desc }
|
||||
) {
|
||||
id
|
||||
vendor {
|
||||
id
|
||||
name
|
||||
email
|
||||
}
|
||||
order_date
|
||||
deliver_by
|
||||
return
|
||||
orderedby
|
||||
parts_order_lines {
|
||||
id
|
||||
act_price
|
||||
db_price
|
||||
line_desc
|
||||
oem_partno
|
||||
status
|
||||
line_remarks
|
||||
quantity
|
||||
job_line_id
|
||||
part_type
|
||||
cost
|
||||
cm_received
|
||||
jobline {
|
||||
id
|
||||
part_type
|
||||
}
|
||||
backordered_eta
|
||||
backordered_on
|
||||
}
|
||||
order_number
|
||||
comments
|
||||
user_email
|
||||
}
|
||||
backordered_eta
|
||||
backordered_on
|
||||
}
|
||||
order_number
|
||||
comments
|
||||
user_email
|
||||
}
|
||||
parts_dispatch(where: { jobid: { _eq: $jobid } }) {
|
||||
id
|
||||
dispatched_at
|
||||
dispatched_by
|
||||
employeeid
|
||||
number
|
||||
parts_dispatch_lines {
|
||||
joblineid
|
||||
id
|
||||
quantity
|
||||
accepted_at
|
||||
jobline {
|
||||
id
|
||||
line_desc
|
||||
parts_dispatch(where: { jobid: { _eq: $jobid } }) {
|
||||
id
|
||||
dispatched_at
|
||||
dispatched_by
|
||||
employeeid
|
||||
number
|
||||
parts_dispatch_lines {
|
||||
joblineid
|
||||
id
|
||||
quantity
|
||||
accepted_at
|
||||
jobline {
|
||||
id
|
||||
line_desc
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
bills(where: { jobid: { _eq: $jobid } }, order_by: { date: desc }) {
|
||||
id
|
||||
vendorid
|
||||
vendor {
|
||||
id
|
||||
name
|
||||
email
|
||||
}
|
||||
total
|
||||
invoice_number
|
||||
date
|
||||
federal_tax_rate
|
||||
state_tax_rate
|
||||
local_tax_rate
|
||||
is_credit_memo
|
||||
isinhouse
|
||||
exported
|
||||
billlines {
|
||||
actual_price
|
||||
quantity
|
||||
actual_cost
|
||||
cost_center
|
||||
id
|
||||
joblineid
|
||||
line_desc
|
||||
applicable_taxes
|
||||
deductedfromlbr
|
||||
lbr_adjustment
|
||||
jobline {
|
||||
oem_partno
|
||||
part_type
|
||||
bills(where: { jobid: { _eq: $jobid } }, order_by: { date: desc }) {
|
||||
id
|
||||
vendorid
|
||||
vendor {
|
||||
id
|
||||
name
|
||||
email
|
||||
}
|
||||
total
|
||||
invoice_number
|
||||
date
|
||||
federal_tax_rate
|
||||
state_tax_rate
|
||||
local_tax_rate
|
||||
is_credit_memo
|
||||
isinhouse
|
||||
exported
|
||||
billlines {
|
||||
actual_price
|
||||
quantity
|
||||
actual_cost
|
||||
cost_center
|
||||
id
|
||||
joblineid
|
||||
line_desc
|
||||
applicable_taxes
|
||||
deductedfromlbr
|
||||
lbr_adjustment
|
||||
jobline {
|
||||
oem_partno
|
||||
part_type
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_BILL_BY_PK = gql`
|
||||
query QUERY_BILL_BY_PK($billid: uuid!) {
|
||||
bills_by_pk(id: $billid) {
|
||||
due_date
|
||||
exported
|
||||
exported_at
|
||||
id
|
||||
invoice_number
|
||||
date
|
||||
is_credit_memo
|
||||
jobid
|
||||
total
|
||||
updated_at
|
||||
vendorid
|
||||
local_tax_rate
|
||||
state_tax_rate
|
||||
federal_tax_rate
|
||||
isinhouse
|
||||
inventories {
|
||||
id
|
||||
line_desc
|
||||
}
|
||||
vendor {
|
||||
id
|
||||
name
|
||||
discount
|
||||
}
|
||||
billlines {
|
||||
id
|
||||
line_desc
|
||||
actual_price
|
||||
actual_cost
|
||||
cost_center
|
||||
quantity
|
||||
joblineid
|
||||
inventories {
|
||||
id
|
||||
query QUERY_BILL_BY_PK($billid: uuid!) {
|
||||
bills_by_pk(id: $billid) {
|
||||
due_date
|
||||
exported
|
||||
exported_at
|
||||
id
|
||||
invoice_number
|
||||
date
|
||||
is_credit_memo
|
||||
jobid
|
||||
total
|
||||
updated_at
|
||||
vendorid
|
||||
local_tax_rate
|
||||
state_tax_rate
|
||||
federal_tax_rate
|
||||
isinhouse
|
||||
inventories {
|
||||
id
|
||||
line_desc
|
||||
}
|
||||
vendor {
|
||||
id
|
||||
name
|
||||
discount
|
||||
}
|
||||
billlines {
|
||||
id
|
||||
line_desc
|
||||
actual_price
|
||||
actual_cost
|
||||
cost_center
|
||||
quantity
|
||||
joblineid
|
||||
inventories {
|
||||
id
|
||||
}
|
||||
jobline {
|
||||
oem_partno
|
||||
part_type
|
||||
}
|
||||
applicable_taxes
|
||||
deductedfromlbr
|
||||
lbr_adjustment
|
||||
}
|
||||
documents {
|
||||
id
|
||||
key
|
||||
name
|
||||
type
|
||||
size
|
||||
}
|
||||
}
|
||||
jobline {
|
||||
oem_partno
|
||||
part_type
|
||||
}
|
||||
applicable_taxes
|
||||
deductedfromlbr
|
||||
lbr_adjustment
|
||||
}
|
||||
documents {
|
||||
id
|
||||
key
|
||||
name
|
||||
type
|
||||
size
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_BILL = gql`
|
||||
mutation UPDATE_BILL($billId: uuid!, $bill: bills_set_input!) {
|
||||
update_bills(where: { id: { _eq: $billId } }, _set: $bill) {
|
||||
returning {
|
||||
id
|
||||
exported
|
||||
exported_at
|
||||
}
|
||||
mutation UPDATE_BILL($billId: uuid!, $bill: bills_set_input!) {
|
||||
update_bills(where: { id: { _eq: $billId } }, _set: $bill) {
|
||||
returning {
|
||||
id
|
||||
exported
|
||||
exported_at
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_BILLS = gql`
|
||||
mutation UPDATE_BILLS($billIdList: [uuid!]!, $bill: bills_set_input!) {
|
||||
update_bills(where: { id: { _in: $billIdList } }, _set: $bill) {
|
||||
returning {
|
||||
id
|
||||
exported
|
||||
exported_at
|
||||
}
|
||||
mutation UPDATE_BILLS($billIdList: [uuid!]!, $bill: bills_set_input!) {
|
||||
update_bills(where: { id: { _in: $billIdList } }, _set: $bill) {
|
||||
returning {
|
||||
id
|
||||
exported
|
||||
exported_at
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const CHECK_BILL_INVOICE_NUMBER = gql`
|
||||
query CHECK_BILL_INVOICE_NUMBER($invoice_number: String!, $vendorid: uuid!) {
|
||||
bills_aggregate(
|
||||
where: {
|
||||
_and: {
|
||||
invoice_number: { _ilike: $invoice_number }
|
||||
vendorid: { _eq: $vendorid }
|
||||
query CHECK_BILL_INVOICE_NUMBER($invoice_number: String!, $vendorid: uuid!) {
|
||||
bills_aggregate(
|
||||
where: {
|
||||
_and: {
|
||||
invoice_number: { _ilike: $invoice_number }
|
||||
vendorid: { _eq: $vendorid }
|
||||
}
|
||||
}
|
||||
) {
|
||||
aggregate {
|
||||
count
|
||||
}
|
||||
nodes {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
) {
|
||||
aggregate {
|
||||
count
|
||||
}
|
||||
nodes {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,358 +1,359 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const INTROSPECTION = gql`
|
||||
query INTROSPECTION {
|
||||
__schema {
|
||||
types {
|
||||
name
|
||||
}
|
||||
query INTROSPECTION {
|
||||
__schema {
|
||||
types {
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_EULA = gql`
|
||||
query QUERY_EULA($now: timestamptz!) {
|
||||
eulas(where: {effective_date: {_lte: $now}, _or: [{end_date: {_is_null: true}}, {end_date: {_gt: $now}}]}) {
|
||||
id
|
||||
content
|
||||
query QUERY_EULA($now: timestamptz!) {
|
||||
eulas(where: {effective_date: {_lte: $now}, _or: [{end_date: {_is_null: true}}, {end_date: {_gt: $now}}]}) {
|
||||
id
|
||||
content
|
||||
|
||||
eula_acceptances {
|
||||
id
|
||||
date_accepted
|
||||
}
|
||||
eula_acceptances {
|
||||
id
|
||||
date_accepted
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_BODYSHOP = gql`
|
||||
query QUERY_BODYSHOP {
|
||||
bodyshops(where: { associations: { active: { _eq: true } } }) {
|
||||
associations {
|
||||
id
|
||||
authlevel
|
||||
useremail
|
||||
default_prod_list_view
|
||||
user {
|
||||
authid
|
||||
email
|
||||
dashboardlayout
|
||||
validemail
|
||||
employee {
|
||||
query QUERY_BODYSHOP {
|
||||
bodyshops(where: { associations: { active: { _eq: true } } }) {
|
||||
associations {
|
||||
id
|
||||
authlevel
|
||||
useremail
|
||||
default_prod_list_view
|
||||
user {
|
||||
authid
|
||||
email
|
||||
dashboardlayout
|
||||
validemail
|
||||
employee {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
address1
|
||||
address2
|
||||
city
|
||||
country
|
||||
created_at
|
||||
email
|
||||
phone
|
||||
federal_tax_id
|
||||
id
|
||||
}
|
||||
insurance_vendor_id
|
||||
logo_img_path
|
||||
md_ro_statuses
|
||||
md_order_statuses
|
||||
md_functionality_toggles
|
||||
shopname
|
||||
state
|
||||
state_tax_id
|
||||
updated_at
|
||||
zip_post
|
||||
shoprates
|
||||
region_config
|
||||
md_responsibility_centers
|
||||
messagingservicesid
|
||||
template_header
|
||||
textid
|
||||
production_config
|
||||
bill_tax_rates
|
||||
inhousevendorid
|
||||
accountingconfig
|
||||
appt_length
|
||||
stripe_acct_id
|
||||
ssbuckets
|
||||
scoreboard_target
|
||||
md_referral_sources
|
||||
md_messaging_presets
|
||||
intakechecklist
|
||||
speedprint
|
||||
md_parts_locations
|
||||
md_notes_presets
|
||||
md_rbac
|
||||
prodtargethrs
|
||||
md_classes
|
||||
md_ins_cos
|
||||
md_categories
|
||||
enforce_class
|
||||
md_labor_rates
|
||||
deliverchecklist
|
||||
target_touchtime
|
||||
appt_colors
|
||||
appt_alt_transport
|
||||
schedule_start_time
|
||||
schedule_end_time
|
||||
imexshopid
|
||||
default_adjustment_rate
|
||||
workingdays
|
||||
use_fippa
|
||||
md_payment_types
|
||||
md_hour_split
|
||||
sub_status
|
||||
jobsizelimit
|
||||
md_ccc_rates
|
||||
enforce_referral
|
||||
website
|
||||
jc_hourly_rates
|
||||
md_jobline_presets
|
||||
cdk_dealerid
|
||||
features
|
||||
attach_pdf_to_email
|
||||
tt_allow_post_to_invoiced
|
||||
cdk_configuration
|
||||
md_estimators
|
||||
md_ded_notes
|
||||
pbs_configuration
|
||||
pbs_serialnumber
|
||||
md_filehandlers
|
||||
md_email_cc
|
||||
timezone
|
||||
ss_configuration
|
||||
md_from_emails
|
||||
last_name_first
|
||||
md_parts_order_comment
|
||||
bill_allow_post_to_closed
|
||||
md_to_emails
|
||||
uselocalmediaserver
|
||||
localmediaserverhttp
|
||||
localmediaservernetwork
|
||||
localmediatoken
|
||||
enforce_conversion_csr
|
||||
md_lost_sale_reasons
|
||||
md_parts_scan
|
||||
enforce_conversion_category
|
||||
tt_enforce_hours_for_tech_console
|
||||
md_tasks_presets
|
||||
use_paint_scale_data
|
||||
employee_teams(
|
||||
order_by: { name: asc }
|
||||
where: { active: { _eq: true } }
|
||||
) {
|
||||
id
|
||||
name
|
||||
employee_team_members {
|
||||
id
|
||||
employeeid
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
}
|
||||
employees {
|
||||
user_email
|
||||
id
|
||||
active
|
||||
first_name
|
||||
last_name
|
||||
employee_number
|
||||
rates
|
||||
external_id
|
||||
flat_rate
|
||||
}
|
||||
}
|
||||
}
|
||||
address1
|
||||
address2
|
||||
city
|
||||
country
|
||||
created_at
|
||||
email
|
||||
phone
|
||||
federal_tax_id
|
||||
id
|
||||
insurance_vendor_id
|
||||
logo_img_path
|
||||
md_ro_statuses
|
||||
md_order_statuses
|
||||
md_functionality_toggles
|
||||
shopname
|
||||
state
|
||||
state_tax_id
|
||||
updated_at
|
||||
zip_post
|
||||
shoprates
|
||||
region_config
|
||||
md_responsibility_centers
|
||||
messagingservicesid
|
||||
template_header
|
||||
textid
|
||||
production_config
|
||||
bill_tax_rates
|
||||
inhousevendorid
|
||||
accountingconfig
|
||||
appt_length
|
||||
stripe_acct_id
|
||||
ssbuckets
|
||||
scoreboard_target
|
||||
md_referral_sources
|
||||
md_messaging_presets
|
||||
intakechecklist
|
||||
speedprint
|
||||
md_parts_locations
|
||||
md_notes_presets
|
||||
md_rbac
|
||||
prodtargethrs
|
||||
md_classes
|
||||
md_ins_cos
|
||||
md_categories
|
||||
enforce_class
|
||||
md_labor_rates
|
||||
deliverchecklist
|
||||
target_touchtime
|
||||
appt_colors
|
||||
appt_alt_transport
|
||||
schedule_start_time
|
||||
schedule_end_time
|
||||
imexshopid
|
||||
default_adjustment_rate
|
||||
workingdays
|
||||
use_fippa
|
||||
md_payment_types
|
||||
md_hour_split
|
||||
sub_status
|
||||
jobsizelimit
|
||||
md_ccc_rates
|
||||
enforce_referral
|
||||
website
|
||||
jc_hourly_rates
|
||||
md_jobline_presets
|
||||
cdk_dealerid
|
||||
features
|
||||
attach_pdf_to_email
|
||||
tt_allow_post_to_invoiced
|
||||
cdk_configuration
|
||||
md_estimators
|
||||
md_ded_notes
|
||||
pbs_configuration
|
||||
pbs_serialnumber
|
||||
md_filehandlers
|
||||
md_email_cc
|
||||
timezone
|
||||
ss_configuration
|
||||
md_from_emails
|
||||
last_name_first
|
||||
md_parts_order_comment
|
||||
bill_allow_post_to_closed
|
||||
md_to_emails
|
||||
uselocalmediaserver
|
||||
localmediaserverhttp
|
||||
localmediaservernetwork
|
||||
localmediatoken
|
||||
enforce_conversion_csr
|
||||
md_lost_sale_reasons
|
||||
md_parts_scan
|
||||
enforce_conversion_category
|
||||
tt_enforce_hours_for_tech_console
|
||||
md_tasks_presets
|
||||
use_paint_scale_data
|
||||
employee_teams(
|
||||
order_by: { name: asc }
|
||||
where: { active: { _eq: true } }
|
||||
) {
|
||||
id
|
||||
name
|
||||
employee_team_members {
|
||||
id
|
||||
employeeid
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
}
|
||||
employees {
|
||||
user_email
|
||||
id
|
||||
active
|
||||
first_name
|
||||
last_name
|
||||
employee_number
|
||||
rates
|
||||
external_id
|
||||
flat_rate
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_SHOP_ID = gql`
|
||||
query QUERY_SHOP_ID {
|
||||
bodyshops(where: { associations: { active: { _eq: true } } }) {
|
||||
id
|
||||
query QUERY_SHOP_ID {
|
||||
bodyshops(where: { associations: { active: { _eq: true } } }) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_SHOP = gql`
|
||||
mutation UPDATE_SHOP($id: uuid, $shop: bodyshops_set_input!) {
|
||||
update_bodyshops(where: { id: { _eq: $id } }, _set: $shop) {
|
||||
returning {
|
||||
address1
|
||||
address2
|
||||
city
|
||||
country
|
||||
created_at
|
||||
email
|
||||
phone
|
||||
federal_tax_id
|
||||
id
|
||||
insurance_vendor_id
|
||||
logo_img_path
|
||||
md_ro_statuses
|
||||
md_order_statuses
|
||||
md_functionality_toggles
|
||||
shopname
|
||||
state
|
||||
state_tax_id
|
||||
updated_at
|
||||
zip_post
|
||||
shoprates
|
||||
region_config
|
||||
md_responsibility_centers
|
||||
messagingservicesid
|
||||
template_header
|
||||
textid
|
||||
production_config
|
||||
bill_tax_rates
|
||||
appt_length
|
||||
stripe_acct_id
|
||||
ssbuckets
|
||||
scoreboard_target
|
||||
md_referral_sources
|
||||
md_messaging_presets
|
||||
intakechecklist
|
||||
speedprint
|
||||
md_parts_locations
|
||||
md_notes_presets
|
||||
md_rbac
|
||||
prodtargethrs
|
||||
md_classes
|
||||
md_ins_cos
|
||||
md_categories
|
||||
enforce_class
|
||||
md_labor_rates
|
||||
deliverchecklist
|
||||
target_touchtime
|
||||
appt_colors
|
||||
appt_alt_transport
|
||||
schedule_start_time
|
||||
schedule_end_time
|
||||
imexshopid
|
||||
default_adjustment_rate
|
||||
workingdays
|
||||
use_fippa
|
||||
md_payment_types
|
||||
md_hour_split
|
||||
sub_status
|
||||
jobsizelimit
|
||||
md_ccc_rates
|
||||
enforce_referral
|
||||
website
|
||||
jc_hourly_rates
|
||||
md_jobline_presets
|
||||
cdk_dealerid
|
||||
attach_pdf_to_email
|
||||
tt_allow_post_to_invoiced
|
||||
cdk_configuration
|
||||
md_estimators
|
||||
md_ded_notes
|
||||
pbs_configuration
|
||||
pbs_serialnumber
|
||||
md_filehandlers
|
||||
md_email_cc
|
||||
timezone
|
||||
ss_configuration
|
||||
md_from_emails
|
||||
last_name_first
|
||||
md_parts_order_comment
|
||||
bill_allow_post_to_closed
|
||||
md_to_emails
|
||||
uselocalmediaserver
|
||||
localmediaserverhttp
|
||||
localmediaservernetwork
|
||||
localmediatoken
|
||||
enforce_conversion_csr
|
||||
md_lost_sale_reasons
|
||||
md_parts_scan
|
||||
enforce_conversion_category
|
||||
tt_enforce_hours_for_tech_console
|
||||
md_tasks_presets
|
||||
employee_teams(
|
||||
order_by: { name: asc }
|
||||
where: { active: { _eq: true } }
|
||||
) {
|
||||
id
|
||||
name
|
||||
employee_team_members {
|
||||
id
|
||||
employeeid
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
mutation UPDATE_SHOP($id: uuid, $shop: bodyshops_set_input!) {
|
||||
update_bodyshops(where: { id: { _eq: $id } }, _set: $shop) {
|
||||
returning {
|
||||
address1
|
||||
address2
|
||||
city
|
||||
country
|
||||
created_at
|
||||
email
|
||||
phone
|
||||
federal_tax_id
|
||||
id
|
||||
insurance_vendor_id
|
||||
logo_img_path
|
||||
md_ro_statuses
|
||||
md_order_statuses
|
||||
md_functionality_toggles
|
||||
shopname
|
||||
state
|
||||
state_tax_id
|
||||
updated_at
|
||||
zip_post
|
||||
shoprates
|
||||
region_config
|
||||
md_responsibility_centers
|
||||
messagingservicesid
|
||||
template_header
|
||||
textid
|
||||
production_config
|
||||
bill_tax_rates
|
||||
appt_length
|
||||
stripe_acct_id
|
||||
ssbuckets
|
||||
scoreboard_target
|
||||
md_referral_sources
|
||||
md_messaging_presets
|
||||
intakechecklist
|
||||
speedprint
|
||||
md_parts_locations
|
||||
md_notes_presets
|
||||
md_rbac
|
||||
prodtargethrs
|
||||
md_classes
|
||||
md_ins_cos
|
||||
md_categories
|
||||
enforce_class
|
||||
md_labor_rates
|
||||
deliverchecklist
|
||||
target_touchtime
|
||||
appt_colors
|
||||
appt_alt_transport
|
||||
schedule_start_time
|
||||
schedule_end_time
|
||||
imexshopid
|
||||
default_adjustment_rate
|
||||
workingdays
|
||||
use_fippa
|
||||
md_payment_types
|
||||
md_hour_split
|
||||
sub_status
|
||||
jobsizelimit
|
||||
md_ccc_rates
|
||||
enforce_referral
|
||||
website
|
||||
jc_hourly_rates
|
||||
md_jobline_presets
|
||||
cdk_dealerid
|
||||
attach_pdf_to_email
|
||||
tt_allow_post_to_invoiced
|
||||
cdk_configuration
|
||||
md_estimators
|
||||
md_ded_notes
|
||||
pbs_configuration
|
||||
pbs_serialnumber
|
||||
md_filehandlers
|
||||
md_email_cc
|
||||
timezone
|
||||
ss_configuration
|
||||
md_from_emails
|
||||
last_name_first
|
||||
md_parts_order_comment
|
||||
bill_allow_post_to_closed
|
||||
md_to_emails
|
||||
uselocalmediaserver
|
||||
localmediaserverhttp
|
||||
localmediaservernetwork
|
||||
localmediatoken
|
||||
enforce_conversion_csr
|
||||
md_lost_sale_reasons
|
||||
md_parts_scan
|
||||
enforce_conversion_category
|
||||
tt_enforce_hours_for_tech_console
|
||||
md_tasks_presets
|
||||
employee_teams(
|
||||
order_by: { name: asc }
|
||||
where: { active: { _eq: true } }
|
||||
) {
|
||||
id
|
||||
name
|
||||
employee_team_members {
|
||||
id
|
||||
employeeid
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
}
|
||||
employees {
|
||||
id
|
||||
first_name
|
||||
active
|
||||
last_name
|
||||
employee_number
|
||||
rates
|
||||
user_email
|
||||
external_id
|
||||
}
|
||||
}
|
||||
}
|
||||
employees {
|
||||
id
|
||||
first_name
|
||||
active
|
||||
last_name
|
||||
employee_number
|
||||
rates
|
||||
user_email
|
||||
external_id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const QUERY_INTAKE_CHECKLIST = gql`
|
||||
query QUERY_INTAKE_CHECKLIST($shopId: uuid!, $jobId: uuid!) {
|
||||
bodyshops_by_pk(id: $shopId) {
|
||||
id
|
||||
intakechecklist
|
||||
query QUERY_INTAKE_CHECKLIST($shopId: uuid!, $jobId: uuid!) {
|
||||
bodyshops_by_pk(id: $shopId) {
|
||||
id
|
||||
intakechecklist
|
||||
}
|
||||
jobs_by_pk(id: $jobId) {
|
||||
id
|
||||
ro_number
|
||||
production_vars
|
||||
scheduled_completion
|
||||
scheduled_delivery
|
||||
intakechecklist
|
||||
status
|
||||
owner {
|
||||
allow_text_message
|
||||
id
|
||||
}
|
||||
labhrs: joblines_aggregate(
|
||||
where: {
|
||||
_and: [{ mod_lbr_ty: { _neq: "LAR" } }, { removed: { _eq: false } }]
|
||||
}
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
larhrs: joblines_aggregate(
|
||||
where: {
|
||||
_and: [{ mod_lbr_ty: { _eq: "LAR" } }, { removed: { _eq: false } }]
|
||||
}
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
jobs_by_pk(id: $jobId) {
|
||||
id
|
||||
ro_number
|
||||
production_vars
|
||||
scheduled_completion
|
||||
scheduled_delivery
|
||||
intakechecklist
|
||||
status
|
||||
owner {
|
||||
allow_text_message
|
||||
id
|
||||
}
|
||||
labhrs: joblines_aggregate(
|
||||
where: {
|
||||
_and: [{ mod_lbr_ty: { _neq: "LAR" } }, { removed: { _eq: false } }]
|
||||
}
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
larhrs: joblines_aggregate(
|
||||
where: {
|
||||
_and: [{ mod_lbr_ty: { _eq: "LAR" } }, { removed: { _eq: false } }]
|
||||
}
|
||||
) {
|
||||
aggregate {
|
||||
sum {
|
||||
mod_lb_hrs
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const QUERY_DELIVER_CHECKLIST = gql`
|
||||
query QUERY_DELIVER_CHECKLIST($shopId: uuid!, $jobId: uuid!) {
|
||||
bodyshops_by_pk(id: $shopId) {
|
||||
id
|
||||
deliverchecklist
|
||||
query QUERY_DELIVER_CHECKLIST($shopId: uuid!, $jobId: uuid!) {
|
||||
bodyshops_by_pk(id: $shopId) {
|
||||
id
|
||||
deliverchecklist
|
||||
}
|
||||
jobs_by_pk(id: $jobId) {
|
||||
id
|
||||
ro_number
|
||||
actual_completion
|
||||
actual_delivery
|
||||
}
|
||||
}
|
||||
jobs_by_pk(id: $jobId) {
|
||||
id
|
||||
ro_number
|
||||
actual_completion
|
||||
actual_delivery
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const QUERY_STRIPE_ID = gql`
|
||||
query QUERY_STRIPE_ID {
|
||||
bodyshops(where: { associations: { active: { _eq: true } } }) {
|
||||
stripe_acct_id
|
||||
query QUERY_STRIPE_ID {
|
||||
bodyshops(where: { associations: { active: { _eq: true } } }) {
|
||||
stripe_acct_id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,233 +1,233 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const INSERT_NEW_CONTRACT = gql`
|
||||
mutation INSERT_NEW_CONTRACT(
|
||||
$contract: [cccontracts_insert_input!]!
|
||||
$ccId: uuid!
|
||||
$damage: String
|
||||
$mileage: numeric
|
||||
) {
|
||||
insert_cccontracts(objects: $contract) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
update_courtesycars_by_pk(
|
||||
pk_columns: { id: $ccId }
|
||||
_set: {
|
||||
status: "courtesycars.status.out"
|
||||
mileage: $mileage
|
||||
damage: $damage
|
||||
}
|
||||
mutation INSERT_NEW_CONTRACT(
|
||||
$contract: [cccontracts_insert_input!]!
|
||||
$ccId: uuid!
|
||||
$damage: String
|
||||
$mileage: numeric
|
||||
) {
|
||||
status
|
||||
id
|
||||
damage
|
||||
mileage
|
||||
insert_cccontracts(objects: $contract) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
update_courtesycars_by_pk(
|
||||
pk_columns: { id: $ccId }
|
||||
_set: {
|
||||
status: "courtesycars.status.out"
|
||||
mileage: $mileage
|
||||
damage: $damage
|
||||
}
|
||||
) {
|
||||
status
|
||||
id
|
||||
damage
|
||||
mileage
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_CONTRACT = gql`
|
||||
mutation UPDATE_CONTRACT(
|
||||
$contractId: uuid!
|
||||
$cccontract: cccontracts_set_input!
|
||||
) {
|
||||
update_cccontracts(where: { id: { _eq: $contractId } }, _set: $cccontract) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation UPDATE_CONTRACT(
|
||||
$contractId: uuid!
|
||||
$cccontract: cccontracts_set_input!
|
||||
) {
|
||||
update_cccontracts(where: { id: { _eq: $contractId } }, _set: $cccontract) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const RETURN_CONTRACT = gql`
|
||||
mutation RETURN_CONTRACT(
|
||||
$contractId: uuid!
|
||||
$cccontract: cccontracts_set_input!
|
||||
$courtesycarid: uuid!
|
||||
$courtesycar: courtesycars_set_input!
|
||||
) {
|
||||
update_cccontracts(where: { id: { _eq: $contractId } }, _set: $cccontract) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
update_courtesycars(
|
||||
where: { id: { _eq: $courtesycarid } }
|
||||
_set: $courtesycar
|
||||
mutation RETURN_CONTRACT(
|
||||
$contractId: uuid!
|
||||
$cccontract: cccontracts_set_input!
|
||||
$courtesycarid: uuid!
|
||||
$courtesycar: courtesycars_set_input!
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
update_cccontracts(where: { id: { _eq: $contractId } }, _set: $cccontract) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
update_courtesycars(
|
||||
where: { id: { _eq: $courtesycarid } }
|
||||
_set: $courtesycar
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_CONTRACT_BY_PK = gql`
|
||||
query QUERY_CONTRACT_BY_PK($id: uuid!) {
|
||||
cccontracts_by_pk(id: $id) {
|
||||
actualreturn
|
||||
agreementnumber
|
||||
courtesycarid
|
||||
driver_addr1
|
||||
driver_city
|
||||
driver_addr2
|
||||
driver_dlexpiry
|
||||
driver_dlnumber
|
||||
driver_dlst
|
||||
driver_dob
|
||||
driver_fn
|
||||
driver_ln
|
||||
driver_ph1
|
||||
driver_state
|
||||
driver_zip
|
||||
id
|
||||
jobid
|
||||
dailyrate
|
||||
actax
|
||||
dailyfreekm
|
||||
refuelcharge
|
||||
excesskmrate
|
||||
cleanupcharge
|
||||
damagewaiver
|
||||
federaltax
|
||||
statetax
|
||||
localtax
|
||||
coverage
|
||||
fuelin
|
||||
fuelout
|
||||
damage
|
||||
job {
|
||||
id
|
||||
query QUERY_CONTRACT_BY_PK($id: uuid!) {
|
||||
cccontracts_by_pk(id: $id) {
|
||||
actualreturn
|
||||
agreementnumber
|
||||
courtesycarid
|
||||
driver_addr1
|
||||
driver_city
|
||||
driver_addr2
|
||||
driver_dlexpiry
|
||||
driver_dlnumber
|
||||
driver_dlst
|
||||
driver_dob
|
||||
driver_fn
|
||||
driver_ln
|
||||
driver_ph1
|
||||
driver_state
|
||||
driver_zip
|
||||
id
|
||||
jobid
|
||||
dailyrate
|
||||
actax
|
||||
dailyfreekm
|
||||
refuelcharge
|
||||
excesskmrate
|
||||
cleanupcharge
|
||||
damagewaiver
|
||||
federaltax
|
||||
statetax
|
||||
localtax
|
||||
coverage
|
||||
fuelin
|
||||
fuelout
|
||||
damage
|
||||
job {
|
||||
id
|
||||
|
||||
ro_number
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
clm_no
|
||||
scheduled_completion
|
||||
ownerid
|
||||
vehicleid
|
||||
owner {
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
id
|
||||
ownr_co_nm
|
||||
ro_number
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
clm_no
|
||||
scheduled_completion
|
||||
ownerid
|
||||
vehicleid
|
||||
owner {
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
id
|
||||
ownr_co_nm
|
||||
}
|
||||
vehicle {
|
||||
id
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
v_model_yr
|
||||
v_vin
|
||||
}
|
||||
}
|
||||
kmend
|
||||
kmstart
|
||||
scheduledreturn
|
||||
start
|
||||
status
|
||||
updated_at
|
||||
courtesycar {
|
||||
id
|
||||
fleetnumber
|
||||
make
|
||||
model
|
||||
year
|
||||
plate
|
||||
}
|
||||
}
|
||||
vehicle {
|
||||
id
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
v_model_yr
|
||||
v_vin
|
||||
}
|
||||
}
|
||||
kmend
|
||||
kmstart
|
||||
scheduledreturn
|
||||
start
|
||||
status
|
||||
updated_at
|
||||
courtesycar {
|
||||
id
|
||||
fleetnumber
|
||||
make
|
||||
model
|
||||
year
|
||||
plate
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_ACTIVE_CONTRACTS_PAGINATED = gql`
|
||||
query QUERY_ACTIVE_CONTRACTS_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [cccontracts_order_by!]!
|
||||
) {
|
||||
search_cccontracts(
|
||||
args: { search: $search }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
query QUERY_ACTIVE_CONTRACTS_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [cccontracts_order_by!]!
|
||||
) {
|
||||
agreementnumber
|
||||
courtesycarid
|
||||
driver_fn
|
||||
driver_ln
|
||||
driver_ph1
|
||||
id
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
}
|
||||
scheduledreturn
|
||||
actualreturn
|
||||
start
|
||||
status
|
||||
courtesycar {
|
||||
id
|
||||
fleetnumber
|
||||
make
|
||||
model
|
||||
year
|
||||
plate
|
||||
}
|
||||
search_cccontracts(
|
||||
args: { search: $search }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
) {
|
||||
agreementnumber
|
||||
courtesycarid
|
||||
driver_fn
|
||||
driver_ln
|
||||
driver_ph1
|
||||
id
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
}
|
||||
scheduledreturn
|
||||
actualreturn
|
||||
start
|
||||
status
|
||||
courtesycar {
|
||||
id
|
||||
fleetnumber
|
||||
make
|
||||
model
|
||||
year
|
||||
plate
|
||||
}
|
||||
}
|
||||
search_cccontracts_aggregate(args: { search: $search }) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
search_cccontracts_aggregate(args: { search: $search }) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const FIND_CONTRACT = gql`
|
||||
query FIND_CONTRACT($plate: String, $time: timestamptz!) {
|
||||
cccontracts(
|
||||
where: {
|
||||
_or: [
|
||||
{ actualreturn: { _gte: $time } }
|
||||
{ actualreturn: { _is_null: true } }
|
||||
]
|
||||
start: { _lte: $time }
|
||||
courtesycar: { plate: { _eq: $plate } }
|
||||
}
|
||||
) {
|
||||
agreementnumber
|
||||
courtesycarid
|
||||
driver_fn
|
||||
driver_ln
|
||||
driver_ph1
|
||||
id
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
}
|
||||
scheduledreturn
|
||||
actualreturn
|
||||
start
|
||||
status
|
||||
courtesycar {
|
||||
id
|
||||
fleetnumber
|
||||
make
|
||||
model
|
||||
year
|
||||
plate
|
||||
}
|
||||
query FIND_CONTRACT($plate: String, $time: timestamptz!) {
|
||||
cccontracts(
|
||||
where: {
|
||||
_or: [
|
||||
{ actualreturn: { _gte: $time } }
|
||||
{ actualreturn: { _is_null: true } }
|
||||
]
|
||||
start: { _lte: $time }
|
||||
courtesycar: { plate: { _eq: $plate } }
|
||||
}
|
||||
) {
|
||||
agreementnumber
|
||||
courtesycarid
|
||||
driver_fn
|
||||
driver_ln
|
||||
driver_ph1
|
||||
id
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
}
|
||||
scheduledreturn
|
||||
actualreturn
|
||||
start
|
||||
status
|
||||
courtesycar {
|
||||
id
|
||||
fleetnumber
|
||||
make
|
||||
model
|
||||
year
|
||||
plate
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,134 +1,134 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const UNREAD_CONVERSATION_COUNT = gql`
|
||||
query UNREAD_CONVERSATION_COUNT {
|
||||
messages_aggregate(
|
||||
where: { read: { _eq: false }, isoutbound: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
count
|
||||
}
|
||||
query UNREAD_CONVERSATION_COUNT {
|
||||
messages_aggregate(
|
||||
where: { read: { _eq: false }, isoutbound: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
count
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const CONVERSATION_LIST_QUERY = gql`
|
||||
query CONVERSATION_LIST_QUERY($offset: Int!) {
|
||||
conversations(
|
||||
order_by: { updated_at: desc }
|
||||
limit: 50
|
||||
offset: $offset
|
||||
where: { archived: { _eq: false } }
|
||||
) {
|
||||
phone_num
|
||||
id
|
||||
updated_at
|
||||
unreadcnt
|
||||
archived
|
||||
label
|
||||
messages_aggregate(
|
||||
where: { read: { _eq: false }, isoutbound: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
count
|
||||
query CONVERSATION_LIST_QUERY($offset: Int!) {
|
||||
conversations(
|
||||
order_by: { updated_at: desc }
|
||||
limit: 50
|
||||
offset: $offset
|
||||
where: { archived: { _eq: false } }
|
||||
) {
|
||||
phone_num
|
||||
id
|
||||
updated_at
|
||||
unreadcnt
|
||||
archived
|
||||
label
|
||||
messages_aggregate(
|
||||
where: { read: { _eq: false }, isoutbound: { _eq: false } }
|
||||
) {
|
||||
aggregate {
|
||||
count
|
||||
}
|
||||
}
|
||||
job_conversations {
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
job_conversations {
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const CONVERSATION_SUBSCRIPTION_BY_PK = gql`
|
||||
subscription CONVERSATION_SUBSCRIPTION_BY_PK($conversationId: uuid!) {
|
||||
messages(
|
||||
order_by: { created_at: asc_nulls_first }
|
||||
where: { conversationid: { _eq: $conversationId } }
|
||||
) {
|
||||
id
|
||||
status
|
||||
text
|
||||
isoutbound
|
||||
image
|
||||
image_path
|
||||
userid
|
||||
created_at
|
||||
read
|
||||
subscription CONVERSATION_SUBSCRIPTION_BY_PK($conversationId: uuid!) {
|
||||
messages(
|
||||
order_by: { created_at: asc_nulls_first }
|
||||
where: { conversationid: { _eq: $conversationId } }
|
||||
) {
|
||||
id
|
||||
status
|
||||
text
|
||||
isoutbound
|
||||
image
|
||||
image_path
|
||||
userid
|
||||
created_at
|
||||
read
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_CONVERSATION_DETAILS = gql`
|
||||
query GET_CONVERSATION_DETAILS($conversationId: uuid!) {
|
||||
conversations_by_pk(id: $conversationId) {
|
||||
id
|
||||
phone_num
|
||||
archived
|
||||
label
|
||||
job_conversations {
|
||||
jobid
|
||||
conversationid
|
||||
job {
|
||||
id
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
ro_number
|
||||
query GET_CONVERSATION_DETAILS($conversationId: uuid!) {
|
||||
conversations_by_pk(id: $conversationId) {
|
||||
id
|
||||
phone_num
|
||||
archived
|
||||
label
|
||||
job_conversations {
|
||||
jobid
|
||||
conversationid
|
||||
job {
|
||||
id
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
ro_number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const CONVERSATION_ID_BY_PHONE = gql`
|
||||
query CONVERSATION_ID_BY_PHONE($phone: String!) {
|
||||
conversations(where: { phone_num: { _eq: $phone } }) {
|
||||
id
|
||||
job_conversations {
|
||||
jobid
|
||||
id
|
||||
}
|
||||
query CONVERSATION_ID_BY_PHONE($phone: String!) {
|
||||
conversations(where: { phone_num: { _eq: $phone } }) {
|
||||
id
|
||||
job_conversations {
|
||||
jobid
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const CREATE_CONVERSATION = gql`
|
||||
mutation CREATE_CONVERSATION($conversation: [conversations_insert_input!]!) {
|
||||
insert_conversations(objects: $conversation) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation CREATE_CONVERSATION($conversation: [conversations_insert_input!]!) {
|
||||
insert_conversations(objects: $conversation) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const TOGGLE_CONVERSATION_ARCHIVE = gql`
|
||||
mutation TOGGLE_CONVERSATION_ARCHIVE($id: uuid!, $archived: Boolean) {
|
||||
update_conversations_by_pk(
|
||||
pk_columns: { id: $id }
|
||||
_set: { archived: $archived }
|
||||
) {
|
||||
archived
|
||||
id
|
||||
mutation TOGGLE_CONVERSATION_ARCHIVE($id: uuid!, $archived: Boolean) {
|
||||
update_conversations_by_pk(
|
||||
pk_columns: { id: $id }
|
||||
_set: { archived: $archived }
|
||||
) {
|
||||
archived
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_CONVERSATION_LABEL = gql`
|
||||
mutation UPDATE_CONVERSATION_LABEL($id: uuid!, $label: String) {
|
||||
update_conversations_by_pk(
|
||||
pk_columns: { id: $id }
|
||||
_set: { label: $label }
|
||||
) {
|
||||
label
|
||||
id
|
||||
mutation UPDATE_CONVERSATION_LABEL($id: uuid!, $label: String) {
|
||||
update_conversations_by_pk(
|
||||
pk_columns: { id: $id }
|
||||
_set: { label: $label }
|
||||
) {
|
||||
label
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,172 +1,172 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const INSERT_NEW_COURTESY_CAR = gql`
|
||||
mutation INSERT_NEW_COURTESY_CAR(
|
||||
$courtesycar: [courtesycars_insert_input!]!
|
||||
) {
|
||||
insert_courtesycars(objects: $courtesycar) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation INSERT_NEW_COURTESY_CAR(
|
||||
$courtesycar: [courtesycars_insert_input!]!
|
||||
) {
|
||||
insert_courtesycars(objects: $courtesycar) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_AVAILABLE_CC = gql`
|
||||
query QUERY_AVAILABLE_CC($today: date) {
|
||||
courtesycars(
|
||||
where: {
|
||||
_or: [
|
||||
{ serviceenddate: { _is_null: true } }
|
||||
{ serviceenddate: { _gt: $today } }
|
||||
]
|
||||
status: { _eq: "courtesycars.status.in" }
|
||||
}
|
||||
) {
|
||||
color
|
||||
dailycost
|
||||
damage
|
||||
fleetnumber
|
||||
fuel
|
||||
id
|
||||
make
|
||||
mileage
|
||||
model
|
||||
notes
|
||||
nextservicekm
|
||||
nextservicedate
|
||||
plate
|
||||
readiness
|
||||
status
|
||||
year
|
||||
query QUERY_AVAILABLE_CC($today: date) {
|
||||
courtesycars(
|
||||
where: {
|
||||
_or: [
|
||||
{ serviceenddate: { _is_null: true } }
|
||||
{ serviceenddate: { _gt: $today } }
|
||||
]
|
||||
status: { _eq: "courtesycars.status.in" }
|
||||
}
|
||||
) {
|
||||
color
|
||||
dailycost
|
||||
damage
|
||||
fleetnumber
|
||||
fuel
|
||||
id
|
||||
make
|
||||
mileage
|
||||
model
|
||||
notes
|
||||
nextservicekm
|
||||
nextservicedate
|
||||
plate
|
||||
readiness
|
||||
status
|
||||
year
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const CHECK_CC_FLEET_NUMBER = gql`
|
||||
query CHECK_VENDOR_NAME($name: String!) {
|
||||
courtesycars_aggregate(where: { fleetnumber: { _ilike: $name } }) {
|
||||
aggregate {
|
||||
count
|
||||
}
|
||||
nodes {
|
||||
id
|
||||
}
|
||||
query CHECK_VENDOR_NAME($name: String!) {
|
||||
courtesycars_aggregate(where: { fleetnumber: { _ilike: $name } }) {
|
||||
aggregate {
|
||||
count
|
||||
}
|
||||
nodes {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const QUERY_ALL_CC = gql`
|
||||
query QUERY_ALL_CC {
|
||||
courtesycars {
|
||||
color
|
||||
created_at
|
||||
dailycost
|
||||
damage
|
||||
fleetnumber
|
||||
fuel
|
||||
id
|
||||
insuranceexpires
|
||||
leaseenddate
|
||||
make
|
||||
mileage
|
||||
model
|
||||
nextservicedate
|
||||
nextservicekm
|
||||
notes
|
||||
plate
|
||||
purchasedate
|
||||
readiness
|
||||
registrationexpires
|
||||
serviceenddate
|
||||
servicestartdate
|
||||
status
|
||||
vin
|
||||
year
|
||||
cccontracts(
|
||||
where: { status: { _eq: "contracts.status.out" } }
|
||||
order_by: { contract_date: desc }
|
||||
limit: 1
|
||||
) {
|
||||
id
|
||||
scheduledreturn
|
||||
job {
|
||||
id
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
ro_number
|
||||
query QUERY_ALL_CC {
|
||||
courtesycars {
|
||||
color
|
||||
created_at
|
||||
dailycost
|
||||
damage
|
||||
fleetnumber
|
||||
fuel
|
||||
id
|
||||
insuranceexpires
|
||||
leaseenddate
|
||||
make
|
||||
mileage
|
||||
model
|
||||
nextservicedate
|
||||
nextservicekm
|
||||
notes
|
||||
plate
|
||||
purchasedate
|
||||
readiness
|
||||
registrationexpires
|
||||
serviceenddate
|
||||
servicestartdate
|
||||
status
|
||||
vin
|
||||
year
|
||||
cccontracts(
|
||||
where: { status: { _eq: "contracts.status.out" } }
|
||||
order_by: { contract_date: desc }
|
||||
limit: 1
|
||||
) {
|
||||
id
|
||||
scheduledreturn
|
||||
job {
|
||||
id
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
ro_number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_CC_BY_PK = gql`
|
||||
query QUERY_CC_BY_PK(
|
||||
$id: uuid!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [cccontracts_order_by!]!
|
||||
) {
|
||||
courtesycars_by_pk(id: $id) {
|
||||
bodyshopid
|
||||
color
|
||||
created_at
|
||||
dailycost
|
||||
damage
|
||||
fleetnumber
|
||||
fuel
|
||||
id
|
||||
insuranceexpires
|
||||
leaseenddate
|
||||
make
|
||||
mileage
|
||||
model
|
||||
nextservicedate
|
||||
nextservicekm
|
||||
notes
|
||||
plate
|
||||
purchasedate
|
||||
readiness
|
||||
registrationexpires
|
||||
serviceenddate
|
||||
servicestartdate
|
||||
status
|
||||
vin
|
||||
year
|
||||
cccontracts_aggregate {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
query QUERY_CC_BY_PK(
|
||||
$id: uuid!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [cccontracts_order_by!]!
|
||||
) {
|
||||
courtesycars_by_pk(id: $id) {
|
||||
bodyshopid
|
||||
color
|
||||
created_at
|
||||
dailycost
|
||||
damage
|
||||
fleetnumber
|
||||
fuel
|
||||
id
|
||||
insuranceexpires
|
||||
leaseenddate
|
||||
make
|
||||
mileage
|
||||
model
|
||||
nextservicedate
|
||||
nextservicekm
|
||||
notes
|
||||
plate
|
||||
purchasedate
|
||||
readiness
|
||||
registrationexpires
|
||||
serviceenddate
|
||||
servicestartdate
|
||||
status
|
||||
vin
|
||||
year
|
||||
cccontracts_aggregate {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
cccontracts(offset: $offset, limit: $limit, order_by: $order) {
|
||||
agreementnumber
|
||||
driver_fn
|
||||
driver_ln
|
||||
id
|
||||
kmstart
|
||||
kmend
|
||||
scheduledreturn
|
||||
start
|
||||
status
|
||||
job {
|
||||
id
|
||||
ownr_ln
|
||||
ownr_fn
|
||||
ownr_co_nm
|
||||
ro_number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cccontracts(offset: $offset, limit: $limit, order_by: $order) {
|
||||
agreementnumber
|
||||
driver_fn
|
||||
driver_ln
|
||||
id
|
||||
kmstart
|
||||
kmend
|
||||
scheduledreturn
|
||||
start
|
||||
status
|
||||
job {
|
||||
id
|
||||
ownr_ln
|
||||
ownr_fn
|
||||
ownr_co_nm
|
||||
ro_number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_CC = gql`
|
||||
mutation UPDATE_CC($ccId: uuid!, $cc: courtesycars_set_input!) {
|
||||
update_courtesycars(where: { id: { _eq: $ccId } }, _set: $cc) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation UPDATE_CC($ccId: uuid!, $cc: courtesycars_set_input!) {
|
||||
update_courtesycars(where: { id: { _eq: $ccId } }, _set: $cc) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,97 +1,97 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const QUERY_SURVEY = gql`
|
||||
query QUERY_SURVEY($surveyId: uuid!) {
|
||||
csi_by_pk(id: $surveyId) {
|
||||
relateddata
|
||||
valid
|
||||
validuntil
|
||||
id
|
||||
csiquestion {
|
||||
id
|
||||
config
|
||||
}
|
||||
query QUERY_SURVEY($surveyId: uuid!) {
|
||||
csi_by_pk(id: $surveyId) {
|
||||
relateddata
|
||||
valid
|
||||
validuntil
|
||||
id
|
||||
csiquestion {
|
||||
id
|
||||
config
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const COMPLETE_SURVEY = gql`
|
||||
mutation COMPLETE_SURVEY($surveyId: uuid!, $survey: csi_set_input) {
|
||||
update_csi(where: { id: { _eq: $surveyId } }, _set: $survey) {
|
||||
affected_rows
|
||||
mutation COMPLETE_SURVEY($surveyId: uuid!, $survey: csi_set_input) {
|
||||
update_csi(where: { id: { _eq: $surveyId } }, _set: $survey) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_ALL_QUESTION_SETS = gql`
|
||||
query GET_ALL_QUESTION_SETS {
|
||||
csiquestions(order_by: { created_at: desc }) {
|
||||
id
|
||||
created_at
|
||||
config
|
||||
current
|
||||
csis_aggregate {
|
||||
aggregate {
|
||||
count
|
||||
query GET_ALL_QUESTION_SETS {
|
||||
csiquestions(order_by: { created_at: desc }) {
|
||||
id
|
||||
created_at
|
||||
config
|
||||
current
|
||||
csis_aggregate {
|
||||
aggregate {
|
||||
count
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_CURRENT_QUESTIONSET_ID = gql`
|
||||
query GET_CURRENT_QUESTIONSET_ID {
|
||||
csiquestions(where: { current: { _eq: true } }) {
|
||||
id
|
||||
query GET_CURRENT_QUESTIONSET_ID {
|
||||
csiquestions(where: { current: { _eq: true } }) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_CSI = gql`
|
||||
mutation INSERT_CSI($csiInput: [csi_insert_input!]!) {
|
||||
insert_csi(objects: $csiInput) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation INSERT_CSI($csiInput: [csi_insert_input!]!) {
|
||||
insert_csi(objects: $csiInput) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_CSI_RESPONSE_PAGINATED = gql`
|
||||
query QUERY_CSI_RESPONSE_PAGINATED(
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [csi_order_by!]!
|
||||
) {
|
||||
csi(offset: $offset, limit: $limit, order_by: $order) {
|
||||
id
|
||||
completedon
|
||||
job {
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ro_number
|
||||
query QUERY_CSI_RESPONSE_PAGINATED(
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [csi_order_by!]!
|
||||
) {
|
||||
csi(offset: $offset, limit: $limit, order_by: $order) {
|
||||
id
|
||||
completedon
|
||||
job {
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ro_number
|
||||
|
||||
id
|
||||
}
|
||||
id
|
||||
}
|
||||
}
|
||||
csi_aggregate {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
csi_aggregate {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const QUERY_CSI_RESPONSE_BY_PK = gql`
|
||||
query QUERY_CSI_RESPONSE_BY_PK($id: uuid!) {
|
||||
csi_by_pk(id: $id) {
|
||||
relateddata
|
||||
valid
|
||||
validuntil
|
||||
id
|
||||
response
|
||||
csiquestion {
|
||||
id
|
||||
config
|
||||
}
|
||||
query QUERY_CSI_RESPONSE_BY_PK($id: uuid!) {
|
||||
csi_by_pk(id: $id) {
|
||||
relateddata
|
||||
valid
|
||||
validuntil
|
||||
id
|
||||
response
|
||||
csiquestion {
|
||||
id
|
||||
config
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const SEARCH_DMS_VEHICLES = gql`
|
||||
query SEARCH_DMS_VEHICLES($search: String) {
|
||||
search_dms_vehicles(args: { search: $search }) {
|
||||
id
|
||||
make
|
||||
makecode
|
||||
model
|
||||
modelcode
|
||||
query SEARCH_DMS_VEHICLES($search: String) {
|
||||
search_dms_vehicles(args: { search: $search }) {
|
||||
id
|
||||
make
|
||||
makecode
|
||||
model
|
||||
modelcode
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,128 +1,128 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const GET_DOCUMENT_BY_PK = gql`
|
||||
query GET_DOCUMENT_BY_PK($documentId: uuid!) {
|
||||
documents_by_pk(id: $documentId) {
|
||||
id
|
||||
name
|
||||
key
|
||||
type
|
||||
size
|
||||
takenat
|
||||
extension
|
||||
jobid
|
||||
query GET_DOCUMENT_BY_PK($documentId: uuid!) {
|
||||
documents_by_pk(id: $documentId) {
|
||||
id
|
||||
name
|
||||
key
|
||||
type
|
||||
size
|
||||
takenat
|
||||
extension
|
||||
jobid
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_DOCUMENTS_BY_JOB = gql`
|
||||
query GET_DOCUMENTS_BY_JOB($jobId: uuid!) {
|
||||
jobs_by_pk(id: $jobId) {
|
||||
id
|
||||
ro_number
|
||||
}
|
||||
documents_aggregate(where: { jobid: { _eq: $jobId } }) {
|
||||
aggregate {
|
||||
sum {
|
||||
size
|
||||
query GET_DOCUMENTS_BY_JOB($jobId: uuid!) {
|
||||
jobs_by_pk(id: $jobId) {
|
||||
id
|
||||
ro_number
|
||||
}
|
||||
}
|
||||
}
|
||||
documents(order_by: { takenat: desc }, where: { jobid: { _eq: $jobId } }) {
|
||||
id
|
||||
name
|
||||
key
|
||||
type
|
||||
size
|
||||
takenat
|
||||
extension
|
||||
bill {
|
||||
id
|
||||
invoice_number
|
||||
date
|
||||
vendor {
|
||||
id
|
||||
name
|
||||
documents_aggregate(where: { jobid: { _eq: $jobId } }) {
|
||||
aggregate {
|
||||
sum {
|
||||
size
|
||||
}
|
||||
}
|
||||
}
|
||||
documents(order_by: { takenat: desc }, where: { jobid: { _eq: $jobId } }) {
|
||||
id
|
||||
name
|
||||
key
|
||||
type
|
||||
size
|
||||
takenat
|
||||
extension
|
||||
bill {
|
||||
id
|
||||
invoice_number
|
||||
date
|
||||
vendor {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_DOC_SIZE_BY_JOB = gql`
|
||||
query GET_DOC_SIZE_BY_JOB($jobId: uuid!) {
|
||||
documents_aggregate(where: { jobid: { _eq: $jobId } }) {
|
||||
aggregate {
|
||||
sum {
|
||||
size
|
||||
query GET_DOC_SIZE_BY_JOB($jobId: uuid!) {
|
||||
documents_aggregate(where: { jobid: { _eq: $jobId } }) {
|
||||
aggregate {
|
||||
sum {
|
||||
size
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_NEW_DOCUMENT = gql`
|
||||
mutation INSERT_NEW_DOCUMENT($docInput: [documents_insert_input!]!) {
|
||||
insert_documents(objects: $docInput) {
|
||||
returning {
|
||||
id
|
||||
name
|
||||
key
|
||||
size
|
||||
takenat
|
||||
}
|
||||
mutation INSERT_NEW_DOCUMENT($docInput: [documents_insert_input!]!) {
|
||||
insert_documents(objects: $docInput) {
|
||||
returning {
|
||||
id
|
||||
name
|
||||
key
|
||||
size
|
||||
takenat
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_DOCUMENT = gql`
|
||||
mutation DELETE_DOCUMENT($id: uuid) {
|
||||
delete_documents(where: { id: { _eq: $id } }) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation DELETE_DOCUMENT($id: uuid) {
|
||||
delete_documents(where: { id: { _eq: $id } }) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const DELETE_DOCUMENTS = gql`
|
||||
mutation DELETE_DOCUMENTS($ids: [uuid!]!) {
|
||||
delete_documents(where: { id: { _in: $ids } }) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation DELETE_DOCUMENTS($ids: [uuid!]!) {
|
||||
delete_documents(where: { id: { _in: $ids } }) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const QUERY_TEMPORARY_DOCS = gql`
|
||||
query QUERY_TEMPORARY_DOCS {
|
||||
documents(
|
||||
where: { jobid: { _is_null: true } }
|
||||
order_by: { takenat: desc }
|
||||
) {
|
||||
id
|
||||
name
|
||||
key
|
||||
type
|
||||
extension
|
||||
size
|
||||
takenat
|
||||
query QUERY_TEMPORARY_DOCS {
|
||||
documents(
|
||||
where: { jobid: { _is_null: true } }
|
||||
order_by: { takenat: desc }
|
||||
) {
|
||||
id
|
||||
name
|
||||
key
|
||||
type
|
||||
extension
|
||||
size
|
||||
takenat
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_DOCUMENT = gql`
|
||||
mutation UPDATE_DOCUMENT($id: uuid!, $document: documents_set_input!) {
|
||||
update_documents_by_pk(pk_columns: { id: $id }, _set: $document) {
|
||||
billid
|
||||
bodyshopid
|
||||
extension
|
||||
id
|
||||
jobid
|
||||
name
|
||||
type
|
||||
key
|
||||
size
|
||||
takenat
|
||||
mutation UPDATE_DOCUMENT($id: uuid!, $document: documents_set_input!) {
|
||||
update_documents_by_pk(pk_columns: { id: $id }, _set: $document) {
|
||||
billid
|
||||
bodyshopid
|
||||
extension
|
||||
id
|
||||
jobid
|
||||
name
|
||||
type
|
||||
key
|
||||
size
|
||||
takenat
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,96 +1,96 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const QUERY_TEAMS = gql`
|
||||
query QUERY_TEAMS {
|
||||
employee_teams(order_by: { name: asc }) {
|
||||
id
|
||||
max_load
|
||||
name
|
||||
employee_team_members {
|
||||
id
|
||||
employeeid
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
query QUERY_TEAMS {
|
||||
employee_teams(order_by: { name: asc }) {
|
||||
id
|
||||
max_load
|
||||
name
|
||||
employee_team_members {
|
||||
id
|
||||
employeeid
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_EMPLOYEE_TEAM = gql`
|
||||
mutation UPDATE_EMPLOYEE_TEAM(
|
||||
$employeeTeamId: uuid!
|
||||
$employeeTeam: employee_teams_set_input
|
||||
$teamMemberDeletes: [uuid!]
|
||||
$teamMemberUpdates: [employee_team_members_updates!]!
|
||||
$teamMemberInserts: [employee_team_members_insert_input!]!
|
||||
) {
|
||||
update_employee_team_members_many(updates: $teamMemberUpdates) {
|
||||
returning {
|
||||
employeeid
|
||||
id
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
}
|
||||
delete_employee_team_members(where: { id: { _in: $teamMemberDeletes } }) {
|
||||
affected_rows
|
||||
}
|
||||
insert_employee_team_members(objects: $teamMemberInserts) {
|
||||
returning {
|
||||
employeeid
|
||||
id
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
}
|
||||
update_employee_teams_by_pk(
|
||||
pk_columns: { id: $employeeTeamId }
|
||||
_set: $employeeTeam
|
||||
mutation UPDATE_EMPLOYEE_TEAM(
|
||||
$employeeTeamId: uuid!
|
||||
$employeeTeam: employee_teams_set_input
|
||||
$teamMemberDeletes: [uuid!]
|
||||
$teamMemberUpdates: [employee_team_members_updates!]!
|
||||
$teamMemberInserts: [employee_team_members_insert_input!]!
|
||||
) {
|
||||
active
|
||||
id
|
||||
max_load
|
||||
name
|
||||
employee_team_members {
|
||||
employeeid
|
||||
id
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
update_employee_team_members_many(updates: $teamMemberUpdates) {
|
||||
returning {
|
||||
employeeid
|
||||
id
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
}
|
||||
delete_employee_team_members(where: { id: { _in: $teamMemberDeletes } }) {
|
||||
affected_rows
|
||||
}
|
||||
insert_employee_team_members(objects: $teamMemberInserts) {
|
||||
returning {
|
||||
employeeid
|
||||
id
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
}
|
||||
update_employee_teams_by_pk(
|
||||
pk_columns: { id: $employeeTeamId }
|
||||
_set: $employeeTeam
|
||||
) {
|
||||
active
|
||||
id
|
||||
max_load
|
||||
name
|
||||
employee_team_members {
|
||||
employeeid
|
||||
id
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_EMPLOYEE_TEAM = gql`
|
||||
mutation INSERT_EMPLOYEE_TEAM($employeeTeam: employee_teams_insert_input!) {
|
||||
insert_employee_teams_one(object: $employeeTeam) {
|
||||
active
|
||||
id
|
||||
max_load
|
||||
name
|
||||
employee_team_members {
|
||||
employeeid
|
||||
id
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
mutation INSERT_EMPLOYEE_TEAM($employeeTeam: employee_teams_insert_input!) {
|
||||
insert_employee_teams_one(object: $employeeTeam) {
|
||||
active
|
||||
id
|
||||
max_load
|
||||
name
|
||||
employee_team_members {
|
||||
employeeid
|
||||
id
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_EMPLOYEE_TEAM_BY_ID = gql`
|
||||
query QUERY_EMPLOYEE_TEAM_BY_ID($id: uuid!) {
|
||||
employee_teams_by_pk(id: $id) {
|
||||
active
|
||||
id
|
||||
max_load
|
||||
name
|
||||
employee_team_members {
|
||||
employeeid
|
||||
id
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
query QUERY_EMPLOYEE_TEAM_BY_ID($id: uuid!) {
|
||||
employee_teams_by_pk(id: $id) {
|
||||
active
|
||||
id
|
||||
max_load
|
||||
name
|
||||
employee_team_members {
|
||||
employeeid
|
||||
id
|
||||
labor_rates
|
||||
percentage
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,181 +1,181 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const INSERT_INVENTORY_AND_CREDIT = gql`
|
||||
mutation INSERT_INVENTORY_AND_CREDIT(
|
||||
$inv: inventory_insert_input!
|
||||
$cm: bills_insert_input!
|
||||
$pol: parts_orders_insert_input!
|
||||
$joblineId: uuid!
|
||||
$joblineStatus: String
|
||||
) {
|
||||
insert_inventory_one(object: $inv) {
|
||||
id
|
||||
}
|
||||
insert_bills_one(object: $cm) {
|
||||
id
|
||||
}
|
||||
insert_parts_orders_one(object: $pol) {
|
||||
id
|
||||
}
|
||||
update_joblines_by_pk(
|
||||
pk_columns: { id: $joblineId }
|
||||
_set: { status: $joblineStatus }
|
||||
mutation INSERT_INVENTORY_AND_CREDIT(
|
||||
$inv: inventory_insert_input!
|
||||
$cm: bills_insert_input!
|
||||
$pol: parts_orders_insert_input!
|
||||
$joblineId: uuid!
|
||||
$joblineStatus: String
|
||||
) {
|
||||
id
|
||||
status
|
||||
insert_inventory_one(object: $inv) {
|
||||
id
|
||||
}
|
||||
insert_bills_one(object: $cm) {
|
||||
id
|
||||
}
|
||||
insert_parts_orders_one(object: $pol) {
|
||||
id
|
||||
}
|
||||
update_joblines_by_pk(
|
||||
pk_columns: { id: $joblineId }
|
||||
_set: { status: $joblineStatus }
|
||||
) {
|
||||
id
|
||||
status
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const UPDATE_INVENTORY_LINES = gql`
|
||||
mutation UPDATE_INVENTORY_LINES(
|
||||
$InventoryIds: [uuid!]!
|
||||
$consumedbybillid: uuid!
|
||||
) {
|
||||
update_inventory(
|
||||
where: { id: { _in: $InventoryIds } }
|
||||
_set: { consumedbybillid: $consumedbybillid }
|
||||
mutation UPDATE_INVENTORY_LINES(
|
||||
$InventoryIds: [uuid!]!
|
||||
$consumedbybillid: uuid!
|
||||
) {
|
||||
affected_rows
|
||||
update_inventory(
|
||||
where: { id: { _in: $InventoryIds } }
|
||||
_set: { consumedbybillid: $consumedbybillid }
|
||||
) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_OUTSTANDING_INVENTORY = gql`
|
||||
query QUERY_OUTSTANDING_INVENTORY {
|
||||
inventory(
|
||||
where: { consumedbybillid: { _is_null: true } }
|
||||
order_by: { line_desc: asc }
|
||||
) {
|
||||
id
|
||||
actual_cost
|
||||
actual_price
|
||||
quantity
|
||||
billlineid
|
||||
line_desc
|
||||
comment
|
||||
manualinvoicenumber
|
||||
manualvendor
|
||||
consumedbybillid
|
||||
billline {
|
||||
bill {
|
||||
invoice_number
|
||||
vendor {
|
||||
name
|
||||
}
|
||||
query QUERY_OUTSTANDING_INVENTORY {
|
||||
inventory(
|
||||
where: { consumedbybillid: { _is_null: true } }
|
||||
order_by: { line_desc: asc }
|
||||
) {
|
||||
id
|
||||
actual_cost
|
||||
actual_price
|
||||
quantity
|
||||
billlineid
|
||||
line_desc
|
||||
comment
|
||||
manualinvoicenumber
|
||||
manualvendor
|
||||
consumedbybillid
|
||||
billline {
|
||||
bill {
|
||||
invoice_number
|
||||
vendor {
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_INVENTORY_PAGINATED = gql`
|
||||
query QUERY_INVENTORY_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [inventory_order_by!]
|
||||
$consumedIsNull: Boolean
|
||||
) {
|
||||
search_inventory(
|
||||
args: { search: $search }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
where: { consumedbybillid: { _is_null: $consumedIsNull } }
|
||||
query QUERY_INVENTORY_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [inventory_order_by!]
|
||||
$consumedIsNull: Boolean
|
||||
) {
|
||||
id
|
||||
line_desc
|
||||
actual_price
|
||||
actual_cost
|
||||
comment
|
||||
manualinvoicenumber
|
||||
manualvendor
|
||||
consumedbybillid
|
||||
bill {
|
||||
id
|
||||
invoice_number
|
||||
job {
|
||||
ro_number
|
||||
id
|
||||
}
|
||||
}
|
||||
billline {
|
||||
id
|
||||
bill {
|
||||
id
|
||||
invoice_number
|
||||
job {
|
||||
search_inventory(
|
||||
args: { search: $search }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
where: { consumedbybillid: { _is_null: $consumedIsNull } }
|
||||
) {
|
||||
id
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
v_model_yr
|
||||
}
|
||||
vendor {
|
||||
id
|
||||
name
|
||||
}
|
||||
line_desc
|
||||
actual_price
|
||||
actual_cost
|
||||
comment
|
||||
manualinvoicenumber
|
||||
manualvendor
|
||||
consumedbybillid
|
||||
bill {
|
||||
id
|
||||
invoice_number
|
||||
job {
|
||||
ro_number
|
||||
id
|
||||
}
|
||||
}
|
||||
billline {
|
||||
id
|
||||
bill {
|
||||
id
|
||||
invoice_number
|
||||
job {
|
||||
id
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
v_model_yr
|
||||
}
|
||||
vendor {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
search_inventory_aggregate(
|
||||
args: { search: $search }
|
||||
where: { consumedbybillid: { _is_null: $consumedIsNull } }
|
||||
) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
search_inventory_aggregate(
|
||||
args: { search: $search }
|
||||
where: { consumedbybillid: { _is_null: $consumedIsNull } }
|
||||
) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_INVENTORY_LINE = gql`
|
||||
mutation DELETE_INVENTORY_LINE($lineId: uuid!) {
|
||||
delete_inventory_by_pk(id: $lineId) {
|
||||
id
|
||||
mutation DELETE_INVENTORY_LINE($lineId: uuid!) {
|
||||
delete_inventory_by_pk(id: $lineId) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_INVENTORY_LINE = gql`
|
||||
mutation INSERT_INVENTORY_LINE($inventoryItem: inventory_insert_input!) {
|
||||
insert_inventory_one(object: $inventoryItem) {
|
||||
id
|
||||
line_desc
|
||||
consumedbybillid
|
||||
billlineid
|
||||
actual_price
|
||||
actual_cost
|
||||
comment
|
||||
manualinvoicenumber
|
||||
manualvendor
|
||||
bill {
|
||||
invoice_number
|
||||
}
|
||||
mutation INSERT_INVENTORY_LINE($inventoryItem: inventory_insert_input!) {
|
||||
insert_inventory_one(object: $inventoryItem) {
|
||||
id
|
||||
line_desc
|
||||
consumedbybillid
|
||||
billlineid
|
||||
actual_price
|
||||
actual_cost
|
||||
comment
|
||||
manualinvoicenumber
|
||||
manualvendor
|
||||
bill {
|
||||
invoice_number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_INVENTORY_LINE = gql`
|
||||
mutation UPDATE_INVENTORY_LINE(
|
||||
$inventoryId: uuid!
|
||||
$inventoryItem: inventory_set_input!
|
||||
) {
|
||||
update_inventory_by_pk(
|
||||
pk_columns: { id: $inventoryId }
|
||||
_set: $inventoryItem
|
||||
mutation UPDATE_INVENTORY_LINE(
|
||||
$inventoryId: uuid!
|
||||
$inventoryItem: inventory_set_input!
|
||||
) {
|
||||
id
|
||||
line_desc
|
||||
consumedbybillid
|
||||
billlineid
|
||||
actual_price
|
||||
actual_cost
|
||||
comment
|
||||
manualinvoicenumber
|
||||
manualvendor
|
||||
bill {
|
||||
invoice_number
|
||||
}
|
||||
update_inventory_by_pk(
|
||||
pk_columns: { id: $inventoryId }
|
||||
_set: $inventoryItem
|
||||
) {
|
||||
id
|
||||
line_desc
|
||||
consumedbybillid
|
||||
billlineid
|
||||
actual_price
|
||||
actual_cost
|
||||
comment
|
||||
manualinvoicenumber
|
||||
manualvendor
|
||||
bill {
|
||||
invoice_number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,44 +1,44 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const INSERT_CONVERSATION_TAG = gql`
|
||||
mutation INSERT_CONVERSATION_TAG($conversationId: uuid!, $jobId: uuid!) {
|
||||
insert_job_conversations(
|
||||
objects: { conversationid: $conversationId, jobid: $jobId }
|
||||
on_conflict: { constraint: job_conversations_pkey, update_columns: jobid }
|
||||
) {
|
||||
returning {
|
||||
jobid
|
||||
conversationid
|
||||
id
|
||||
conversation {
|
||||
id
|
||||
job_conversations {
|
||||
id
|
||||
jobid
|
||||
conversationid
|
||||
job {
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
mutation INSERT_CONVERSATION_TAG($conversationId: uuid!, $jobId: uuid!) {
|
||||
insert_job_conversations(
|
||||
objects: { conversationid: $conversationId, jobid: $jobId }
|
||||
on_conflict: { constraint: job_conversations_pkey, update_columns: jobid }
|
||||
) {
|
||||
returning {
|
||||
jobid
|
||||
conversationid
|
||||
id
|
||||
conversation {
|
||||
id
|
||||
job_conversations {
|
||||
id
|
||||
jobid
|
||||
conversationid
|
||||
job {
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const REMOVE_CONVERSATION_TAG = gql`
|
||||
mutation REMOVE_CONVERSATION_TAG($conversationId: uuid!, $jobId: uuid!) {
|
||||
delete_job_conversations(
|
||||
where: {
|
||||
_and: {
|
||||
jobid: { _eq: $jobId }
|
||||
conversationid: { _eq: $conversationId }
|
||||
mutation REMOVE_CONVERSATION_TAG($conversationId: uuid!, $jobId: uuid!) {
|
||||
delete_job_conversations(
|
||||
where: {
|
||||
_and: {
|
||||
jobid: { _eq: $jobId }
|
||||
conversationid: { _eq: $conversationId }
|
||||
}
|
||||
}
|
||||
) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
) {
|
||||
affected_rows
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,291 +1,291 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const GET_ALL_JOBLINES_BY_PK = gql`
|
||||
query GET_ALL_JOBLINES_BY_PK($id: uuid!) {
|
||||
joblines(where: { jobid: { _eq: $id } }, order_by: { line_no: asc }) {
|
||||
id
|
||||
line_no
|
||||
unq_seq
|
||||
line_ind
|
||||
line_desc
|
||||
part_type
|
||||
oem_partno
|
||||
db_price
|
||||
act_price
|
||||
part_qty
|
||||
mod_lbr_ty
|
||||
db_hrs
|
||||
mod_lb_hrs
|
||||
lbr_op
|
||||
lbr_amt
|
||||
op_code_desc
|
||||
status
|
||||
notes
|
||||
location
|
||||
tax_part
|
||||
manual_line
|
||||
query GET_ALL_JOBLINES_BY_PK($id: uuid!) {
|
||||
joblines(where: { jobid: { _eq: $id } }, order_by: { line_no: asc }) {
|
||||
id
|
||||
line_no
|
||||
unq_seq
|
||||
line_ind
|
||||
line_desc
|
||||
part_type
|
||||
oem_partno
|
||||
db_price
|
||||
act_price
|
||||
part_qty
|
||||
mod_lbr_ty
|
||||
db_hrs
|
||||
mod_lb_hrs
|
||||
lbr_op
|
||||
lbr_amt
|
||||
op_code_desc
|
||||
status
|
||||
notes
|
||||
location
|
||||
tax_part
|
||||
manual_line
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_LINE_TICKET_BY_PK = gql`
|
||||
query GET_LINE_TICKET_BY_PK($id: uuid!) {
|
||||
jobs_by_pk(id: $id) {
|
||||
id
|
||||
lbr_adjustments
|
||||
converted
|
||||
status
|
||||
query GET_LINE_TICKET_BY_PK($id: uuid!) {
|
||||
jobs_by_pk(id: $id) {
|
||||
id
|
||||
lbr_adjustments
|
||||
converted
|
||||
status
|
||||
}
|
||||
joblines(where: { jobid: { _eq: $id }, removed: { _eq: false } }) {
|
||||
id
|
||||
line_desc
|
||||
part_type
|
||||
oem_partno
|
||||
db_price
|
||||
act_price
|
||||
part_qty
|
||||
mod_lbr_ty
|
||||
db_hrs
|
||||
mod_lb_hrs
|
||||
lbr_op
|
||||
lbr_amt
|
||||
op_code_desc
|
||||
convertedtolbr
|
||||
convertedtolbr_data
|
||||
}
|
||||
timetickets(where: { jobid: { _eq: $id } }) {
|
||||
actualhrs
|
||||
ciecacode
|
||||
cost_center
|
||||
created_by
|
||||
date
|
||||
id
|
||||
jobid
|
||||
employeeid
|
||||
memo
|
||||
flat_rate
|
||||
clockon
|
||||
clockoff
|
||||
rate
|
||||
committed_at
|
||||
commited_by
|
||||
task_name
|
||||
employee {
|
||||
id
|
||||
first_name
|
||||
last_name
|
||||
employee_number
|
||||
}
|
||||
productivehrs
|
||||
}
|
||||
}
|
||||
joblines(where: { jobid: { _eq: $id }, removed: { _eq: false } }) {
|
||||
id
|
||||
line_desc
|
||||
part_type
|
||||
oem_partno
|
||||
db_price
|
||||
act_price
|
||||
part_qty
|
||||
mod_lbr_ty
|
||||
db_hrs
|
||||
mod_lb_hrs
|
||||
lbr_op
|
||||
lbr_amt
|
||||
op_code_desc
|
||||
convertedtolbr
|
||||
convertedtolbr_data
|
||||
}
|
||||
timetickets(where: { jobid: { _eq: $id } }) {
|
||||
actualhrs
|
||||
ciecacode
|
||||
cost_center
|
||||
created_by
|
||||
date
|
||||
id
|
||||
jobid
|
||||
employeeid
|
||||
memo
|
||||
flat_rate
|
||||
clockon
|
||||
clockoff
|
||||
rate
|
||||
committed_at
|
||||
commited_by
|
||||
task_name
|
||||
employee {
|
||||
id
|
||||
first_name
|
||||
last_name
|
||||
employee_number
|
||||
}
|
||||
productivehrs
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_JOB_INFO_DRAW_CALCULATIONS = gql`
|
||||
query GET_JOB_INFO_DRAW_CALCULATIONS($id: uuid!) {
|
||||
jobs_by_pk(id: $id) {
|
||||
id
|
||||
lbr_adjustments
|
||||
converted
|
||||
rate_lab
|
||||
rate_lad
|
||||
rate_laa
|
||||
rate_la1
|
||||
rate_la2
|
||||
rate_la3
|
||||
rate_la4
|
||||
rate_lau
|
||||
rate_lar
|
||||
rate_lag
|
||||
rate_laf
|
||||
rate_lam
|
||||
query GET_JOB_INFO_DRAW_CALCULATIONS($id: uuid!) {
|
||||
jobs_by_pk(id: $id) {
|
||||
id
|
||||
lbr_adjustments
|
||||
converted
|
||||
rate_lab
|
||||
rate_lad
|
||||
rate_laa
|
||||
rate_la1
|
||||
rate_la2
|
||||
rate_la3
|
||||
rate_la4
|
||||
rate_lau
|
||||
rate_lar
|
||||
rate_lag
|
||||
rate_laf
|
||||
rate_lam
|
||||
}
|
||||
timetickets(where: { jobid: { _eq: $id } }) {
|
||||
actualhrs
|
||||
ciecacode
|
||||
cost_center
|
||||
date
|
||||
id
|
||||
jobid
|
||||
employeeid
|
||||
memo
|
||||
flat_rate
|
||||
clockon
|
||||
clockoff
|
||||
rate
|
||||
employee {
|
||||
id
|
||||
first_name
|
||||
last_name
|
||||
employee_number
|
||||
}
|
||||
productivehrs
|
||||
}
|
||||
joblines(where: { jobid: { _eq: $id }, removed: { _eq: false } }) {
|
||||
id
|
||||
line_desc
|
||||
part_type
|
||||
oem_partno
|
||||
db_price
|
||||
act_price
|
||||
part_qty
|
||||
mod_lbr_ty
|
||||
db_hrs
|
||||
mod_lb_hrs
|
||||
lbr_op
|
||||
lbr_amt
|
||||
op_code_desc
|
||||
convertedtolbr
|
||||
convertedtolbr_data
|
||||
}
|
||||
}
|
||||
timetickets(where: { jobid: { _eq: $id } }) {
|
||||
actualhrs
|
||||
ciecacode
|
||||
cost_center
|
||||
date
|
||||
id
|
||||
jobid
|
||||
employeeid
|
||||
memo
|
||||
flat_rate
|
||||
clockon
|
||||
clockoff
|
||||
rate
|
||||
employee {
|
||||
id
|
||||
first_name
|
||||
last_name
|
||||
employee_number
|
||||
}
|
||||
productivehrs
|
||||
}
|
||||
joblines(where: { jobid: { _eq: $id }, removed: { _eq: false } }) {
|
||||
id
|
||||
line_desc
|
||||
part_type
|
||||
oem_partno
|
||||
db_price
|
||||
act_price
|
||||
part_qty
|
||||
mod_lbr_ty
|
||||
db_hrs
|
||||
mod_lb_hrs
|
||||
lbr_op
|
||||
lbr_amt
|
||||
op_code_desc
|
||||
convertedtolbr
|
||||
convertedtolbr_data
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const UPDATE_JOB_LINE_STATUS = gql`
|
||||
mutation UPDATE_JOB_LINE_STATUS(
|
||||
$ids: [uuid!]!
|
||||
$status: String!
|
||||
$location: String
|
||||
) {
|
||||
update_joblines(
|
||||
where: { id: { _in: $ids } }
|
||||
_set: { status: $status, location: $location }
|
||||
mutation UPDATE_JOB_LINE_STATUS(
|
||||
$ids: [uuid!]!
|
||||
$status: String!
|
||||
$location: String
|
||||
) {
|
||||
affected_rows
|
||||
returning {
|
||||
id
|
||||
status
|
||||
location
|
||||
}
|
||||
update_joblines(
|
||||
where: { id: { _in: $ids } }
|
||||
_set: { status: $status, location: $location }
|
||||
) {
|
||||
affected_rows
|
||||
returning {
|
||||
id
|
||||
status
|
||||
location
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const INSERT_NEW_JOB_LINE = gql`
|
||||
mutation INSERT_NEW_JOB_LINE($lineInput: [joblines_insert_input!]!) {
|
||||
insert_joblines(objects: $lineInput) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation INSERT_NEW_JOB_LINE($lineInput: [joblines_insert_input!]!) {
|
||||
insert_joblines(objects: $lineInput) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const RECEIVE_PARTS_LINE = gql`
|
||||
mutation RECEIVE_PARTS_LINE(
|
||||
$lineId: uuid!
|
||||
$line: joblines_set_input!
|
||||
$orderLineId: uuid!
|
||||
$orderLine: parts_order_lines_set_input!
|
||||
) {
|
||||
update_joblines(where: { id: { _eq: $lineId } }, _set: $line) {
|
||||
returning {
|
||||
id
|
||||
notes
|
||||
mod_lbr_ty
|
||||
part_qty
|
||||
db_price
|
||||
act_price
|
||||
line_desc
|
||||
oem_partno
|
||||
notes
|
||||
location
|
||||
status
|
||||
removed
|
||||
}
|
||||
}
|
||||
update_parts_order_lines_by_pk(
|
||||
pk_columns: { id: $orderLineId }
|
||||
_set: $orderLine
|
||||
mutation RECEIVE_PARTS_LINE(
|
||||
$lineId: uuid!
|
||||
$line: joblines_set_input!
|
||||
$orderLineId: uuid!
|
||||
$orderLine: parts_order_lines_set_input!
|
||||
) {
|
||||
id
|
||||
line_desc
|
||||
backordered_on
|
||||
backordered_eta
|
||||
status
|
||||
update_joblines(where: { id: { _eq: $lineId } }, _set: $line) {
|
||||
returning {
|
||||
id
|
||||
notes
|
||||
mod_lbr_ty
|
||||
part_qty
|
||||
db_price
|
||||
act_price
|
||||
line_desc
|
||||
oem_partno
|
||||
notes
|
||||
location
|
||||
status
|
||||
removed
|
||||
}
|
||||
}
|
||||
update_parts_order_lines_by_pk(
|
||||
pk_columns: { id: $orderLineId }
|
||||
_set: $orderLine
|
||||
) {
|
||||
id
|
||||
line_desc
|
||||
backordered_on
|
||||
backordered_eta
|
||||
status
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_JOB_LINE_SUBLET = gql`
|
||||
mutation UPDATE_JOB_LINE_SUBLET(
|
||||
$lineId: uuid!
|
||||
$line: joblines_set_input!
|
||||
$now: timestamptz!
|
||||
$jobId: uuid!
|
||||
) {
|
||||
update_jobs_by_pk(pk_columns: { id: $jobId }, _set: { updated_at: $now }) {
|
||||
id
|
||||
updated_at
|
||||
mutation UPDATE_JOB_LINE_SUBLET(
|
||||
$lineId: uuid!
|
||||
$line: joblines_set_input!
|
||||
$now: timestamptz!
|
||||
$jobId: uuid!
|
||||
) {
|
||||
update_jobs_by_pk(pk_columns: { id: $jobId }, _set: { updated_at: $now }) {
|
||||
id
|
||||
updated_at
|
||||
}
|
||||
update_joblines(where: { id: { _eq: $lineId } }, _set: $line) {
|
||||
returning {
|
||||
id
|
||||
sublet_completed
|
||||
sublet_ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
update_joblines(where: { id: { _eq: $lineId } }, _set: $line) {
|
||||
returning {
|
||||
id
|
||||
sublet_completed
|
||||
sublet_ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_JOB_LINE = gql`
|
||||
mutation UPDATE_JOB_LINE($lineId: uuid!, $line: joblines_set_input!) {
|
||||
update_joblines(where: { id: { _eq: $lineId } }, _set: $line) {
|
||||
returning {
|
||||
id
|
||||
notes
|
||||
mod_lbr_ty
|
||||
part_qty
|
||||
db_price
|
||||
act_price
|
||||
line_desc
|
||||
line_no
|
||||
oem_partno
|
||||
notes
|
||||
location
|
||||
status
|
||||
removed
|
||||
convertedtolbr
|
||||
convertedtolbr_data
|
||||
assigned_team
|
||||
}
|
||||
mutation UPDATE_JOB_LINE($lineId: uuid!, $line: joblines_set_input!) {
|
||||
update_joblines(where: { id: { _eq: $lineId } }, _set: $line) {
|
||||
returning {
|
||||
id
|
||||
notes
|
||||
mod_lbr_ty
|
||||
part_qty
|
||||
db_price
|
||||
act_price
|
||||
line_desc
|
||||
line_no
|
||||
oem_partno
|
||||
notes
|
||||
location
|
||||
status
|
||||
removed
|
||||
convertedtolbr
|
||||
convertedtolbr_data
|
||||
assigned_team
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_JOB_LINES_TO_ENTER_BILL = gql`
|
||||
query GET_JOB_LINES_TO_ENTER_BILL($id: uuid!) {
|
||||
joblines(
|
||||
where: { jobid: { _eq: $id } }
|
||||
order_by: { act_price: desc_nulls_last }
|
||||
) {
|
||||
removed
|
||||
id
|
||||
line_desc
|
||||
part_type
|
||||
oem_partno
|
||||
alt_partno
|
||||
db_price
|
||||
act_price
|
||||
part_qty
|
||||
mod_lbr_ty
|
||||
db_hrs
|
||||
mod_lb_hrs
|
||||
lbr_op
|
||||
lbr_amt
|
||||
op_code_desc
|
||||
alt_partno
|
||||
assigned_team
|
||||
query GET_JOB_LINES_TO_ENTER_BILL($id: uuid!) {
|
||||
joblines(
|
||||
where: { jobid: { _eq: $id } }
|
||||
order_by: { act_price: desc_nulls_last }
|
||||
) {
|
||||
removed
|
||||
id
|
||||
line_desc
|
||||
part_type
|
||||
oem_partno
|
||||
alt_partno
|
||||
db_price
|
||||
act_price
|
||||
part_qty
|
||||
mod_lbr_ty
|
||||
db_hrs
|
||||
mod_lb_hrs
|
||||
lbr_op
|
||||
lbr_amt
|
||||
op_code_desc
|
||||
alt_partno
|
||||
assigned_team
|
||||
}
|
||||
jobs_by_pk(id: $id) {
|
||||
id
|
||||
status
|
||||
ious {
|
||||
id
|
||||
ro_number
|
||||
}
|
||||
v_make_desc
|
||||
}
|
||||
}
|
||||
jobs_by_pk(id: $id) {
|
||||
id
|
||||
status
|
||||
ious {
|
||||
id
|
||||
ro_number
|
||||
}
|
||||
v_make_desc
|
||||
}
|
||||
}
|
||||
`;
|
||||
// oem_partno: {
|
||||
// _neq: "";
|
||||
@@ -295,14 +295,14 @@ export const GET_JOB_LINES_TO_ENTER_BILL = gql`
|
||||
// }
|
||||
|
||||
export const generateJobLinesUpdatesForInvoicing = (joblines) => {
|
||||
const updates = joblines.reduce((acc, jl, idx) => {
|
||||
return (
|
||||
acc +
|
||||
`a${idx}:update_joblines(where: {id: {_eq: "${
|
||||
jl.id
|
||||
}"}}, _set: {profitcenter_labor: "${
|
||||
jl.profitcenter_labor || ""
|
||||
}", profitcenter_part: "${jl.profitcenter_part || ""}"}) {
|
||||
const updates = joblines.reduce((acc, jl, idx) => {
|
||||
return (
|
||||
acc +
|
||||
`a${idx}:update_joblines(where: {id: {_eq: "${
|
||||
jl.id
|
||||
}"}}, _set: {profitcenter_labor: "${
|
||||
jl.profitcenter_labor || ""
|
||||
}", profitcenter_part: "${jl.profitcenter_part || ""}"}) {
|
||||
returning {
|
||||
line_desc
|
||||
profitcenter_part
|
||||
@@ -310,62 +310,62 @@ export const generateJobLinesUpdatesForInvoicing = (joblines) => {
|
||||
id
|
||||
}
|
||||
}`
|
||||
);
|
||||
}, "");
|
||||
);
|
||||
}, "");
|
||||
|
||||
return gql`
|
||||
mutation UPDATE_JOBLINES_FOR_INVOICING{
|
||||
${updates}
|
||||
}
|
||||
`;
|
||||
return gql`
|
||||
mutation UPDATE_JOBLINES_FOR_INVOICING{
|
||||
${updates}
|
||||
}
|
||||
`;
|
||||
};
|
||||
|
||||
export const DELETE_JOB_LINE_BY_PK = gql`
|
||||
mutation DELETE_JOB_LINE_BY_PK($joblineId: uuid!) {
|
||||
update_joblines_by_pk(
|
||||
pk_columns: { id: $joblineId }
|
||||
_set: { removed: true }
|
||||
) {
|
||||
removed
|
||||
id
|
||||
mutation DELETE_JOB_LINE_BY_PK($joblineId: uuid!) {
|
||||
update_joblines_by_pk(
|
||||
pk_columns: { id: $joblineId }
|
||||
_set: { removed: true }
|
||||
) {
|
||||
removed
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_JOB_LINES_IOU = gql`
|
||||
mutation UPDATE_JOB_LINES_IOU($ids: [uuid!]!) {
|
||||
update_joblines(where: { id: { _in: $ids } }, _set: { ioucreated: true }) {
|
||||
returning {
|
||||
ioucreated
|
||||
id
|
||||
}
|
||||
mutation UPDATE_JOB_LINES_IOU($ids: [uuid!]!) {
|
||||
update_joblines(where: { id: { _in: $ids } }, _set: { ioucreated: true }) {
|
||||
returning {
|
||||
ioucreated
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_LINE_PPC = gql`
|
||||
mutation UPDATE_LINE_PPC($id: uuid!, $jobline: joblines_set_input) {
|
||||
update_joblines_by_pk(pk_columns: { id: $id }, _set: $jobline) {
|
||||
jobid
|
||||
id
|
||||
act_price_before_ppc
|
||||
act_price
|
||||
mutation UPDATE_LINE_PPC($id: uuid!, $jobline: joblines_set_input) {
|
||||
update_joblines_by_pk(pk_columns: { id: $id }, _set: $jobline) {
|
||||
jobid
|
||||
id
|
||||
act_price_before_ppc
|
||||
act_price
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_LINE_BULK_ASSIGN = gql`
|
||||
mutation UPDATE_LINE_BULK_ASSIGN(
|
||||
$ids: [uuid!]!
|
||||
$jobline: joblines_set_input
|
||||
) {
|
||||
update_joblines_many(
|
||||
updates: { _set: $jobline, where: { id: { _in: $ids } } }
|
||||
mutation UPDATE_LINE_BULK_ASSIGN(
|
||||
$ids: [uuid!]!
|
||||
$jobline: joblines_set_input
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
assigned_team
|
||||
}
|
||||
update_joblines_many(
|
||||
updates: { _set: $jobline, where: { id: { _in: $ids } } }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
assigned_team
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const MARK_MESSAGES_AS_READ_BY_CONVERSATION = gql`
|
||||
mutation MARK_MESSAGES_AS_READ_BY_CONVERSATION($conversationId: uuid) {
|
||||
update_messages(
|
||||
where: { conversationid: { _eq: $conversationId } }
|
||||
_set: { read: true }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
read
|
||||
isoutbound
|
||||
}
|
||||
mutation MARK_MESSAGES_AS_READ_BY_CONVERSATION($conversationId: uuid) {
|
||||
update_messages(
|
||||
where: { conversationid: { _eq: $conversationId } }
|
||||
_set: { read: true }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
read
|
||||
isoutbound
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const GET_LANDING_NAV_ITEMS = gql`
|
||||
query nav_items {
|
||||
masterdata_by_pk(key: "LANDING_NAV_ITEMS") {
|
||||
value
|
||||
query nav_items {
|
||||
masterdata_by_pk(key: "LANDING_NAV_ITEMS") {
|
||||
value
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const GET_NAV_ITEMS = gql`
|
||||
query nav_items {
|
||||
masterdata_by_pk(key: "NAV_ITEMS") {
|
||||
value
|
||||
query nav_items {
|
||||
masterdata_by_pk(key: "NAV_ITEMS") {
|
||||
value
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_SELECTED_NAV_ITEM = gql`
|
||||
query selected_nav_item {
|
||||
selectedNavItem @client
|
||||
}
|
||||
query selected_nav_item {
|
||||
selectedNavItem @client
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,79 +1,79 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const INSERT_NEW_NOTE = gql`
|
||||
mutation INSERT_NEW_NOTE($noteInput: [notes_insert_input!]!) {
|
||||
insert_notes(objects: $noteInput) {
|
||||
returning {
|
||||
created_at
|
||||
created_by
|
||||
critical
|
||||
id
|
||||
jobid
|
||||
private
|
||||
text
|
||||
updated_at
|
||||
audit
|
||||
type
|
||||
}
|
||||
mutation INSERT_NEW_NOTE($noteInput: [notes_insert_input!]!) {
|
||||
insert_notes(objects: $noteInput) {
|
||||
returning {
|
||||
created_at
|
||||
created_by
|
||||
critical
|
||||
id
|
||||
jobid
|
||||
private
|
||||
text
|
||||
updated_at
|
||||
audit
|
||||
type
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_NOTES_BY_JOB_PK = gql`
|
||||
query QUERY_NOTES_BY_JOB_PK($id: uuid!) {
|
||||
jobs_by_pk(id: $id) {
|
||||
id
|
||||
ro_number
|
||||
vehicle {
|
||||
jobs {
|
||||
id
|
||||
ro_number
|
||||
status
|
||||
clm_no
|
||||
query QUERY_NOTES_BY_JOB_PK($id: uuid!) {
|
||||
jobs_by_pk(id: $id) {
|
||||
id
|
||||
ro_number
|
||||
vehicle {
|
||||
jobs {
|
||||
id
|
||||
ro_number
|
||||
status
|
||||
clm_no
|
||||
}
|
||||
}
|
||||
notes {
|
||||
created_at
|
||||
created_by
|
||||
critical
|
||||
id
|
||||
jobid
|
||||
private
|
||||
text
|
||||
updated_at
|
||||
audit
|
||||
type
|
||||
}
|
||||
}
|
||||
}
|
||||
notes {
|
||||
created_at
|
||||
created_by
|
||||
critical
|
||||
id
|
||||
jobid
|
||||
private
|
||||
text
|
||||
updated_at
|
||||
audit
|
||||
type
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_NOTE = gql`
|
||||
mutation UPDATE_NOTE($noteId: uuid!, $note: notes_set_input!) {
|
||||
update_notes(where: { id: { _eq: $noteId } }, _set: $note) {
|
||||
returning {
|
||||
id
|
||||
created_at
|
||||
created_by
|
||||
critical
|
||||
id
|
||||
jobid
|
||||
private
|
||||
text
|
||||
updated_at
|
||||
audit
|
||||
type
|
||||
}
|
||||
mutation UPDATE_NOTE($noteId: uuid!, $note: notes_set_input!) {
|
||||
update_notes(where: { id: { _eq: $noteId } }, _set: $note) {
|
||||
returning {
|
||||
id
|
||||
created_at
|
||||
created_by
|
||||
critical
|
||||
id
|
||||
jobid
|
||||
private
|
||||
text
|
||||
updated_at
|
||||
audit
|
||||
type
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_NOTE = gql`
|
||||
mutation DELETE_NOTE($noteId: uuid!) {
|
||||
delete_notes(where: { id: { _eq: $noteId } }) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation DELETE_NOTE($noteId: uuid!) {
|
||||
delete_notes(where: { id: { _eq: $noteId } }) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,189 +1,189 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const QUERY_SEARCH_OWNER_BY_IDX = gql`
|
||||
query QUERY_SEARCH_OWNER_BY_IDX($search: String!) {
|
||||
search_owners(args: { search: $search }, limit: 100) {
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
ownr_ph1
|
||||
ownr_ph2
|
||||
ownr_addr1
|
||||
ownr_addr2
|
||||
ownr_city
|
||||
ownr_ctry
|
||||
ownr_ea
|
||||
ownr_st
|
||||
ownr_zip
|
||||
id
|
||||
note
|
||||
query QUERY_SEARCH_OWNER_BY_IDX($search: String!) {
|
||||
search_owners(args: { search: $search }, limit: 100) {
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
ownr_ph1
|
||||
ownr_ph2
|
||||
ownr_addr1
|
||||
ownr_addr2
|
||||
ownr_city
|
||||
ownr_ctry
|
||||
ownr_ea
|
||||
ownr_st
|
||||
ownr_zip
|
||||
id
|
||||
note
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const SEARCH_OWNERS_BY_ID_FOR_AUTOCOMPLETE = gql`
|
||||
query SEARCH_OWNERS_BY_ID_FOR_AUTOCOMPLETE($id: uuid!) {
|
||||
owners_by_pk(id: $id) {
|
||||
id
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
ownr_addr1
|
||||
query SEARCH_OWNERS_BY_ID_FOR_AUTOCOMPLETE($id: uuid!) {
|
||||
owners_by_pk(id: $id) {
|
||||
id
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
ownr_addr1
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const SEARCH_OWNERS_FOR_AUTOCOMPLETE = gql`
|
||||
query SEARCH_OWNERS_FOR_AUTOCOMPLETE($search: String) {
|
||||
search_owners(
|
||||
args: { search: $search }
|
||||
limit: 25
|
||||
order_by: { ownr_ln: desc_nulls_last }
|
||||
) {
|
||||
id
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
ownr_addr1
|
||||
query SEARCH_OWNERS_FOR_AUTOCOMPLETE($search: String) {
|
||||
search_owners(
|
||||
args: { search: $search }
|
||||
limit: 25
|
||||
order_by: { ownr_ln: desc_nulls_last }
|
||||
) {
|
||||
id
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
ownr_addr1
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_OWNER_BY_ID = gql`
|
||||
query QUERY_OWNER_BY_ID($id: uuid!) {
|
||||
owners_by_pk(id: $id) {
|
||||
id
|
||||
allow_text_message
|
||||
ownr_addr1
|
||||
ownr_addr2
|
||||
ownr_co_nm
|
||||
ownr_city
|
||||
ownr_ctry
|
||||
ownr_ea
|
||||
ownr_fn
|
||||
ownr_ph1
|
||||
ownr_ln
|
||||
ownr_ph2
|
||||
ownr_st
|
||||
ownr_title
|
||||
ownr_zip
|
||||
preferred_contact
|
||||
note
|
||||
tax_number
|
||||
jobs(order_by: { date_open: desc }) {
|
||||
id
|
||||
ro_number
|
||||
clm_no
|
||||
status
|
||||
clm_total
|
||||
v_model_yr
|
||||
v_model_desc
|
||||
v_make_desc
|
||||
vehicleid
|
||||
}
|
||||
query QUERY_OWNER_BY_ID($id: uuid!) {
|
||||
owners_by_pk(id: $id) {
|
||||
id
|
||||
allow_text_message
|
||||
ownr_addr1
|
||||
ownr_addr2
|
||||
ownr_co_nm
|
||||
ownr_city
|
||||
ownr_ctry
|
||||
ownr_ea
|
||||
ownr_fn
|
||||
ownr_ph1
|
||||
ownr_ln
|
||||
ownr_ph2
|
||||
ownr_st
|
||||
ownr_title
|
||||
ownr_zip
|
||||
preferred_contact
|
||||
note
|
||||
tax_number
|
||||
jobs(order_by: { date_open: desc }) {
|
||||
id
|
||||
ro_number
|
||||
clm_no
|
||||
status
|
||||
clm_total
|
||||
v_model_yr
|
||||
v_model_desc
|
||||
v_make_desc
|
||||
vehicleid
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_OWNER = gql`
|
||||
mutation UPDATE_OWNER($ownerId: uuid!, $owner: owners_set_input!) {
|
||||
update_owners(where: { id: { _eq: $ownerId } }, _set: $owner) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation UPDATE_OWNER($ownerId: uuid!, $owner: owners_set_input!) {
|
||||
update_owners(where: { id: { _eq: $ownerId } }, _set: $owner) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_OWNER = gql`
|
||||
mutation DELETE_OWNER($id: uuid!) {
|
||||
delete_owners_by_pk(id: $id) {
|
||||
id
|
||||
mutation DELETE_OWNER($id: uuid!) {
|
||||
delete_owners_by_pk(id: $id) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_ALL_OWNERS = gql`
|
||||
query QUERY_ALL_OWNERS {
|
||||
owners {
|
||||
id
|
||||
allow_text_message
|
||||
created_at
|
||||
ownr_addr1
|
||||
ownr_addr2
|
||||
ownr_co_nm
|
||||
ownr_city
|
||||
ownr_ctry
|
||||
ownr_ea
|
||||
ownr_fn
|
||||
ownr_ph1
|
||||
ownr_ln
|
||||
ownr_ph2
|
||||
ownr_st
|
||||
ownr_title
|
||||
ownr_zip
|
||||
preferred_contact
|
||||
updated_at
|
||||
query QUERY_ALL_OWNERS {
|
||||
owners {
|
||||
id
|
||||
allow_text_message
|
||||
created_at
|
||||
ownr_addr1
|
||||
ownr_addr2
|
||||
ownr_co_nm
|
||||
ownr_city
|
||||
ownr_ctry
|
||||
ownr_ea
|
||||
ownr_fn
|
||||
ownr_ph1
|
||||
ownr_ln
|
||||
ownr_ph2
|
||||
ownr_st
|
||||
ownr_title
|
||||
ownr_zip
|
||||
preferred_contact
|
||||
updated_at
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_ALL_OWNERS_PAGINATED = gql`
|
||||
query QUERY_ALL_OWNERS_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [owners_order_by!]!
|
||||
) {
|
||||
search_owners(
|
||||
args: { search: $search }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
query QUERY_ALL_OWNERS_PAGINATED(
|
||||
$search: String
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [owners_order_by!]!
|
||||
) {
|
||||
id
|
||||
allow_text_message
|
||||
created_at
|
||||
ownr_addr1
|
||||
ownr_addr2
|
||||
ownr_co_nm
|
||||
ownr_city
|
||||
ownr_ctry
|
||||
ownr_ea
|
||||
ownr_fn
|
||||
ownr_ph1
|
||||
ownr_ln
|
||||
ownr_ph2
|
||||
ownr_st
|
||||
ownr_title
|
||||
ownr_zip
|
||||
preferred_contact
|
||||
updated_at
|
||||
search_owners(
|
||||
args: { search: $search }
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
order_by: $order
|
||||
) {
|
||||
id
|
||||
allow_text_message
|
||||
created_at
|
||||
ownr_addr1
|
||||
ownr_addr2
|
||||
ownr_co_nm
|
||||
ownr_city
|
||||
ownr_ctry
|
||||
ownr_ea
|
||||
ownr_fn
|
||||
ownr_ph1
|
||||
ownr_ln
|
||||
ownr_ph2
|
||||
ownr_st
|
||||
ownr_title
|
||||
ownr_zip
|
||||
preferred_contact
|
||||
updated_at
|
||||
}
|
||||
search_owners_aggregate(args: { search: $search }) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
search_owners_aggregate(args: { search: $search }) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_OWNER_FOR_JOB_CREATION = gql`
|
||||
query QUERY_OWNER_FOR_JOB_CREATION($id: uuid!) {
|
||||
owners_by_pk(id: $id) {
|
||||
id
|
||||
ownr_addr1
|
||||
ownr_addr2
|
||||
ownr_co_nm
|
||||
ownr_city
|
||||
ownr_ctry
|
||||
ownr_ea
|
||||
ownr_fn
|
||||
ownr_ph1
|
||||
ownr_ln
|
||||
ownr_ph2
|
||||
ownr_st
|
||||
ownr_title
|
||||
ownr_zip
|
||||
query QUERY_OWNER_FOR_JOB_CREATION($id: uuid!) {
|
||||
owners_by_pk(id: $id) {
|
||||
id
|
||||
ownr_addr1
|
||||
ownr_addr2
|
||||
ownr_co_nm
|
||||
ownr_city
|
||||
ownr_ctry
|
||||
ownr_ea
|
||||
ownr_fn
|
||||
ownr_ph1
|
||||
ownr_ln
|
||||
ownr_ph2
|
||||
ownr_st
|
||||
ownr_title
|
||||
ownr_zip
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,79 +1,79 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const INSERT_PARTS_DISPATCH = gql`
|
||||
mutation INSERT_PARTS_DISPATCH($partsDispatch: parts_dispatch_insert_input!) {
|
||||
insert_parts_dispatch_one(object: $partsDispatch) {
|
||||
id
|
||||
jobid
|
||||
number
|
||||
employeeid
|
||||
parts_dispatch_lines {
|
||||
id
|
||||
joblineid
|
||||
quantity
|
||||
}
|
||||
mutation INSERT_PARTS_DISPATCH($partsDispatch: parts_dispatch_insert_input!) {
|
||||
insert_parts_dispatch_one(object: $partsDispatch) {
|
||||
id
|
||||
jobid
|
||||
number
|
||||
employeeid
|
||||
parts_dispatch_lines {
|
||||
id
|
||||
joblineid
|
||||
quantity
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_UNACCEPTED_PARTS_DISPATCH = gql`
|
||||
query GET_UNACCEPTED_PARTS_DISPATCH(
|
||||
$techId: uuid!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) {
|
||||
parts_dispatch_aggregate(
|
||||
where: {
|
||||
employeeid: { _eq: $techId }
|
||||
parts_dispatch_lines: { accepted_at: { _is_null: true } }
|
||||
}
|
||||
query GET_UNACCEPTED_PARTS_DISPATCH(
|
||||
$techId: uuid!
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
parts_dispatch(
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
where: {
|
||||
employeeid: { _eq: $techId }
|
||||
parts_dispatch_lines: { accepted_at: { _is_null: true } }
|
||||
}
|
||||
) {
|
||||
id
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
status
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
v_model_yr
|
||||
v_color
|
||||
}
|
||||
dispatched_at
|
||||
dispatched_by
|
||||
parts_dispatch_lines {
|
||||
id
|
||||
accepted_at
|
||||
jobline {
|
||||
line_desc
|
||||
id
|
||||
parts_dispatch_aggregate(
|
||||
where: {
|
||||
employeeid: { _eq: $techId }
|
||||
parts_dispatch_lines: { accepted_at: { _is_null: true } }
|
||||
}
|
||||
) {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
parts_dispatch(
|
||||
offset: $offset
|
||||
limit: $limit
|
||||
where: {
|
||||
employeeid: { _eq: $techId }
|
||||
parts_dispatch_lines: { accepted_at: { _is_null: true } }
|
||||
}
|
||||
) {
|
||||
id
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
status
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
v_model_yr
|
||||
v_color
|
||||
}
|
||||
dispatched_at
|
||||
dispatched_by
|
||||
parts_dispatch_lines {
|
||||
id
|
||||
accepted_at
|
||||
jobline {
|
||||
line_desc
|
||||
id
|
||||
}
|
||||
quantity
|
||||
joblineid
|
||||
}
|
||||
}
|
||||
quantity
|
||||
joblineid
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_PARTS_DISPATCH_LINE = gql`
|
||||
mutation UPDATE_PARTS_DISPATCH_LINE(
|
||||
$id: uuid!
|
||||
$line: parts_dispatch_lines_set_input!
|
||||
) {
|
||||
update_parts_dispatch_lines_by_pk(pk_columns: { id: $id }, _set: $line) {
|
||||
accepted_at
|
||||
id
|
||||
mutation UPDATE_PARTS_DISPATCH_LINE(
|
||||
$id: uuid!
|
||||
$line: parts_dispatch_lines_set_input!
|
||||
) {
|
||||
update_parts_dispatch_lines_by_pk(pk_columns: { id: $id }, _set: $line) {
|
||||
accepted_at
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,398 +1,398 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const INSERT_NEW_PARTS_ORDERS = gql`
|
||||
mutation INSERT_NEW_PARTS_ORDERS($po: [parts_orders_insert_input!]!) {
|
||||
insert_parts_orders(objects: $po) {
|
||||
returning {
|
||||
id
|
||||
order_number
|
||||
}
|
||||
mutation INSERT_NEW_PARTS_ORDERS($po: [parts_orders_insert_input!]!) {
|
||||
insert_parts_orders(objects: $po) {
|
||||
returning {
|
||||
id
|
||||
order_number
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_PARTS_ORDER_OEC = gql`
|
||||
query QUERY_PARTS_ORDER_OEC($id: uuid!) {
|
||||
parts_orders_by_pk(id: $id) {
|
||||
parts_order_lines {
|
||||
jobline {
|
||||
tran_code
|
||||
act_price
|
||||
db_ref
|
||||
db_price
|
||||
db_hrs
|
||||
glass_flag
|
||||
id
|
||||
lbr_amt
|
||||
lbr_hrs_j
|
||||
lbr_inc
|
||||
lbr_op
|
||||
lbr_op_j
|
||||
lbr_tax
|
||||
lbr_typ_j
|
||||
line_desc
|
||||
line_ind
|
||||
line_no
|
||||
line_ref
|
||||
location
|
||||
misc_amt
|
||||
misc_sublt
|
||||
misc_tax
|
||||
mod_lb_hrs
|
||||
mod_lbr_ty
|
||||
oem_partno
|
||||
op_code_desc
|
||||
paint_stg
|
||||
paint_tone
|
||||
part_qty
|
||||
part_type
|
||||
price_inc
|
||||
price_j
|
||||
prt_dsmk_m
|
||||
prt_dsmk_p
|
||||
tax_part
|
||||
unq_seq
|
||||
alt_co_id
|
||||
alt_overrd
|
||||
alt_part_i
|
||||
alt_partm
|
||||
alt_partno
|
||||
bett_amt
|
||||
bett_pctg
|
||||
bett_tax
|
||||
bett_type
|
||||
cert_part
|
||||
est_seq
|
||||
query QUERY_PARTS_ORDER_OEC($id: uuid!) {
|
||||
parts_orders_by_pk(id: $id) {
|
||||
parts_order_lines {
|
||||
jobline {
|
||||
tran_code
|
||||
act_price
|
||||
db_ref
|
||||
db_price
|
||||
db_hrs
|
||||
glass_flag
|
||||
id
|
||||
lbr_amt
|
||||
lbr_hrs_j
|
||||
lbr_inc
|
||||
lbr_op
|
||||
lbr_op_j
|
||||
lbr_tax
|
||||
lbr_typ_j
|
||||
line_desc
|
||||
line_ind
|
||||
line_no
|
||||
line_ref
|
||||
location
|
||||
misc_amt
|
||||
misc_sublt
|
||||
misc_tax
|
||||
mod_lb_hrs
|
||||
mod_lbr_ty
|
||||
oem_partno
|
||||
op_code_desc
|
||||
paint_stg
|
||||
paint_tone
|
||||
part_qty
|
||||
part_type
|
||||
price_inc
|
||||
price_j
|
||||
prt_dsmk_m
|
||||
prt_dsmk_p
|
||||
tax_part
|
||||
unq_seq
|
||||
alt_co_id
|
||||
alt_overrd
|
||||
alt_part_i
|
||||
alt_partm
|
||||
alt_partno
|
||||
bett_amt
|
||||
bett_pctg
|
||||
bett_tax
|
||||
bett_type
|
||||
cert_part
|
||||
est_seq
|
||||
}
|
||||
act_price
|
||||
id
|
||||
db_price
|
||||
line_desc
|
||||
quantity
|
||||
part_type
|
||||
}
|
||||
job {
|
||||
bodyshop {
|
||||
shopname
|
||||
bill_tax_rates
|
||||
}
|
||||
ro_number
|
||||
clm_no
|
||||
asgn_no
|
||||
asgn_date
|
||||
state_tax_rate
|
||||
area_of_damage
|
||||
asgn_no
|
||||
asgn_type
|
||||
ciecaid
|
||||
clm_addr1
|
||||
clm_city
|
||||
clm_addr2
|
||||
clm_ct_fn
|
||||
clm_ct_ln
|
||||
clm_ct_ph
|
||||
clm_ct_phx
|
||||
clm_ctry
|
||||
clm_ea
|
||||
clm_fax
|
||||
clm_faxx
|
||||
clm_ofc_id
|
||||
clm_ofc_nm
|
||||
clm_ph1
|
||||
clm_ph1x
|
||||
clm_ph2
|
||||
clm_ph2x
|
||||
clm_st
|
||||
clm_title
|
||||
clm_total
|
||||
clm_zip
|
||||
ded_amt
|
||||
est_addr1
|
||||
est_addr2
|
||||
est_city
|
||||
est_co_nm
|
||||
est_ct_fn
|
||||
est_ctry
|
||||
est_ct_ln
|
||||
est_ea
|
||||
est_ph1
|
||||
est_st
|
||||
est_zip
|
||||
g_bett_amt
|
||||
id
|
||||
ins_addr1
|
||||
ins_city
|
||||
ins_addr2
|
||||
ins_co_id
|
||||
ins_co_nm
|
||||
ins_ct_fn
|
||||
ins_ct_ln
|
||||
ins_ct_ph
|
||||
ins_ct_phx
|
||||
ins_ctry
|
||||
ins_ea
|
||||
ins_fax
|
||||
ins_faxx
|
||||
ins_memo
|
||||
ins_ph1
|
||||
ins_ph1x
|
||||
ins_ph2
|
||||
ins_ph2x
|
||||
ins_st
|
||||
ins_title
|
||||
ins_zip
|
||||
insd_addr1
|
||||
insd_addr2
|
||||
insd_city
|
||||
insd_co_nm
|
||||
insd_ctry
|
||||
insd_ea
|
||||
insd_fax
|
||||
insd_faxx
|
||||
insd_fn
|
||||
insd_ln
|
||||
insd_ph1
|
||||
insd_ph1x
|
||||
insd_ph2
|
||||
insd_ph2x
|
||||
insd_st
|
||||
insd_title
|
||||
insd_zip
|
||||
job_totals
|
||||
loss_cat
|
||||
loss_date
|
||||
loss_desc
|
||||
loss_of_use
|
||||
loss_type
|
||||
ownr_addr1
|
||||
ownr_addr2
|
||||
ownr_city
|
||||
ownr_co_nm
|
||||
ownr_ctry
|
||||
ownr_ea
|
||||
ownr_fax
|
||||
ownr_faxx
|
||||
ownr_ph1
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_ph1x
|
||||
ownr_ph2
|
||||
ownr_ph2x
|
||||
ownr_st
|
||||
ownr_title
|
||||
ownr_zip
|
||||
parts_tax_rates
|
||||
pay_amt
|
||||
pay_date
|
||||
pay_type
|
||||
pay_chknm
|
||||
payee_nms
|
||||
plate_no
|
||||
plate_st
|
||||
po_number
|
||||
policy_no
|
||||
tax_lbr_rt
|
||||
tax_levies_rt
|
||||
tax_paint_mat_rt
|
||||
tax_predis
|
||||
tax_prethr
|
||||
tax_pstthr
|
||||
tax_registration_number
|
||||
tax_str_rt
|
||||
tax_shop_mat_rt
|
||||
tax_sub_rt
|
||||
tax_thramt
|
||||
tax_tow_rt
|
||||
theft_ind
|
||||
tlos_ind
|
||||
towin
|
||||
v_color
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
v_model_yr
|
||||
v_vin
|
||||
vehicle {
|
||||
v_bstyle
|
||||
v_type
|
||||
v_trimcode
|
||||
v_tone
|
||||
v_stage
|
||||
v_prod_dt
|
||||
v_options
|
||||
v_paint_codes
|
||||
v_model_yr
|
||||
v_model_desc
|
||||
v_mldgcode
|
||||
v_makecode
|
||||
v_make_desc
|
||||
v_engine
|
||||
v_cond
|
||||
v_color
|
||||
trim_color
|
||||
shopid
|
||||
plate_no
|
||||
plate_st
|
||||
db_v_code
|
||||
v_vin
|
||||
}
|
||||
agt_zip
|
||||
agt_st
|
||||
agt_ph2x
|
||||
agt_ph2
|
||||
agt_ph1x
|
||||
agt_ph1
|
||||
agt_lic_no
|
||||
agt_faxx
|
||||
agt_fax
|
||||
agt_ea
|
||||
agt_ctry
|
||||
agt_ct_phx
|
||||
agt_ct_ph
|
||||
agt_ct_ln
|
||||
agt_ct_fn
|
||||
agt_co_nm
|
||||
agt_co_id
|
||||
agt_city
|
||||
agt_addr1
|
||||
agt_addr2
|
||||
adj_g_disc
|
||||
rate_matd
|
||||
rate_mash
|
||||
rate_mapa
|
||||
rate_mahw
|
||||
rate_macs
|
||||
rate_mabl
|
||||
rate_ma3s
|
||||
rate_ma2t
|
||||
rate_ma2s
|
||||
rate_lau
|
||||
rate_las
|
||||
rate_lar
|
||||
rate_lam
|
||||
rate_lag
|
||||
rate_laf
|
||||
rate_lae
|
||||
rate_lad
|
||||
rate_lab
|
||||
rate_laa
|
||||
rate_la4
|
||||
rate_la3
|
||||
rate_la2
|
||||
rate_la1
|
||||
}
|
||||
}
|
||||
act_price
|
||||
id
|
||||
db_price
|
||||
line_desc
|
||||
quantity
|
||||
part_type
|
||||
}
|
||||
job {
|
||||
bodyshop {
|
||||
shopname
|
||||
bill_tax_rates
|
||||
}
|
||||
ro_number
|
||||
clm_no
|
||||
asgn_no
|
||||
asgn_date
|
||||
state_tax_rate
|
||||
area_of_damage
|
||||
asgn_no
|
||||
asgn_type
|
||||
ciecaid
|
||||
clm_addr1
|
||||
clm_city
|
||||
clm_addr2
|
||||
clm_ct_fn
|
||||
clm_ct_ln
|
||||
clm_ct_ph
|
||||
clm_ct_phx
|
||||
clm_ctry
|
||||
clm_ea
|
||||
clm_fax
|
||||
clm_faxx
|
||||
clm_ofc_id
|
||||
clm_ofc_nm
|
||||
clm_ph1
|
||||
clm_ph1x
|
||||
clm_ph2
|
||||
clm_ph2x
|
||||
clm_st
|
||||
clm_title
|
||||
clm_total
|
||||
clm_zip
|
||||
ded_amt
|
||||
est_addr1
|
||||
est_addr2
|
||||
est_city
|
||||
est_co_nm
|
||||
est_ct_fn
|
||||
est_ctry
|
||||
est_ct_ln
|
||||
est_ea
|
||||
est_ph1
|
||||
est_st
|
||||
est_zip
|
||||
g_bett_amt
|
||||
id
|
||||
ins_addr1
|
||||
ins_city
|
||||
ins_addr2
|
||||
ins_co_id
|
||||
ins_co_nm
|
||||
ins_ct_fn
|
||||
ins_ct_ln
|
||||
ins_ct_ph
|
||||
ins_ct_phx
|
||||
ins_ctry
|
||||
ins_ea
|
||||
ins_fax
|
||||
ins_faxx
|
||||
ins_memo
|
||||
ins_ph1
|
||||
ins_ph1x
|
||||
ins_ph2
|
||||
ins_ph2x
|
||||
ins_st
|
||||
ins_title
|
||||
ins_zip
|
||||
insd_addr1
|
||||
insd_addr2
|
||||
insd_city
|
||||
insd_co_nm
|
||||
insd_ctry
|
||||
insd_ea
|
||||
insd_fax
|
||||
insd_faxx
|
||||
insd_fn
|
||||
insd_ln
|
||||
insd_ph1
|
||||
insd_ph1x
|
||||
insd_ph2
|
||||
insd_ph2x
|
||||
insd_st
|
||||
insd_title
|
||||
insd_zip
|
||||
job_totals
|
||||
loss_cat
|
||||
loss_date
|
||||
loss_desc
|
||||
loss_of_use
|
||||
loss_type
|
||||
ownr_addr1
|
||||
ownr_addr2
|
||||
ownr_city
|
||||
ownr_co_nm
|
||||
ownr_ctry
|
||||
ownr_ea
|
||||
ownr_fax
|
||||
ownr_faxx
|
||||
ownr_ph1
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_ph1x
|
||||
ownr_ph2
|
||||
ownr_ph2x
|
||||
ownr_st
|
||||
ownr_title
|
||||
ownr_zip
|
||||
parts_tax_rates
|
||||
pay_amt
|
||||
pay_date
|
||||
pay_type
|
||||
pay_chknm
|
||||
payee_nms
|
||||
plate_no
|
||||
plate_st
|
||||
po_number
|
||||
policy_no
|
||||
tax_lbr_rt
|
||||
tax_levies_rt
|
||||
tax_paint_mat_rt
|
||||
tax_predis
|
||||
tax_prethr
|
||||
tax_pstthr
|
||||
tax_registration_number
|
||||
tax_str_rt
|
||||
tax_shop_mat_rt
|
||||
tax_sub_rt
|
||||
tax_thramt
|
||||
tax_tow_rt
|
||||
theft_ind
|
||||
tlos_ind
|
||||
towin
|
||||
v_color
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
v_model_yr
|
||||
v_vin
|
||||
vehicle {
|
||||
v_bstyle
|
||||
v_type
|
||||
v_trimcode
|
||||
v_tone
|
||||
v_stage
|
||||
v_prod_dt
|
||||
v_options
|
||||
v_paint_codes
|
||||
v_model_yr
|
||||
v_model_desc
|
||||
v_mldgcode
|
||||
v_makecode
|
||||
v_make_desc
|
||||
v_engine
|
||||
v_cond
|
||||
v_color
|
||||
trim_color
|
||||
shopid
|
||||
plate_no
|
||||
plate_st
|
||||
db_v_code
|
||||
v_vin
|
||||
}
|
||||
agt_zip
|
||||
agt_st
|
||||
agt_ph2x
|
||||
agt_ph2
|
||||
agt_ph1x
|
||||
agt_ph1
|
||||
agt_lic_no
|
||||
agt_faxx
|
||||
agt_fax
|
||||
agt_ea
|
||||
agt_ctry
|
||||
agt_ct_phx
|
||||
agt_ct_ph
|
||||
agt_ct_ln
|
||||
agt_ct_fn
|
||||
agt_co_nm
|
||||
agt_co_id
|
||||
agt_city
|
||||
agt_addr1
|
||||
agt_addr2
|
||||
adj_g_disc
|
||||
rate_matd
|
||||
rate_mash
|
||||
rate_mapa
|
||||
rate_mahw
|
||||
rate_macs
|
||||
rate_mabl
|
||||
rate_ma3s
|
||||
rate_ma2t
|
||||
rate_ma2s
|
||||
rate_lau
|
||||
rate_las
|
||||
rate_lar
|
||||
rate_lam
|
||||
rate_lag
|
||||
rate_laf
|
||||
rate_lae
|
||||
rate_lad
|
||||
rate_lab
|
||||
rate_laa
|
||||
rate_la4
|
||||
rate_la3
|
||||
rate_la2
|
||||
rate_la1
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_PARTS_ORDER = gql`
|
||||
mutation DELETE_PARTS_ORDER($partsOrderId: uuid!) {
|
||||
delete_parts_orders_by_pk(id: $partsOrderId) {
|
||||
id
|
||||
mutation DELETE_PARTS_ORDER($partsOrderId: uuid!) {
|
||||
delete_parts_orders_by_pk(id: $partsOrderId) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const DELETE_PARTS_ORDER_LINE = gql`
|
||||
mutation DELETE_PARTS_ORDER_LINE($partsOrderLineId: uuid!) {
|
||||
delete_parts_order_lines_by_pk(id: $partsOrderLineId) {
|
||||
id
|
||||
mutation DELETE_PARTS_ORDER_LINE($partsOrderLineId: uuid!) {
|
||||
delete_parts_order_lines_by_pk(id: $partsOrderLineId) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const MUTATION_UPDATE_PO_CM_REECEIVED = gql`
|
||||
mutation MUTATION_UPDATE_PO_CM_REECEIVED(
|
||||
$partsLineId: uuid!
|
||||
$partsOrder: parts_order_lines_set_input
|
||||
) {
|
||||
update_parts_order_lines(
|
||||
where: { id: { _eq: $partsLineId } }
|
||||
_set: $partsOrder
|
||||
mutation MUTATION_UPDATE_PO_CM_REECEIVED(
|
||||
$partsLineId: uuid!
|
||||
$partsOrder: parts_order_lines_set_input
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
cm_received
|
||||
}
|
||||
update_parts_order_lines(
|
||||
where: { id: { _eq: $partsLineId } }
|
||||
_set: $partsOrder
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
cm_received
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export const MUTATION_UPDATE_BO_ETA = gql`
|
||||
mutation MUTATION_UPDATE_BO_ETA(
|
||||
$partsLineId: uuid!
|
||||
$partsOrder: parts_order_lines_set_input
|
||||
) {
|
||||
update_parts_order_lines(
|
||||
where: { id: { _eq: $partsLineId } }
|
||||
_set: $partsOrder
|
||||
mutation MUTATION_UPDATE_BO_ETA(
|
||||
$partsLineId: uuid!
|
||||
$partsOrder: parts_order_lines_set_input
|
||||
) {
|
||||
returning {
|
||||
status
|
||||
backordered_eta
|
||||
id
|
||||
}
|
||||
update_parts_order_lines(
|
||||
where: { id: { _eq: $partsLineId } }
|
||||
_set: $partsOrder
|
||||
) {
|
||||
returning {
|
||||
status
|
||||
backordered_eta
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const MUTATION_BACKORDER_PART_LINE = gql`
|
||||
mutation MUTATION_BACKORDER_PART_LINE(
|
||||
$jobLineId: uuid!
|
||||
$partsLineId: uuid!
|
||||
$status: String!
|
||||
$partsOrder: parts_order_lines_set_input
|
||||
) {
|
||||
update_parts_order_lines(
|
||||
where: { id: { _eq: $partsLineId } }
|
||||
_set: $partsOrder
|
||||
mutation MUTATION_BACKORDER_PART_LINE(
|
||||
$jobLineId: uuid!
|
||||
$partsLineId: uuid!
|
||||
$status: String!
|
||||
$partsOrder: parts_order_lines_set_input
|
||||
) {
|
||||
returning {
|
||||
status
|
||||
backordered_on
|
||||
backordered_eta
|
||||
id
|
||||
}
|
||||
update_parts_order_lines(
|
||||
where: { id: { _eq: $partsLineId } }
|
||||
_set: $partsOrder
|
||||
) {
|
||||
returning {
|
||||
status
|
||||
backordered_on
|
||||
backordered_eta
|
||||
id
|
||||
}
|
||||
}
|
||||
update_joblines(
|
||||
where: { id: { _eq: $jobLineId } }
|
||||
_set: { status: $status }
|
||||
) {
|
||||
returning {
|
||||
status
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
update_joblines(
|
||||
where: { id: { _eq: $jobLineId } }
|
||||
_set: { status: $status }
|
||||
) {
|
||||
returning {
|
||||
status
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_UNRECEIVED_LINES = gql`
|
||||
query QUERY_UNRECEIVED_LINES($jobId: uuid!, $vendorId: uuid!) {
|
||||
parts_order_lines(
|
||||
where: {
|
||||
parts_order: { jobid: { _eq: $jobId }, vendorid: { _eq: $vendorId } }
|
||||
cm_received: { _neq: true }
|
||||
}
|
||||
) {
|
||||
cm_received
|
||||
id
|
||||
line_desc
|
||||
quantity
|
||||
act_price
|
||||
cost
|
||||
oem_partno
|
||||
query QUERY_UNRECEIVED_LINES($jobId: uuid!, $vendorId: uuid!) {
|
||||
parts_order_lines(
|
||||
where: {
|
||||
parts_order: { jobid: { _eq: $jobId }, vendorid: { _eq: $vendorId } }
|
||||
cm_received: { _neq: true }
|
||||
}
|
||||
) {
|
||||
cm_received
|
||||
id
|
||||
line_desc
|
||||
quantity
|
||||
act_price
|
||||
cost
|
||||
oem_partno
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const MUTATION_MARK_RETURN_RECEIVED = gql`
|
||||
mutation MUTATION_MARK_RETURN_RECEIVED($partsLineIds: [uuid!]!) {
|
||||
update_parts_order_lines(
|
||||
where: { id: { _in: $partsLineIds } }
|
||||
_set: { cm_received: true }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
cm_received
|
||||
}
|
||||
mutation MUTATION_MARK_RETURN_RECEIVED($partsLineIds: [uuid!]!) {
|
||||
update_parts_order_lines(
|
||||
where: { id: { _in: $partsLineIds } }
|
||||
_set: { cm_received: true }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
cm_received
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const INSERT_PAYMENT_RESPONSE = gql`
|
||||
mutation INSERT_PAYMENT_RESPONSE(
|
||||
$paymentResponse: [payment_response_insert_input!]!
|
||||
) {
|
||||
insert_payment_response(objects: $paymentResponse) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
mutation INSERT_PAYMENT_RESPONSE(
|
||||
$paymentResponse: [payment_response_insert_input!]!
|
||||
) {
|
||||
insert_payment_response(objects: $paymentResponse) {
|
||||
returning {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_PAYMENT_RESPONSE_BY_PAYMENT_ID = gql`
|
||||
query QUERY_PAYMENT_RESPONSE_BY_PK($paymentid: uuid!) {
|
||||
payment_response(where: { paymentid: { _eq: $paymentid } }) {
|
||||
id
|
||||
jobid
|
||||
bodyshopid
|
||||
paymentid
|
||||
amount
|
||||
declinereason
|
||||
ext_paymentid
|
||||
successful
|
||||
response
|
||||
query QUERY_PAYMENT_RESPONSE_BY_PK($paymentid: uuid!) {
|
||||
payment_response(where: { paymentid: { _eq: $paymentid } }) {
|
||||
id
|
||||
jobid
|
||||
bodyshopid
|
||||
paymentid
|
||||
amount
|
||||
declinereason
|
||||
ext_paymentid
|
||||
successful
|
||||
response
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_RO_AND_OWNER_BY_JOB_PKS = gql`
|
||||
query QUERY_RO_AND_OWNER_BY_JOB_PKS($jobids: [uuid!]!) {
|
||||
jobs(where: { id: { _in: $jobids } }) {
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_ea
|
||||
ownr_zip
|
||||
query QUERY_RO_AND_OWNER_BY_JOB_PKS($jobids: [uuid!]!) {
|
||||
jobs(where: { id: { _in: $jobids } }) {
|
||||
ro_number
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_ea
|
||||
ownr_zip
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const GET_REFUNDABLE_AMOUNT_BY_JOBID = gql`
|
||||
query GET_REFUNDABLE_AMOUNT_BY_JOBID($jobid: uuid!) {
|
||||
payment_response_aggregate(where: { jobid: { _eq: $jobid } }) {
|
||||
aggregate {
|
||||
sum {
|
||||
amount
|
||||
query GET_REFUNDABLE_AMOUNT_BY_JOBID($jobid: uuid!) {
|
||||
payment_response_aggregate(where: { jobid: { _eq: $jobid } }) {
|
||||
aggregate {
|
||||
sum {
|
||||
amount
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,182 +1,182 @@
|
||||
import { gql } from "@apollo/client";
|
||||
import {gql} from "@apollo/client";
|
||||
|
||||
export const INSERT_NEW_PAYMENT = gql`
|
||||
mutation INSERT_NEW_PAYMENT($paymentInput: [payments_insert_input!]!) {
|
||||
insert_payments(objects: $paymentInput) {
|
||||
returning {
|
||||
id
|
||||
jobid
|
||||
amount
|
||||
payer
|
||||
created_at
|
||||
transactionid
|
||||
memo
|
||||
date
|
||||
type
|
||||
exportedat
|
||||
}
|
||||
mutation INSERT_NEW_PAYMENT($paymentInput: [payments_insert_input!]!) {
|
||||
insert_payments(objects: $paymentInput) {
|
||||
returning {
|
||||
id
|
||||
jobid
|
||||
amount
|
||||
payer
|
||||
created_at
|
||||
transactionid
|
||||
memo
|
||||
date
|
||||
type
|
||||
exportedat
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_ALL_PAYMENTS_PAGINATED = gql`
|
||||
query QUERY_ALL_PAYMENTS_PAGINATED(
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [payments_order_by!]!
|
||||
) {
|
||||
payments(offset: $offset, limit: $limit, order_by: $order) {
|
||||
id
|
||||
amount
|
||||
created_at
|
||||
date
|
||||
exportedat
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
query QUERY_ALL_PAYMENTS_PAGINATED(
|
||||
$offset: Int
|
||||
$limit: Int
|
||||
$order: [payments_order_by!]!
|
||||
) {
|
||||
payments(offset: $offset, limit: $limit, order_by: $order) {
|
||||
id
|
||||
amount
|
||||
created_at
|
||||
date
|
||||
exportedat
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
ro_number
|
||||
}
|
||||
memo
|
||||
payer
|
||||
paymentnum
|
||||
stripeid
|
||||
transactionid
|
||||
type
|
||||
}
|
||||
payments_aggregate {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
ro_number
|
||||
}
|
||||
memo
|
||||
payer
|
||||
paymentnum
|
||||
stripeid
|
||||
transactionid
|
||||
type
|
||||
}
|
||||
payments_aggregate {
|
||||
aggregate {
|
||||
count(distinct: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_PAYMENT = gql`
|
||||
mutation UPDATE_PAYMENT($paymentId: uuid!, $payment: payments_set_input!) {
|
||||
update_payments(where: { id: { _eq: $paymentId } }, _set: $payment) {
|
||||
returning {
|
||||
id
|
||||
amount
|
||||
created_at
|
||||
date
|
||||
exportedat
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
ro_number
|
||||
mutation UPDATE_PAYMENT($paymentId: uuid!, $payment: payments_set_input!) {
|
||||
update_payments(where: { id: { _eq: $paymentId } }, _set: $payment) {
|
||||
returning {
|
||||
id
|
||||
amount
|
||||
created_at
|
||||
date
|
||||
exportedat
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
ro_number
|
||||
}
|
||||
memo
|
||||
payer
|
||||
paymentnum
|
||||
stripeid
|
||||
transactionid
|
||||
type
|
||||
}
|
||||
}
|
||||
memo
|
||||
payer
|
||||
paymentnum
|
||||
stripeid
|
||||
transactionid
|
||||
type
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const UPDATE_PAYMENTS = gql`
|
||||
mutation UPDATE_PAYMENTS(
|
||||
$paymentIdList: [uuid!]!
|
||||
$payment: payments_set_input!
|
||||
) {
|
||||
update_payments(where: { id: { _in: $paymentIdList } }, _set: $payment) {
|
||||
returning {
|
||||
id
|
||||
amount
|
||||
created_at
|
||||
date
|
||||
exportedat
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
ro_number
|
||||
mutation UPDATE_PAYMENTS(
|
||||
$paymentIdList: [uuid!]!
|
||||
$payment: payments_set_input!
|
||||
) {
|
||||
update_payments(where: { id: { _in: $paymentIdList } }, _set: $payment) {
|
||||
returning {
|
||||
id
|
||||
amount
|
||||
created_at
|
||||
date
|
||||
exportedat
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
ro_number
|
||||
}
|
||||
memo
|
||||
payer
|
||||
paymentnum
|
||||
stripeid
|
||||
transactionid
|
||||
type
|
||||
}
|
||||
}
|
||||
memo
|
||||
payer
|
||||
paymentnum
|
||||
stripeid
|
||||
transactionid
|
||||
type
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_JOB_PAYMENT_TOTALS = gql`
|
||||
query QUERY_JOB_PAYMENT_TOTALS($id: uuid!) {
|
||||
jobs_by_pk(id: $id) {
|
||||
id
|
||||
job_totals
|
||||
payments {
|
||||
id
|
||||
amount
|
||||
date
|
||||
}
|
||||
query QUERY_JOB_PAYMENT_TOTALS($id: uuid!) {
|
||||
jobs_by_pk(id: $id) {
|
||||
id
|
||||
job_totals
|
||||
payments {
|
||||
id
|
||||
amount
|
||||
date
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const QUERY_PAYMENT_BY_ID = gql`
|
||||
query QUERY_PAYMENT_BY_ID($paymentId: uuid!) {
|
||||
payments_by_pk(id: $paymentId) {
|
||||
id
|
||||
amount
|
||||
created_at
|
||||
exportedat
|
||||
date
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
query QUERY_PAYMENT_BY_ID($paymentId: uuid!) {
|
||||
payments_by_pk(id: $paymentId) {
|
||||
id
|
||||
amount
|
||||
created_at
|
||||
exportedat
|
||||
date
|
||||
jobid
|
||||
job {
|
||||
id
|
||||
ownerid
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
owner {
|
||||
id
|
||||
ownr_co_nm
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
ro_number
|
||||
}
|
||||
memo
|
||||
payer
|
||||
paymentnum
|
||||
stripeid
|
||||
transactionid
|
||||
type
|
||||
}
|
||||
ro_number
|
||||
}
|
||||
memo
|
||||
payer
|
||||
paymentnum
|
||||
stripeid
|
||||
transactionid
|
||||
type
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||