Skip to content

Commit

Permalink
Builder, shorten entity names if too long, small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
r3-gabriel committed Nov 7, 2024
1 parent 13fe111 commit 45fdb70
Show file tree
Hide file tree
Showing 9 changed files with 180 additions and 192 deletions.
9 changes: 9 additions & 0 deletions www/comps/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,7 @@ table td.maximum{
margin:3px 8px 3px 0px;
display:flex;
flex-flow:row nowrap;
gap:calc(var(--spacing) / 2.5);
align-items:center;
justify-content:space-between;
font-size:100%;
Expand Down Expand Up @@ -945,6 +946,14 @@ table td.maximum{
display:flex;
flex-flow:column nowrap;
gap:5px;
flex:1 1 auto;
overflow:auto;
}
.generic-entry-list .lines span{
min-width:0px;
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
}
.generic-entry-list .subtitle{
font-size:80%;
Expand Down
2 changes: 1 addition & 1 deletion www/comps/builder/builderApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ let MyBuilderApiPreview = {
return out.length === 0 ? '' : `?${out.join('&')}`;
},
request:(s) => {
if(s.isAuth) return `{\n\t"username": "API_LOGIN_USERNAME",\n\t"password": "API_LOGIN_PASSWORD"\n}`;
if(s.isAuth) return `{\n\t"username": "API_USER_NAME",\n\t"password": "API_USER_PASSWORD"\n}`;
if(s.isPost) return s.getBodyPreview(true);
return s.capApp.empty;
},
Expand Down
2 changes: 1 addition & 1 deletion www/comps/builder/builderNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ let MyBuilderNew = {
computed:{
nameMaxLength:(s) => {
switch(s.entity) {
case 'api': return 64; break;
case 'api': return 60; break;
case 'collection': return 64; break;
case 'form': return 64; break;
case 'jsFunction': return 64; break;
Expand Down
70 changes: 33 additions & 37 deletions www/comps/builder/builderPgTriggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,40 @@ let MyBuilderPgTriggers = {
@click="idEdit = trg.id"
v-for="trg in triggers"
>
<div class="row centered gap">
<my-button image="databasePlay.png"
:active="false"
:naked="true"
/>
<div class="lines">
<span>{{ trg.fires }}</span>
<span class="subtitle">
{{ isFromRelation ? pgFunctionIdMap[trg.pgFunctionId].name + '()' : relationIdMap[trg.relationId].name }}
</span>
</div>
</div>
<div class="row centered gap">
<my-button image="recordCreate.png"
v-if="trg.onInsert"
:active="false"
:captionTitle="capApp.onInsert"
:naked="true"
/>
<my-button image="recordUpdate.png"
v-if="trg.onUpdate"
:active="false"
:captionTitle="capApp.onUpdate"
:naked="true"
/>
<my-button image="recordDelete.png"
v-if="trg.onDelete"
:active="false"
:captionTitle="capApp.onDelete"
:naked="true"
/>
<my-button image="lettersZzz.png"
v-if="trg.isDeferred"
:active="false"
:captionTitle="capApp.isDeferred"
:naked="true"
/>
<my-button image="databasePlay.png"
:active="false"
:naked="true"
/>
<div class="lines">
<span>{{ trg.fires }}</span>
<span class="subtitle">
{{ isFromRelation ? pgFunctionIdMap[trg.pgFunctionId].name + '()' : relationIdMap[trg.relationId].name }}
</span>
</div>
<my-button image="recordCreate.png"
v-if="trg.onInsert"
:active="false"
:captionTitle="capApp.onInsert"
:naked="true"
/>
<my-button image="recordUpdate.png"
v-if="trg.onUpdate"
:active="false"
:captionTitle="capApp.onUpdate"
:naked="true"
/>
<my-button image="recordDelete.png"
v-if="trg.onDelete"
:active="false"
:captionTitle="capApp.onDelete"
:naked="true"
/>
<my-button image="lettersZzz.png"
v-if="trg.isDeferred"
:active="false"
:captionTitle="capApp.isDeferred"
:naked="true"
/>
</div>
<my-builder-pg-trigger
Expand Down
20 changes: 8 additions & 12 deletions www/comps/builder/builderPresets.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@ let MyBuilderPresets = {
@click="idEdit = p.id"
v-for="p in relation.presets.filter(v => filter === '' || v.name.toLowerCase().includes(filter.toLowerCase()))"
>
<div class="row centered gap">
<my-button
:active="false"
:image="p.protected ? 'lock.png' : 'lockOpen.png'"
:naked="true"
/>
<div class="lines">
<span>{{ p.name }}</span>
<span class="subtitle">{{ getPreview(p) }}</span>
</div>
</div>
<div class="row centered gap">
<my-button
:active="false"
:image="p.protected ? 'lock.png' : 'lockOpen.png'"
:naked="true"
/>
<div class="lines">
<span>{{ p.name }}</span>
<span class="subtitle">{{ getPreview(p) }}</span>
</div>
</div>
Expand Down
154 changes: 73 additions & 81 deletions www/comps/builder/builderRelation.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,48 +188,44 @@ let MyBuilderRelation = {
@click="attributeIdEdit = atr.id"
v-for="atr in relation.attributes.filter(v => nameFilter === '' || v.name.includes(nameFilter.toLowerCase()))"
>
<div class="row centered gap">
<my-button
:active="false"
:captionTitle="capApp.attributeContent"
:image="getAttributeIcon(atr.content,atr.contentUse,false,false)"
:naked="true"
/>
<div class="lines">
<span>{{ atr.name }}</span>
<span class="subtitle" v-if="typeof atr.captions.attributeTitle[builderLanguage] !== 'undefined'">
[{{ atr.captions.attributeTitle[builderLanguage] }}]
</span>
</div>
</div>
<div class="row centered gap">
<my-button image="lock.png"
v-if="atr.encrypted"
:active="false"
:captionTitle="capApp.attributeEncrypted"
:naked="true"
/>
<my-button
v-if="isAttributeWithLength(atr.content) && atr.length !== 0"
:active="false"
:caption="'['+String(atr.length)+']'"
:captionTitle="capApp.attributeLength"
:naked="true"
/>
<my-button image="asterisk.png"
v-if="!atr.nullable"
:active="false"
:captionTitle="capApp.attributeNotNullable"
:naked="true"
/>
<my-button
:active="false"
:captionTitle="atr.iconId === null ? capApp.attributeNoIcon : capGen.icon"
:image="atr.iconId === null ? 'icon_missing.png' : ''"
:imageBase64="atr.iconId !== null ? srcBase64(iconIdMap[atr.iconId].file) : ''"
:naked="true"
/>
<my-button
:active="false"
:captionTitle="capApp.attributeContent"
:image="getAttributeIcon(atr.content,atr.contentUse,false,false)"
:naked="true"
/>
<div class="lines">
<span>{{ atr.name }}</span>
<span class="subtitle" v-if="typeof atr.captions.attributeTitle[builderLanguage] !== 'undefined'">
[{{ atr.captions.attributeTitle[builderLanguage] }}]
</span>
</div>
<my-button image="lock.png"
v-if="atr.encrypted"
:active="false"
:captionTitle="capApp.attributeEncrypted"
:naked="true"
/>
<my-button
v-if="isAttributeWithLength(atr.content) && atr.length !== 0"
:active="false"
:caption="'['+String(atr.length)+']'"
:captionTitle="capApp.attributeLength"
:naked="true"
/>
<my-button image="asterisk.png"
v-if="!atr.nullable"
:active="false"
:captionTitle="capApp.attributeNotNullable"
:naked="true"
/>
<my-button
:active="false"
:captionTitle="atr.iconId === null ? capApp.attributeNoIcon : capGen.icon"
:image="atr.iconId === null ? 'icon_missing.png' : ''"
:imageBase64="atr.iconId !== null ? srcBase64(iconIdMap[atr.iconId].file) : ''"
:naked="true"
/>
</div>
<!-- attribute dialog -->
Expand Down Expand Up @@ -262,46 +258,42 @@ let MyBuilderRelation = {
@click="indexIdEdit = ind.id"
v-for="ind in relation.indexes"
>
<div class="row centered gap">
<my-button image="databaseAsterisk.png"
:active="false"
:naked="true"
/>
<div class="lines"><span>{{ displayIndexName(ind) }}</span></div>
</div>
<div class="row centered gap">
<my-button image="asterisk.png"
v-if="ind.noDuplicates"
:active="false"
:captionTitle="capApp.indexUnique"
:naked="true"
/>
<my-button image="cogMultiple.png"
v-if="ind.primaryKey || ind.autoFki"
:active="false"
:captionTitle="capApp.indexSystem"
:naked="true"
/>
<my-button image="key.png"
v-if="ind.primaryKey"
:active="false"
:captionTitle="capApp.indexPrimaryKey"
:naked="true"
/>
<my-button
v-if="ind.autoFki"
:active="false"
:captionTitle="capApp.indexAutoFki"
:image="attributeIdMap[ind.attributes[0].attributeId].content === '1:1' ? 'link1.png' : 'link3.png'"
:naked="true"
/>
<my-button image="languages.png"
v-if="ind.method === 'GIN'"
:active="false"
:captionTitle="capApp.indexText"
:naked="true"
/>
</div>
<my-button image="databaseAsterisk.png"
:active="false"
:naked="true"
/>
<div class="lines"><span>{{ displayIndexName(ind) }}</span></div>
<my-button image="asterisk.png"
v-if="ind.noDuplicates"
:active="false"
:captionTitle="capApp.indexUnique"
:naked="true"
/>
<my-button image="cogMultiple.png"
v-if="ind.primaryKey || ind.autoFki"
:active="false"
:captionTitle="capApp.indexSystem"
:naked="true"
/>
<my-button image="key.png"
v-if="ind.primaryKey"
:active="false"
:captionTitle="capApp.indexPrimaryKey"
:naked="true"
/>
<my-button
v-if="ind.autoFki"
:active="false"
:captionTitle="capApp.indexAutoFki"
:image="attributeIdMap[ind.attributes[0].attributeId].content === '1:1' ? 'link1.png' : 'link3.png'"
:naked="true"
/>
<my-button image="languages.png"
v-if="ind.method === 'GIN'"
:active="false"
:captionTitle="capApp.indexText"
:naked="true"
/>
</div>
<!-- index dialog -->
Expand Down
45 changes: 23 additions & 22 deletions www/comps/builder/builderRelations.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,30 @@ let MyBuilderRelations = {
:title="r.comment"
:to="'/builder/relation/'+r.id"
>
<span>{{ r.name }}</span>
<div class="row gap">
<my-button image="lock.png"
v-if="r.encryption"
:active="false"
:captionTitle="capApp.encryptionHint"
:naked="true"
/>
<my-button image="time.png"
v-if="r.retentionCount !== null || r.retentionDays !== null"
:active="false"
:caption="displayRetention(r)"
:captionTitle="capApp.retentionHint"
:naked="true"
/>
<my-button image="files_list2.png"
v-if="r.attributes.length !== 0"
:active="false"
:caption="String(r.attributes.length)"
:captionTitle="capApp.attributes.replace('{CNT}',r.attributes.length)"
:naked="true"
/>
<div class="lines">
<span>{{ r.name }}</span>
<span class="subtitle" v-if="r.comment !== null">{{ r.comment }}</span>
</div>
<my-button image="lock.png"
v-if="r.encryption"
:active="false"
:captionTitle="capApp.encryptionHint"
:naked="true"
/>
<my-button image="time.png"
v-if="r.retentionCount !== null || r.retentionDays !== null"
:active="false"
:caption="displayRetention(r)"
:captionTitle="capApp.retentionHint"
:naked="true"
/>
<my-button image="files_list2.png"
v-if="r.attributes.length !== 0"
:active="false"
:caption="String(r.attributes.length)"
:captionTitle="capApp.attributes.replace('{CNT}',r.attributes.length)"
:naked="true"
/>
</router-link>
</div>
</div>
Expand Down
Loading

0 comments on commit 45fdb70

Please sign in to comment.