forked from finos/waltz
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
526 additions
and
4 deletions.
There are no files selected for viewing
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,32 @@ | ||
import {remote} from "./remote"; | ||
|
||
|
||
export function mkSvgDiagramStore() { | ||
|
||
const findAll = (force) => remote | ||
.fetchAppList( | ||
"GET", | ||
"api/svg-diagram", | ||
[], | ||
{force}); | ||
|
||
const save = (diagram) => remote | ||
.execute( | ||
"POST", | ||
"api/svg-diagram/save", | ||
diagram); | ||
|
||
const remove = (diagramId) => remote | ||
.execute( | ||
"DELETE", | ||
`api/svg-diagram/${diagramId}`); | ||
|
||
return { | ||
findAll, | ||
save, | ||
remove | ||
}; | ||
} | ||
|
||
|
||
export const svgDiagramStore = mkSvgDiagramStore(); |
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,40 @@ | ||
/* | ||
* Waltz - Enterprise Architecture | ||
* Copyright (C) 2016, 2017, 2018, 2019 Waltz open source project | ||
* See README.md for more information | ||
* | ||
* 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 | ||
* | ||
*/ | ||
import {initialiseData} from "../common"; | ||
import NavAidsAdminView from "./svelte/nav-aids/NavAidsAdminView.svelte"; | ||
|
||
|
||
const initialState = { | ||
NavAidsAdminView | ||
}; | ||
|
||
|
||
function controller() { | ||
const vm = initialiseData(this, initialState); | ||
} | ||
|
||
|
||
controller.$inject = []; | ||
|
||
|
||
export default { | ||
template: `<waltz-svelte-component component="$ctrl.NavAidsAdminView"></waltz-svelte-component>`, | ||
controller, | ||
controllerAs: "$ctrl", | ||
bindToController: true, | ||
}; |
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
159 changes: 159 additions & 0 deletions
159
waltz-ng/client/system/svelte/nav-aids/NavAidEditView.svelte
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,159 @@ | ||
<script> | ||
import {createEventDispatcher, onMount} from "svelte"; | ||
export let diagram; | ||
let working = { | ||
id: null, | ||
name: null, | ||
group: null, | ||
description: null, | ||
svg: null, | ||
priority: null, | ||
keyProperty: null, | ||
product: null, | ||
displayHeightPercent: null, | ||
displayWidthPercent: null | ||
} | ||
const dispatch = createEventDispatcher(); | ||
onMount(() => { | ||
working = Object.assign({}, working, diagram) | ||
}) | ||
function cancel() { | ||
dispatch("cancel"); | ||
} | ||
function onSave() { | ||
dispatch("save", working); | ||
} | ||
</script> | ||
|
||
<div> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<form autocomplete="off" | ||
on:submit|preventDefault={onSave}> | ||
|
||
<div class="form-group"> | ||
<label for="name">Name<span style="color: red" title="This field is mandatory">*</span></label> | ||
<input type="text" | ||
class="form-control" | ||
id="name" | ||
bind:value={working.name} | ||
placeholder="Name" | ||
required> | ||
</div> | ||
<div class="form-group"> | ||
<label for="group">Group<span style="color: red" title="This field is mandatory">*</span></label> | ||
<input type="text" | ||
class="form-control" | ||
id="group" | ||
bind:value={working.group} | ||
placeholder="Group" | ||
required> | ||
<div class="help-block"> | ||
This is used to indicate where to display the diagram. If diagrams share a group they will appear in tabs. | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label for="description">Description</label> | ||
<textarea class="form-control" | ||
id="description" | ||
bind:value={working.description} | ||
placeholder="Description" | ||
rows="3"/> | ||
<div class="help-block"> | ||
Description of the diagram. Markdown is supported. | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label for="priority">Priority<span style="color: red" title="This field is mandatory">*</span></label> | ||
<input class="form-control" | ||
type="number" | ||
id="priority" | ||
style="width: 20%" | ||
required="required" | ||
placeholder="Priority for this diagram in when ordered within a group" | ||
bind:value={working.priority}> | ||
<div class="help-block"> | ||
Priority, used for ordering diagrams. | ||
Lower numbers go first, name is used as a tie breaker. | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label for="keyProperty">Key Property<span style="color: red" title="This field is mandatory">*</span></label> | ||
<input type="text" | ||
class="form-control" | ||
id="keyProperty" | ||
bind:value={working.keyProperty} | ||
placeholder="Key Property" | ||
required> | ||
<div class="help-block"> | ||
This is used to indicate the attribute which holds data for this diagram (to render links). | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label for="group">Product<span style="color: red" title="This field is mandatory">*</span></label> | ||
<input type="text" | ||
class="form-control" | ||
id="product" | ||
bind:value={working.product} | ||
placeholder="none" | ||
required> | ||
<div class="help-block"> | ||
The product used to produce the diagram. | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="displayWidthPercent">Display Width Percent</label> | ||
<input class="form-control" | ||
type="number" | ||
id="displayWidthPercent" | ||
style="width: 20%" | ||
bind:value={working.displayWidthPercent}> | ||
<div class="help-block"> | ||
Used to size the diagram | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="displayHeightPercent">Display Height Percent</label> | ||
<input class="form-control" | ||
type="number" | ||
id="displayHeightPercent" | ||
style="width: 20%" | ||
bind:value={working.displayHeightPercent}> | ||
<div class="help-block"> | ||
Used to size the diagram | ||
</div> | ||
</div> | ||
|
||
|
||
<div class="form-group"> | ||
<label for="diagram">Diagram<span style="color: red" title="This field is mandatory">*</span></label> | ||
<textarea class="form-control" | ||
id="diagram" | ||
bind:value={working.svg} | ||
rows="6" | ||
required/> | ||
</div> | ||
|
||
|
||
<button type="submit" | ||
class="btn btn-primary"> | ||
Save | ||
</button> | ||
<button class="btn btn-default" | ||
on:click|preventDefault={cancel}> | ||
Cancel | ||
</button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> |
35 changes: 35 additions & 0 deletions
35
waltz-ng/client/system/svelte/nav-aids/NavAidRemovalConfirmation.svelte
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,35 @@ | ||
<script> | ||
import {createEventDispatcher} from "svelte"; | ||
export let diagram; | ||
const dispatch = createEventDispatcher(); | ||
function remove() { | ||
dispatch("remove", diagram); | ||
} | ||
function cancel() { | ||
dispatch("cancel"); | ||
} | ||
</script> | ||
|
||
|
||
<h4>Are you sure you want to remove diagram: {diagram.name}?</h4> | ||
<div class="help-block">This will remove it from all views for all users. | ||
If you wish to retain the diagram but hide from view you should update the group information to a reference that is not used on a page. | ||
e.g. '<i>GROUP_NAME</i>.OLD' | ||
</div> | ||
|
||
<div> | ||
<button class="btn btn-danger" | ||
on:click={remove}> | ||
Remove | ||
</button> | ||
<button class="btn btn-default" | ||
on:click={cancel}> | ||
Cancel | ||
</button> | ||
</div> |
Oops, something went wrong.