-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1163 from swissgeol/GSNGM-815-delete-project
Allow user to delete a project
- Loading branch information
Showing
11 changed files
with
158 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
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
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,57 @@ | ||
import {html} from 'lit'; | ||
import {customElement, property} from 'lit/decorators.js'; | ||
import $ from '../../jquery.js'; | ||
import i18next from 'i18next'; | ||
import {LitElementI18n} from '../../i18n.js'; | ||
|
||
import 'fomantic-ui-css/components/dimmer.js'; | ||
import 'fomantic-ui-css/components/modal.js'; | ||
|
||
@customElement('ngm-delete-warning-modal') | ||
export class NgmDeleteWarningModal extends LitElementI18n { | ||
@property({type: Boolean}) | ||
accessor show = false; | ||
element; | ||
|
||
firstUpdated(_changedProperties) { | ||
this.element = $('.ngm-delete-warning-modal.ui.modal').modal({ | ||
centered: true, | ||
onHidden: () => this.show = false, | ||
onApprove: () => this.dispatchEvent(new CustomEvent('onProjectDeleted', {bubbles: true})) | ||
}); | ||
super.firstUpdated(_changedProperties); | ||
} | ||
|
||
updated(changedProperties) { | ||
if (changedProperties.has('show') && this.show) { | ||
this.element.modal('show'); | ||
} else if (!this.show) { | ||
this.element.modal('hide'); | ||
} | ||
super.updated(changedProperties); | ||
} | ||
|
||
render() { | ||
return html` | ||
<div class="ngm-delete-warning-modal ui small modal"> | ||
<div class="content"> | ||
<h3>${i18next.t('dashboard_delete_warning_title')}</h3> | ||
<p>${i18next.t('dashboard_delete_warning_description')}</p> | ||
</div> | ||
<div class="actions"> | ||
<div class="ui cancel button ngm-cancel-btn"> | ||
${i18next.t('cancel')} | ||
</div> | ||
<div class="ui ok button ngm-action-btn"> | ||
${i18next.t('delete')} | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
} | ||
|
||
createRenderRoot() { | ||
// no shadow dom | ||
return this; | ||
} | ||
} |
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,9 +1,11 @@ | ||
.ngm-gst-modal.ui.modal embed { | ||
.ngm-gst-modal.ui.modal embed, | ||
.ngm-delete-warning-modal embed { | ||
width: 100%; | ||
height: 500px; | ||
} | ||
|
||
.ngm-gst-modal .actions { | ||
.ngm-gst-modal .actions, | ||
.ngm-delete-warning-modal .actions { | ||
display: flex; | ||
justify-content: end; | ||
} |