Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revive clone feature #2066

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/components/backend-ai-data-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,15 @@ export default class BackendAIData extends BackendAIPage {
: html``}
${this.enableStorageProxy
? html`
<!--<div class="horizontal layout flex wrap center justified">
<p style="color:rgba(0, 0, 0, 0.6);">
${_t('data.folders.Cloneable')}
</p>
<mwc-switch id="add-folder-cloneable" style="margin-right:10px;">
</mwc-switch>
</div>-->
<div class="horizontal layout flex wrap center justified">
<p style="color:rgba(0, 0, 0, 0.6);">
${_t('data.folders.Cloneable')}
</p>
<mwc-switch
id="add-folder-cloneable"
style="margin-right:10px;"
></mwc-switch>
</div>
`
: html``}
<div style="font-size:11px;">
Expand Down
45 changes: 25 additions & 20 deletions src/components/backend-ai-storage-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ import '@material/mwc-formfield';
import '@material/mwc-icon-button';
import '@material/mwc-list';
import '@material/mwc-radio';
// need to import explicitly
import { Radio } from '@material/mwc-radio';
import { Select } from '@material/mwc-select';
import '@material/mwc-switch';
import { Switch } from '@material/mwc-switch';
import '@material/mwc-textfield';
import { TextField } from '@material/mwc-textfield';
Expand Down Expand Up @@ -691,12 +693,13 @@ export default class BackendAiStorageList extends BackendAIPage {
></vaadin-grid-column>
${this.enableStorageProxy
? html`
<!--<vaadin-grid-column
auto-width flex-grow="0" resizable header="${_t(
'data.folders.Cloneable',
)}"
.renderer="${this
._boundCloneableRenderer}"></vaadin-grid-column>-->
<vaadin-grid-column
auto-width
flex-grow="0"
resizable
header="${_t('data.folders.Cloneable')}"
.renderer="${this._boundCloneableRenderer}"
></vaadin-grid-column>
`
: html``}
<vaadin-grid-column
Expand Down Expand Up @@ -773,13 +776,15 @@ export default class BackendAiStorageList extends BackendAIPage {
</mwc-select>
${this.enableStorageProxy
? html`
<!--<div class="horizontal layout flex wrap center justified">
<p style="color:rgba(0, 0, 0, 0.6);">
${_t('data.folders.Cloneable')}
</p>
<mwc-switch id="update-folder-cloneable" style="margin-right:10px;">
</mwc-switch>
</div>-->
<div class="horizontal layout flex wrap center justified">
<p style="color:rgba(0, 0, 0, 0.6);">
${_t('data.folders.Cloneable')}
</p>
<mwc-switch
id="update-folder-cloneable"
style="margin-right:10px;"
></mwc-switch>
</div>
`
: html``}
</div>
Expand Down Expand Up @@ -1878,13 +1883,12 @@ export default class BackendAiStorageList extends BackendAIPage {
text="${_t('data.folders.FolderInfo')}"
position="top-start"
></vaadin-tooltip>
<!--${this._hasPermission(rowData.item, 'r') &&
this.enableStorageProxy
${this._hasPermission(rowData.item, 'r') && this.enableStorageProxy
? html`
<mwc-icon-button
class="fg blue controls-running"
icon="content_copy"
disabled
?disabled=${!rowData.item.cloneable}
@click="${() => {
this._requestCloneFolder(rowData.item);
}}"
Expand All @@ -1896,7 +1900,7 @@ export default class BackendAiStorageList extends BackendAIPage {
position="top-start"
></vaadin-tooltip>
`
: html``}-->
: html``}
${rowData.item.is_owner
? html`
<mwc-icon-button
Expand Down Expand Up @@ -2860,9 +2864,10 @@ export default class BackendAiStorageList extends BackendAIPage {
* @param {HTMLElement} selectedItem - selected Vfolder to clone
*/
_requestCloneFolder(selectedItem) {
// temporary diable cloning folder until the logic of cloning large size of virtual folder is optimized
/* const event = new CustomEvent('backend-ai-vfolder-cloning', {'detail': selectedItem});
document.dispatchEvent(event); */
const event = new CustomEvent('backend-ai-vfolder-cloning', {
detail: selectedItem,
});
document.dispatchEvent(event);
}

/**
Expand Down