This repository has been archived by the owner on Oct 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Add latest ruleset page #98
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,4 +1,113 @@ | ||
<template> | ||
<div> | ||
</div> | ||
<v-container id="consult"> | ||
<h1>{{path}}</h1> | ||
|
||
<v-layout> | ||
<v-flex md2 mt-5> | ||
<v-toolbar color="grey" dark> | ||
<v-toolbar-title>Parameters</v-toolbar-title> | ||
</v-toolbar> | ||
<v-card class="height-card scroll"> | ||
<v-card-text | ||
v-for="param in ruleset.signature.params" | ||
:key="param.name" | ||
>{{param.name}}: {{param.type}}</v-card-text> | ||
</v-card> | ||
</v-flex> | ||
|
||
<v-flex md2 ma-5> | ||
<v-toolbar color="grey" dark> | ||
<v-toolbar-title>Return type</v-toolbar-title> | ||
</v-toolbar> | ||
<v-card class="height-card"> | ||
<v-card-text>{{ruleset.signature.returnType}}</v-card-text> | ||
</v-card> | ||
</v-flex> | ||
|
||
<v-flex md2 ma-5> | ||
<v-toolbar color="grey" dark> | ||
<v-toolbar-title>Versions</v-toolbar-title> | ||
</v-toolbar> | ||
<v-card class="height-card scroll"> | ||
<v-card-text v-for="version in ruleset.versions" :key="version">{{version}}</v-card-text> | ||
</v-card> | ||
</v-flex> | ||
|
||
<v-flex md3></v-flex> | ||
|
||
<v-flex md3 mt-5> | ||
<!-- change the link to edit page --> | ||
<router-link to="/rulesets/new"> | ||
<v-btn dark color="primary">Edit</v-btn> | ||
</router-link> | ||
</v-flex> | ||
</v-layout> | ||
|
||
<!-- delegate rules to Rules component --> | ||
<Rules v-model="ruleset" :editMode="false"/> | ||
</v-container> | ||
</template> | ||
|
||
<script> | ||
// import axios from 'axios'; | ||
import { Ruleset, Rule, Signature, Param } from '../NewRuleset/ruleset'; | ||
import Rules from '../NewRuleset/Rules.vue'; | ||
|
||
export default { | ||
components: { | ||
Rules, | ||
}, | ||
|
||
props: { | ||
path: { | ||
type: String, | ||
}, | ||
}, | ||
|
||
data() { | ||
return { | ||
ruleset: new Ruleset({ | ||
path: this.path, | ||
signature: new Signature('string', [ | ||
new Param('foo', 'string'), | ||
new Param('bar', 'int64'), | ||
new Param('baz', 'float64'), | ||
new Param('baz1', 'float64'), | ||
new Param('baz2', 'float64'), | ||
new Param('baz3', 'float64'), | ||
new Param('baz4', 'float64'), | ||
]), | ||
|
||
rules: [ | ||
new Rule( | ||
`(and | ||
(eq 1 1) | ||
(eq 2 2) | ||
)`, | ||
'wesh', | ||
), | ||
new Rule('#true', 'bien'), | ||
], | ||
version: 'abc123', | ||
versions: ['def123', 'ghi123', 'xyz123'], | ||
}), | ||
}; | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
#consult { | ||
.height-card { | ||
height: 200px; | ||
} | ||
|
||
.scroll { | ||
overflow-y: auto; | ||
} | ||
|
||
.rounded-card { | ||
border-radius: 50px; | ||
} | ||
} | ||
</style> |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because JS, and particularly Vue, is not our "normal" work, I think we should try to be especially diligent about adding comments / docstrings to methods. What seems obvious today, might be obscure in a months time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree but for this one I think that it's not necessary to add comment.
The
data
property is the main important things to know in Vue, it's for that reason that I didn't add comment, for example, it's like adding comment on top of themain
function in a Go program.