- added backup codes for 2 factor authentication
Some checks failed
CI Pipeline / japa-tests (push) Failing after 58s

- npm updates
- coverage validation: elevation ust be positive, depth must be negative
- vinejs-provider.js: get enabled extensions from database, not via validOptions.extnames
- vue components for backup codes: e.g.: PersonalSettings.vue
- validate spaital coverage in leaflet map: draw.component.vue, map.component.vue
- add backup code authentication into Login.vue
- preset to use no preferred reviewer: Release.vue
- 2 new vinejs validation rules: file_scan.ts and file-length.ts
This commit is contained in:
Kaimbacher 2024-07-08 13:52:20 +02:00
parent ac473b1e72
commit 005df2e454
32 changed files with 1416 additions and 526 deletions

View file

@ -4,13 +4,10 @@
<fa-icon [icon]="faSearchLocation"></fa-icon>
</button> -->
<!-- -->
<button
ref="inputDraw"
<button ref="inputDraw"
class="inline-flex cursor-pointer justify-center items-center whitespace-nowrap focus:outline-none transition-colors duration-150 border rounded ring-blue-700 text-black border-teal-50 hover:bg-gray-200 text-sm p-1"
type="button"
:class="[_enabled ? 'cursor-not-allowed bg-cyan-200' : 'bg-teal-50 is-active']"
@click.prevent="toggleDraw"
>
type="button" :class="[_enabled ? 'cursor-not-allowed bg-cyan-200' : 'bg-teal-50 is-active']"
@click.prevent="toggleDraw">
<BaseIcon v-if="mdiDrawPen" :path="mdiDrawPen" />
</button>
</div>
@ -28,6 +25,8 @@ import { Map } from 'leaflet/src/map/index';
import { on, off, preventDefault } from 'leaflet/src/dom/DomEvent';
import { Rectangle } from 'leaflet/src/layer/vector/Rectangle';
import { LatLngBounds } from 'leaflet/src/geo/LatLngBounds';
import { LatLng } from 'leaflet';
import { LeafletMouseEvent } from 'leaflet';
@Component({
name: 'draw-control',
@ -58,19 +57,19 @@ export default class DrawControlComponent extends Vue {
@Prop() public mapId: string;
// @Prop() public map: Map;
@Prop public southWest: LatLngBounds;
@Prop public northEast: LatLngBounds;
@Prop public southWest: LatLng;
@Prop public northEast: LatLng;
@Prop({
default: true,
})
public preserve: boolean;
mapService = MapService();
public _enabled;
public _enabled: boolean;
private _map: Map;
private _isDrawing: boolean = false;
private _startLatLng;
private _mapDraggable;
private _startLatLng: LatLng;
private _mapDraggable: boolean;
private _shape: Rectangle | undefined;
enable() {
@ -80,6 +79,7 @@ export default class DrawControlComponent extends Vue {
this._enabled = true;
this.addHooks();
this._map.control = this;
return this;
}
@ -111,6 +111,7 @@ export default class DrawControlComponent extends Vue {
// this._map.domElement.style.cursor = 'crosshair';
this._map._container.style.cursor = 'crosshair';
// this._tooltip.updateContent({text: this._initialLabelText});
this._map
.on('mousedown', this._onMouseDown, this)
.on('mousemove', this._onMouseMove, this)
@ -157,7 +158,7 @@ export default class DrawControlComponent extends Vue {
this._isDrawing = false;
}
private _onMouseDown(e) {
private _onMouseDown(e: LeafletMouseEvent) {
this._isDrawing = true;
this._startLatLng = e.latlng;
@ -169,7 +170,7 @@ export default class DrawControlComponent extends Vue {
preventDefault(e.originalEvent);
}
private _onMouseMove(e) {
private _onMouseMove(e: LeafletMouseEvent) {
var latlng = e.latlng;
// this._tooltip.updatePosition(latlng);
@ -191,13 +192,21 @@ export default class DrawControlComponent extends Vue {
}
}
private _fireCreatedEvent(shape) {
private _fireCreatedEvent(shape: Rectangle) {
var rectangle = new Rectangle(shape.getBounds(), this.options.shapeOptions);
// L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this, rectangle);
this._map.fire('Draw.Event.CREATED', { layer: rectangle, type: this.TYPE });
}
public drawShape(southWest, northEast) {
public removeShape() {
if (this._shape) {
this._map.removeLayer(this._shape);
// delete this._shape;
this._shape = undefined;
}
}
public drawShape(southWest: LatLng, northEast: LatLng) {
if (!this._shape) {
const bounds = new LatLngBounds(southWest, northEast);
this._shape = new Rectangle(bounds, this.options.shapeOptions);
@ -210,7 +219,7 @@ export default class DrawControlComponent extends Vue {
}
// from Draw Rectangle
private _drawShape(latlng) {
private _drawShape(latlng: LatLng) {
if (!this._shape) {
const bounds = new LatLngBounds(this._startLatLng, latlng);
this._shape = new Rectangle(bounds, this.options.shapeOptions);