-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(demo): fetch the BPMN diagrams (#287)
Previously, the diagram was stored in JavaScript chunks. This increased the size of the chunks and did not reflect what an application generally does: it does not store diagrams, they are retrieved from services or APIs. Fetching the diagram reduces the size of the JavaScript chunks and makes the demo closer to a real application.
- Loading branch information
Showing
6 changed files
with
35 additions
and
9 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
Copyright 2024 Bonitasoft S.A. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// This is simple example of the BPMN diagram, loaded from a URL. The '?.url' extension support is provided by Vite. | ||
// See https://vitejs.dev/guide/assets#importing-asset-as-url | ||
// For other load methods, see https://github.com/process-analytics/bpmn-visualization-examples | ||
import diagramUrl from '../assets/bpmn/EC-purchase-orders-collapsed.xml?url'; | ||
|
||
export async function fetchDiagram(): Promise<string> { | ||
const response = await fetch(diagramUrl); | ||
return await response.text(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters